Experience tracing talloc with valgrind?

Holger Kaelberer hkaelber at math.uni-bielefeld.de
Wed Apr 23 10:07:47 GMT 2008


Hi,

I am using the convenient talloc-layer in one of our applications (thanks
for that code!;-) and recently posted on valgrind-users [1] because of some
strange Error-message about "Invalid reads" from valid mem-areas, I've got
when tracing with valgrind's memcheck:

==16933== Thread 3:
==16933== Invalid read of size 8
==16933==    at 0x41177D: _talloc_free (talloc.c:388)
==16933==    by 0x4117B4: _talloc_free (talloc.c:392)
==16933==    by 0x411EA0: talloc_free (talloc.c:738)
==16933==    by 0x405138: stat_thread (radstatd.c:937)
==16933==    by 0x38D1D06136: start_thread (in 
/lib64/tls/libpthread-2.3.4.so)
==16933==    by 0x38D12C7532: clone (in /lib64/tls/libc-2.3.4.so)
==16933==  Address 0xaf00cf8 is 32 bytes inside a block of size 96 alloc'd
==16933==    at 0x4904E27: malloc (vg_replace_malloc.c:207)
==16933==    by 0x410F38: __talloc (talloc.c:197)
==16933==    by 0x410E97: _talloc_named_const (talloc.c:279)
==16933==    by 0x412610: _talloc_zero (talloc.c:1068)
==16933==    by 0x407C1E: avpair_assign_tag (funcs.c:757)
==16933==    by 0x40A769: generate26 (funcs.c:2063)
==16933==    by 0x40A127: gen_valpairs (funcs.c:1887)
==16933==    by 0x4061AB: listen_cb (radstatd.c:1425)
==16933==    by 0x4A1F587: event_base_loop (event.c:309)
==16933==    by 0x4063DA: listen_thread (radstatd.c:1480)
==16933==    by 0x38D1D06136: start_thread (in /lib64/tls/libpthread-2.3.4.so)
==16933==    by 0x38D12C7532: clone (in /lib64/tls/libc-2.3.4.so)

It has been supposed [2] that the message has been caused by interaction of
talloc with valgrind. 

Do you have any experiences/suggestions about using valgrind on talloc -- in
general, as well as regarding this particular case?

Thanks in advance,
  Holger

-- 
[1] http://article.gmane.org/gmane.comp.debugging.valgrind/8151
[2] http://article.gmane.org/gmane.comp.debugging.valgrind/8155


More information about the samba-technical mailing list