Bug 368861 - Please make valgrind work with programs using google-perftools malloc library
Summary: Please make valgrind work with programs using google-perftools malloc library
Status: RESOLVED DUPLICATE of bug 355188
Alias: None
Product: valgrind
Classification: Developer tools
Component: general (show other bugs)
Version: unspecified
Platform: Other Linux
: NOR major
Target Milestone: ---
Assignee: Julian Seward
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-09-15 19:05 UTC by Yuri
Modified: 2016-09-15 19:28 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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 ***