Comment 8 for bug 2023424

Revision history for this message
Dimitry Andric (dimitry.unified-streaming.com) wrote :

It's pretty strange, but the upstream fix does not seem to work on Ubuntu, at least not on 24.04. I tried Debian Sid, and there the regular gcc-13 package (13.2.0-24) has no trouble at all with the test case: no alignment issue, no segfaults.

Whereas on Ubuntu 24.04, anything after upstream's https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=28219f7f99a80519d1c6ab5e5dc83b4c7f8d7251 (libsanitizer: merge from upstream) and https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=aaf0f12175bfc0a7bdc6c80b8d481fb09ae44e25 (libsanitizer: Apply local patches) just segfaults, e.g.:

Program received signal SIGSEGV, Segmentation fault.
0x00007f5b91d9ba44 in __interception::InterceptFunction (name=0x7f5b91dc5717 "strcat", ptr_to_real=0x7f5b91d44128 <__interception::real_strcat>, func=140031265358128, trampoline=140031265358128)
    at /home/ubuntu/src/gcc/master/libsanitizer/interception/interception_linux.cpp:62
warning: Source file is more recent than executable.
62 *ptr_to_real = (uptr)addr;
(gdb) bt
#0 0x00007f5b91d9ba44 in __interception::InterceptFunction (name=0x7f5b91dc5717 "strcat", ptr_to_real=0x7f5b91d44128 <__interception::real_strcat>, func=140031265358128,
    trampoline=140031265358128) at /home/ubuntu/src/gcc/master/libsanitizer/interception/interception_linux.cpp:62
#1 0x00007f5b91d477d4 in __asan::InitializeAsanInterceptors () at /home/ubuntu/src/gcc/master/libsanitizer/asan/asan_interceptors.cpp:759
#2 0x00007f5b91d5c2b1 in __asan::AsanInitInternal () at /home/ubuntu/src/gcc/master/libsanitizer/asan/asan_rtl.cpp:446
#3 0x00007f5b91d5c819 in __asan_init () at /home/ubuntu/src/gcc/master/libsanitizer/asan/asan_rtl.cpp:626
#4 0x00007f5b92345873 in _dl_init (main_map=0x7f5b923792e0, argc=1, argv=0x7fffed4940b8, env=0x7fffed4940c8) at ./elf/dl-init.c:106
#5 0x00007f5b9235f5a0 in _dl_start_user () from /lib64/ld-linux-x86-64.so.2
#6 0x0000000000000001 in ?? ()
#7 0x00007fffed495667 in ?? ()
#8 0x0000000000000000 in ?? ()