Hi Aleksander,
> Thanks for reporting this. Did you investigate whether Meson also has
> this issue? Fixing anything for Autotools arguably has low priority
> since we are going to get rid of it in the near future, but Meson is
> another matter.
Thanks for the reply. Yes, I tested with Meson and confirmed the same
issue occurs.
When building PostgreSQL 17.2 with ThreadSanitizer:
meson setup builddir \
--prefix=/path/to/install \
--buildtype=debug \
-Dcassert=true \
-Dtap_tests=enabled \
-Db_lto=false \
-Db_sanitize=thread \
-Db_lundef=false \
-Dc_args="-O0 -g -gdwarf-2 -fno-omit-frame-pointer"
The postgres binary segfaults during early initialization, exactly as
with the Autotools build.
Applying the patch I submitted, which moves __ubsan_default_options()
to a separate compilation unit built without sanitizer
instrumentation, successfully resolves the segfault.
Thanks & regards,
Emmanuel Sibi