Re: ubsan
Alexander Law <exclusion@gmail.com>
From: Alexander Lakhin <exclusion@gmail.com>
To: Andres Freund <andres@anarazel.de>, Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-hackers@postgresql.org
Date: 2023-09-27T11:00:00Z
Lists: pgsql-hackers
Hello Andres, 22.11.2022 02:15, Andres Freund wrote: > Hi, > > On 2022-09-29 18:17:55 -0700, Andres Freund wrote: >> Attached is a rebased version of this patch. Hopefully with a reasonable >> amount of comments? I kind of wanted to add a comment to reached_main, but it >> just seems to end up restating the variable name... > I've now pushed a version of this with a few cleanups, mostly in > .cirrus.yml. It'll be interesting to see how many additional problems > it finds via cfbot. I've just discovered that that function __ubsan_default_options() is incompatible with -fsanitize=hwaddress: $ tmp_install/usr/local/pgsql/bin/postgres Segmentation fault Program received signal SIGSEGV, Segmentation fault. 0x000000555639e3ec in __hwasan_check_x0_0 () (gdb) bt #0 0x000000555639e3ec in __hwasan_check_x0_0 () #1 0x000000555697b5a8 in __ubsan_default_options () at main.c:446 #2 0x0000005556367e48 in InitializeFlags () at /home/builder/.termux-build/libllvm/src/compiler-rt/lib/hwasan/hwasan.cpp:133 #3 __hwasan_init () at /home/builder/.termux-build/libllvm/src/compiler-rt/lib/hwasan/hwasan.cpp:351 #4 0x0000007ff7f4929c in __dl__ZL13call_functionPKcPFviPPcS2_ES0_ () from /system/bin/linker64 #5 0x0000007ff7f4900c in __dl__ZL10call_arrayIPFviPPcS1_EEvPKcPT_mbS5_ () from /system/bin/linker64 #6 0x0000007ff7f45670 in __dl__ZL29__linker_init_post_relocationR19KernelArgumentBlockR6soinfo () from /system/bin/linker64 #7 0x0000007ff7f449c8 in __dl___linker_init () from /system/bin/linker64 #8 0x0000007ff7f4b208 in __dl__start () from /system/bin/linker64 I use clang version 16.0.6, Target: aarch64-unknown-linux-android24. With just 'return ""' in __ubsan_default_options(), I've managed to run `make check` (there is also an issue with check_stack_depth(), but that's another story)... Best regards, Alexander
Commits
-
Avoid possible crash within libsanitizer.
- d4baa327a1c9 19 (unreleased) landed
- c775bf048abd 16.11 landed
- a9515f294de1 17.7 landed
- 6d8acb777715 18.1 landed
-
ci: Use -fsanitize=undefined,alignment,address in linux tasks
- bd82928625e7 16.0 landed
-
Add workaround to make ubsan and ps_status.c compatible
- f686ae82f2d7 16.0 landed
-
Don't try to translate NULL in GetConfigOptionByNum().
- 81045e1e1c33 14.3 landed
- c0f99bb520da 13.7 landed
- 61a007feed52 12.11 landed
- 3ac7d024122f 15.0 landed
-
Don't call fwrite() with len == 0 when writing out relcache init file.
- 5f4615b9def5 10.21 landed
- 2121d58091a3 11.16 landed
- c5b60a68cc08 12.11 landed
- 8014c61ebda1 13.7 landed
- 89a94c24aadd 14.3 landed
- 1c6bb380e5ab 15.0 landed
-
configure: check for dlsym instead of dlopen.
- e52e9bd57f33 14.3 landed
- 7c163aa93fe6 13.7 landed
- 6a767bc2e712 12.11 landed
- a77dddb42e09 11.16 landed
- 2a919372655d 10.21 landed
- e71c76fcab8d 15.0 landed
-
Clean up assorted failures under clang's -fsanitize=undefined checks.
- 46ab07ffda9d 15.0 cited