Re: ubsan

Noah Misch <noah@leadboat.com>

From: Noah Misch <noah@leadboat.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Andres Freund <andres@anarazel.de>, pgsql-hackers@postgresql.org
Date: 2022-03-24T06:23:23Z
Lists: pgsql-hackers
On Wed, Mar 23, 2022 at 03:58:09PM -0400, Tom Lane wrote:
> Andres Freund <andres@anarazel.de> writes:
> > I think we should backpatch both, based on the reasoning in
> > 46ab07ffda9d6c8e63360ded2d4568aa160a7700 ?
> 
> Yeah, I suppose.  Is anyone going to step up and run a buildfarm
> member with ubsan enabled?

thorntail has been running with UBSan since 2019.  I've removed flag
-fno-sanitize=nonnull-attribute, which your changes rendered superfluous.



Commits

  1. Avoid possible crash within libsanitizer.

  2. ci: Use -fsanitize=undefined,alignment,address in linux tasks

  3. Add workaround to make ubsan and ps_status.c compatible

  4. Don't try to translate NULL in GetConfigOptionByNum().

  5. Don't call fwrite() with len == 0 when writing out relcache init file.

  6. configure: check for dlsym instead of dlopen.

  7. Clean up assorted failures under clang's -fsanitize=undefined checks.