Bug 368861

Summary: Please make valgrind work with programs using google-perftools malloc library
Product: [Developer tools] valgrind Reporter: Yuri <yuri>
Component: generalAssignee: Julian Seward <jseward>
Status: RESOLVED DUPLICATE    
Severity: major CC: mark
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In:

Description Yuri 2016-09-15 19:05:41 UTC
Currently valgrind fails on such programs:

==26700== Invalid write of size 8
==26700==    at 0x4E45D1D: tcmalloc::Static::InitStaticVars() (in /usr/local/lib/libtcmalloc.so.4.3.0)
==26700==    by 0x4E46CA6: tcmalloc::ThreadCache::InitModule() (in /usr/local/lib/libtcmalloc.so.4.3.0)
==26700==    by 0x4E576E4: calloc (in /usr/local/lib/libtcmalloc.so.4.3.0)
==26700==    by 0x9C1E139: _thr_alloc (in /lib/libthr.so.3)
==26700==    by 0x9C1F292: _libpthread_init (in /lib/libthr.so.3)
==26700==    by 0x9C221D1: ??? (in /lib/libthr.so.3)
==26700==    by 0x9C14EA5: ??? (in /lib/libthr.so.3)
==26700==    by 0x400432D: _rtld (in /libexec/ld-elf.so.1)
==26700==    by 0x40024E8: ??? (in /libexec/ld-elf.so.1)
==26700==  Address 0x742b80 is not stack'd, malloc'd or (recently) free'd
==26700== 
==26700== 
==26700== Process terminating with default action of signal 11 (SIGSEGV): dumping core


Reproducible: Always




valgrind-3.10.1
Comment 1 Mark Wielaard 2016-09-15 19:28:16 UTC
This should already work when using --soname-synonyms=somalloc=xxx (see the manual). In valgrind 3.12 this should even work out of the box without the user having to specify the malloc library by intercepting any interposed malloc related functions. See bug #355188.

*** This bug has been marked as a duplicate of bug 355188 ***