Closed kravietz closed 2 years ago
Are the backtrace truncated? What are the callers of those xalloc methods?
@gollub Nope, that's what ASAN dumps :) These functions are called in plenty of places so I'm not surprised they aren't all freed perfectly...
More details with extra ASAN options:
==14185==ERROR: LeakSanitizer: detected memory leaks
Direct leak of 24 byte(s) in 1 object(s) allocated from:
#0 0x7f766db2dd28 in __interceptor_calloc (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xded28)
#1 0x7f766d8382b0 in xcalloc libtac/lib/xalloc.c:31
#2 0x7f766d83004e in _tac_add_attrib_pair libtac/lib/attrib.c:74
#3 0x7f766d8335d3 in tac_author_read_timeout libtac/lib/author_r.c:263
#4 0x565049269f66 in main /home/build/pam-tacplus/tacc.c:327
#5 0x7f766c72bbf6 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21bf6)
#6 0x56504926a5b9 in _start (/home/build/pam-tacplus/.libs/tacc+0x55b9)
Direct leak of 18 byte(s) in 1 object(s) allocated from:
#0 0x7f766dac6538 in strdup (/usr/lib/x86_64-linux-gnu/libasan.so.4+0x77538)
#1 0x7f766d8383a1 in xstrdup libtac/lib/xalloc.c:66
#2 0x7f766d833f44 in tac_author_read_timeout libtac/lib/author_r.c:222
#3 0x565049269f66 in main /home/build/pam-tacplus/tacc.c:327
#4 0x7f766c72bbf6 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21bf6)
#5 0x56504926a5b9 in _start (/home/build/pam-tacplus/.libs/tacc+0x55b9)
Direct leak of 15 byte(s) in 1 object(s) allocated from:
#0 0x7f766dac6538 in strdup (/usr/lib/x86_64-linux-gnu/libasan.so.4+0x77538)
#1 0x7f766d8383a1 in xstrdup libtac/lib/xalloc.c:66
#2 0x7f766d82e654 in tac_acct_read_timeout libtac/lib/acct_r.c:156
#3 0x56504926a083 in main /home/build/pam-tacplus/tacc.c:377
#4 0x7f766c72bbf6 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21bf6)
#5 0x56504926a5b9 in _start (/home/build/pam-tacplus/.libs/tacc+0x55b9)
Indirect leak of 13 byte(s) in 1 object(s) allocated from:
#0 0x7f766db2dd28 in __interceptor_calloc (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xded28)
#1 0x7f766d8382b0 in xcalloc libtac/lib/xalloc.c:31
#2 0x7f766d82fe97 in _tac_add_attrib_pair libtac/lib/attrib.c:106
#3 0x7f766d8335d3 in tac_author_read_timeout libtac/lib/author_r.c:263
#4 0x565049269f66 in main /home/build/pam-tacplus/tacc.c:327
#5 0x7f766c72bbf6 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21bf6)
#6 0x56504926a5b9 in _start (/home/build/pam-tacplus/.libs/tacc+0x55b9)
SUMMARY: AddressSanitizer: 70 byte(s) leaked in 4 allocation(s).
Note the leaks aren't really much of an actual problem because tacc
is one-shot utility and memory is freed on exit()
. Nonetheless, I want to clean them up for the sake of making the SAST tools happy :)
Found by ASAN