]> git.ipfire.org Git - thirdparty/systemd.git/commit
test: enable LSan for certain wrapped binaries 28178/head
authorFrantisek Sumsal <frantisek@sumsal.cz>
Wed, 28 Jun 2023 07:53:13 +0000 (09:53 +0200)
committerFrantisek Sumsal <frantisek@sumsal.cz>
Wed, 28 Jun 2023 15:04:31 +0000 (17:04 +0200)
commit2b5e786005d8854600bb43335fd0c4067ce8da08
tree3f090bb90b45d4002b669c64a7e0a84d5ac2653b
parent0f90d4f0c32220f538b2505f2b5378a8791c8d55
test: enable LSan for certain wrapped binaries

So we're able to detect memory leaks in our NSS modules.

An example after introducing a memory leak in nss-myhostname.c:

testsuite-71.sh[2881]: =================================================================
testsuite-71.sh[2881]: ==2880==ERROR: LeakSanitizer: detected memory leaks
testsuite-71.sh[2881]: Direct leak of 2 byte(s) in 1 object(s) allocated from:
testsuite-71.sh[2881]:     #0 0x7fa28907243b in strdup (/usr/lib64/libasan.so.8.0.0+0x7243b)
testsuite-71.sh[2881]:     #1 0x7fa286a7bc10 in gethostname_full ../src/basic/hostname-util.c:67
testsuite-71.sh[2881]:     #2 0x7fa286a74af9 in gethostname_malloc ../src/basic/hostname-util.h:24
testsuite-71.sh[2881]:     #3 0x7fa286a756f4 in _nss_myhostname_gethostbyname4_r ../src/nss-myhostname/nss-myhostname.c:79
testsuite-71.sh[2881]:     #4 0x7fa288f17588 in getaddrinfo (/lib64/libc.so.6+0xf4588)
testsuite-71.sh[2881]:     #5 0x7fa2890a4d93 in __interceptor_getaddrinfo.part.0 (/usr/lib64/libasan.so.8.0.0+0xa4d93)
testsuite-71.sh[2881]:     #6 0x55a54b2b7159 in ahosts_keys_int.part.0 (/usr/bin/getent.orig+0x4159)
testsuite-71.sh[2881]: SUMMARY: AddressSanitizer: 2 byte(s) leaked in 1 allocation(s).
test/test-functions