ASAN getaddrinfo() crash with gcc-toolset-13-libasan-devel on RHEL 8.9

Posted on

GCC produced binaries are crashing when getaddrinfo is called with a hostname that does not exist /etc/hosts. The current gcc-toolset-13-libasan-devel RPM appears to be linked incorrectly.

Thread 1 "test" received signal SIGINT, Interrupt.
0x00007ffff65da6cd in __pthread_timedjoin_ex () from /lib64/libpthread.so.0
Missing separate debuginfos, use: dnf debuginfo-install glibc-2.28-236.el8_9.12.x86_64 libasan8-13.1.1-4.3.el8.x86_64 libgcc-8.5.0-20.el8.x86_64 libstdc++-8.5.0-20.el8.x86_64
(gdb) r AsSockAddrTest::test_is_localhost
Starting program: /test SockAddrTest::test_is_localhost
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
Log file is ./cxxtest.log
Running 1 test
created sandbox dir /tmp/asunit-3471071--cdd95eb8-856e-44d9-bd61-0954cdf5cc51

Program received signal SIGSEGV, Segmentation fault.
0x0000000000000000 in ?? ()
(gdb) bt
#0  0x0000000000000000 in ?? ()
#1  0x00007ffff759c480 in __interceptor___dn_expand.part.0 () from /lib64/libasan.so.8
#2  0x00007ffff30e8a70 in gaih_getanswer_slice.isra () from /lib64/libnss_dns.so.2
#3  0x00007ffff30e93f3 in _nss_dns_gethostbyname4_r () from /lib64/libnss_dns.so.2
#4  0x00007ffff632437d in gaih_inet.constprop () from /lib64/libc.so.6
#5  0x00007ffff632561b in getaddrinfo () from /lib64/libc.so.6
#6  0x00007ffff75e2fc5 in __interceptor_getaddrinfo.part.0 () from /lib64/libasan.so.8

Responses