To: | bind9-public@isc.org |
Subject: | ATF based tests leaks memory |
From: | ondrej@isc.org |
Date: | Fri, 01 Dec 2017 15:53:29 +0000 |
This is just a tracking bug to investigate whether we can prevent ATF based tests to leak memory:
=================================================================
==4092==ERROR: LeakSanitizer: detected memory leaks
Direct leak of 16 byte(s) in 1 object(s) allocated from:
#0 0x4bb7d8 in __interceptor_malloc (/home/ondrej/Projects/bind9/lib/dns/tests/.libs/acl_test+0x4bb7d8)
#1 0x4f82f6 in atf_tp_get_tcs /home/ondrej/Projects/bind9/unit/atf-src/atf-c/tp.c:153:13
Indirect leak of 49 byte(s) in 2 object(s) allocated from:
#0 0x4bb7d8 in __interceptor_malloc (/home/ondrej/Projects/bind9/lib/dns/tests/.libs/acl_test+0x4bb7d8)
#1 0x7f75285c4389 in __strdup (/lib/x86_64-linux-gnu/libc.so.6+0x80389)
Indirect leak of 32 byte(s) in 1 object(s) allocated from:
#0 0x4bb7d8 in __interceptor_malloc (/home/ondrej/Projects/bind9/lib/dns/tests/.libs/acl_test+0x4bb7d8)
#1 0x4fd9b4 in new_entry /home/ondrej/Projects/bind9/unit/atf-src/atf-c/detail/list.c:76:31
#2 0x4fd9b4 in atf_list_init /home/ondrej/Projects/bind9/unit/atf-src/atf-c/detail/list.c:203
#3 0x4ec80a in atfu_tp_add_tcs /home/ondrej/Projects/bind9/lib/dns/tests/acl_test.c:331:2
#4 0x7f75285642b0 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x202b0)
Indirect leak of 32 byte(s) in 1 object(s) allocated from:
#0 0x4bb7d8 in __interceptor_malloc (/home/ondrej/Projects/bind9/lib/dns/tests/.libs/acl_test+0x4bb7d8)
#1 0x4fd9d9 in new_entry /home/ondrej/Projects/bind9/unit/atf-src/atf-c/detail/list.c:76:31
#2 0x4fd9d9 in atf_list_init /home/ondrej/Projects/bind9/unit/atf-src/atf-c/detail/list.c:208
#3 0x4ec80a in atfu_tp_add_tcs /home/ondrej/Projects/bind9/lib/dns/tests/acl_test.c:331:2
#4 0x7f75285642b0 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x202b0)
Indirect leak of 32 byte(s) in 1 object(s) allocated from:
#0 0x4bb7d8 in __interceptor_malloc (/home/ondrej/Projects/bind9/lib/dns/tests/.libs/acl_test+0x4bb7d8)
#1 0x4fe02f in new_entry /home/ondrej/Projects/bind9/unit/atf-src/atf-c/detail/list.c:76:31
#2 0x4fe02f in new_entry_and_link /home/ondrej/Projects/bind9/unit/atf-src/atf-c/detail/list.c:104
#3 0x4fe02f in atf_list_append /home/ondrej/Projects/bind9/unit/atf-src/atf-c/detail/list.c:362
Indirect leak of 24 byte(s) in 1 object(s) allocated from:
#0 0x4bb7d8 in __interceptor_malloc (/home/ondrej/Projects/bind9/lib/dns/tests/.libs/acl_test+0x4bb7d8)
#1 0x4fe9f7 in new_entry /home/ondrej/Projects/bind9/unit/atf-src/atf-c/detail/map.c:56:30
#2 0x4fe9f7 in atf_map_insert /home/ondrej/Projects/bind9/unit/atf-src/atf-c/detail/map.c:359
#3 0x4fe857 in atf_map_init_charpp /home/ondrej/Projects/bind9/unit/atf-src/atf-c/detail/map.c:195:19
#4 0x4ec80a in atfu_tp_add_tcs /home/ondrej/Projects/bind9/lib/dns/tests/acl_test.c:331:2
#5 0x7f75285642b0 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x202b0)
SUMMARY: AddressSanitizer: 185 byte(s) leaked in 7 allocation(s).
And this goes on and on for all ATF based tests. This prevents detecting real leaks in the unit tests.