[ccan] ccanlint valgrind checks - what am I missing here?

Peter Barker pbarker at barker.dropbear.id.au
Tue Aug 19 16:25:56 EST 2014


After Rusty mentioned the whole "you get dropped into a debugger" thing, I 
set about working out why that didn't happen for me.  So I installed 
Valgrind, instantly pointing out a stupidity in my code.

However, I *did* notice this weirdism (the following leak introduced on 
purpose):

base64: Module's run and api tests pass (tests_pass): PASS
base64: Module's run and api tests succeed under valgrind 
(tests_pass_valgrind): PASS
base64: Module's run and api tests have no memory leaks 
(tests_pass_valgrind_noleaks): PASS
/home/pbarker/ccan2/ccan/ccan/base64/test/api.c:==11017== 50 bytes in 1 
blocks are definitely lost in loss record 2 of 69
==11017==    at 0x4C2AB80: malloc (in 
/usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==11017==    by 0x401EFA: map_to_b64 (base64.c:15)
==11017==    by 0x40227F: base64_encode (base64.c:98)
==11017==    by 0x400F70: main (api.c:50)
==11017== 50 bytes in 1 blocks are definitely lost in loss record 3 of 69
==11017==    at 0x4C2AB80: malloc (in 
/usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==11017==    by 0x401EFA: map_to_b64 (base64.c:15)
==11017==    by 0x4022BC: base64_encode (base64.c:99)
==11017==    by 0x400F70: main (api.c:50)
==11017== 50 bytes in 1 blocks are definitely lost in loss record 4 of 69
==11017==    at 0x4C2AB80: malloc (in 
/usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)

Why does that "noleaks" test there say "PASS"?

Ta,
-- 
Peter Barker                          |   Programmer,Sysadmin,Geek.
pbarker at barker.dropbear.id.au	      |   You need a bigger hammer.
:: It's a hack! Expect underscores! - Nigel Williams


More information about the ccan mailing list