[ltt-dev] [URCU] Invalid free() / delete / delete[] with valgrind

Vegard Nossum vegard.nossum at gmail.com
Mon Aug 1 08:44:28 EDT 2011


With userspace-rcu-0.6.4, I get the following report with valgrind:

==20479== Invalid free() / delete / delete[]
==20479==    at 0x4C21D21: free (vg_replace_malloc.c:325)
==20479==    by 0x51365AA: ??? (in /lib64/libc-2.5.so)
==20479==    by 0x51361A1: ??? (in /lib64/libc-2.5.so)
==20479==    by 0x4A1E4E8: _vgnU_freeres (vg_preloaded.c:62)
==20479==    by 0x505E4C4: exit (in /lib64/libc-2.5.so)
==20479==    by 0x504899A: (below main) (in /lib64/libc-2.5.so)
==20479==  Address 0x404f5e8 is not stack'd, malloc'd or (recently) free'd

The test-case is simply an empty main() function, no includes, nothing
else. If I compile with -lurcu, -lurcu-bp, or -lurcu-qsbr, I get the
warning; if I omit them, I don't.

I _guess_ it has something to do with __attribute__ ((deconstructor))
for rcu_exit, but I am not sure. Maybe it's a libc or valgrind bug?

Did anybody else notice the same thing?


More information about the lttng-dev mailing list