* ================== PLATFORM CHANGES =================
-* Support for amd64 AES instructions (AESKEYGENASSIST, AESENC, AESENCLAST,
- AESDEC, AESDECLAST, AESIMC).
+* Support for intel AES instructions (AESKEYGENASSIST, AESENC, AESENCLAST,
+ AESDEC, AESDECLAST, AESIMC). Only supported for 64 bit architecture.
* ==================== TOOL CHANGES ====================
+* Massif
+ - Using the new option --soname-synonyms, Massif can now understand
+ a program using statically linked malloc or using alternative
+ malloc libraries (such as tcmalloc).
+
* Memcheck:
- The leak_check GDB server monitor command now can
control the maximum nr of loss records to output.
- - reduction of memory use for applications allocating
+ - Reduction of memory use for applications allocating
many blocks and/or having many partially defined bytes.
- Addition of GDB server monitor command 'block_list' that lists
- Addition of GDB server monitor command 'who_points_at' that lists
the locations pointing at a block.
- - if a redzone size > 0 is given, VALGRIND_MALLOCLIKE_BLOCK now
+ - If a redzone size > 0 is given, VALGRIND_MALLOCLIKE_BLOCK now
will detect an invalid access of these redzones, by marking them
noaccess.
+ - Using the new option --soname-synonyms, Memcheck can now understand
+ a program using statically linked malloc or using alternative
+ malloc libraries (such as tcmalloc).
+
* ==================== OTHER CHANGES ====================
* The C++ demangler has been updated so as to work well with C++
compiled by up to at least g++ 4.6.
+* Replacement/wrapping can be made more flexible thanks to the new option
+ --soname-synonyms.
+
* The new option --fair-sched allows to control the locking mechanism
used by Valgrind. The locking mechanism influences the performance
and scheduling of multithreaded applications (in particular
where XXXXXX is the bug number as listed below.
197914 Building valgrind from svn now requires automake-1.10
+219156 Valgrind does not handle statically linked malloc or other malloc lib (e.g. tcmalloc)
247386 make perf does not run all performance tests
270006 Valgrind scheduler unfair
270796 s390x: Removed broken support for the TS insn
// Each of these lines generates a replacement function:
// (from_so, from_fn, v's replacement)
+// For some lines, we will also define a replacement function
+// whose only purpose is to be a soname synonym place holder
+// that can be replaced using --soname-synonyms.
+#define SO_SYN_MALLOC VG_SO_SYN(somalloc)
// malloc
#if defined(VGO_linux)
ALLOC_or_NULL(VG_Z_LIBSTDCXX_SONAME, malloc, malloc);
ALLOC_or_NULL(VG_Z_LIBC_SONAME, malloc, malloc);
+ ALLOC_or_NULL(SO_SYN_MALLOC, malloc, malloc);
#elif defined(VGO_darwin)
ALLOC_or_NULL(VG_Z_LIBC_SONAME, malloc, malloc);
- ZONEALLOC_or_NULL(VG_Z_LIBC_SONAME, malloc_zone_malloc, malloc);
+ ALLOC_or_NULL(SO_SYN_MALLOC, malloc, malloc);
+ ZONEALLOC_or_NULL(VG_Z_LIBC_SONAME, malloc_zone_malloc, malloc);
+ ZONEALLOC_or_NULL(SO_SYN_MALLOC, malloc_zone_malloc, malloc);
#endif
#if VG_WORDSIZE == 4
ALLOC_or_BOMB(VG_Z_LIBSTDCXX_SONAME, _Znwj, __builtin_new);
ALLOC_or_BOMB(VG_Z_LIBC_SONAME, _Znwj, __builtin_new);
+ ALLOC_or_BOMB(SO_SYN_MALLOC, _Znwj, __builtin_new);
#endif
// operator new(unsigned long), GNU mangling
#if VG_WORDSIZE == 8
ALLOC_or_BOMB(VG_Z_LIBSTDCXX_SONAME, _Znwm, __builtin_new);
ALLOC_or_BOMB(VG_Z_LIBC_SONAME, _Znwm, __builtin_new);
+ ALLOC_or_BOMB(SO_SYN_MALLOC, _Znwm, __builtin_new);
#endif
#elif defined(VGO_darwin)
#if VG_WORDSIZE == 4
ALLOC_or_NULL(VG_Z_LIBSTDCXX_SONAME, _ZnwjRKSt9nothrow_t, __builtin_new);
ALLOC_or_NULL(VG_Z_LIBC_SONAME, _ZnwjRKSt9nothrow_t, __builtin_new);
+ ALLOC_or_NULL(SO_SYN_MALLOC, _ZnwjRKSt9nothrow_t, __builtin_new);
#endif
// operator new(unsigned long, std::nothrow_t const&), GNU mangling
#if VG_WORDSIZE == 8
ALLOC_or_NULL(VG_Z_LIBSTDCXX_SONAME, _ZnwmRKSt9nothrow_t, __builtin_new);
ALLOC_or_NULL(VG_Z_LIBC_SONAME, _ZnwmRKSt9nothrow_t, __builtin_new);
+ ALLOC_or_NULL(SO_SYN_MALLOC, _ZnwmRKSt9nothrow_t, __builtin_new);
#endif
#elif defined(VGO_darwin)
#if VG_WORDSIZE == 4
ALLOC_or_BOMB(VG_Z_LIBSTDCXX_SONAME, _Znaj, __builtin_vec_new );
ALLOC_or_BOMB(VG_Z_LIBC_SONAME, _Znaj, __builtin_vec_new );
+ ALLOC_or_BOMB(SO_SYN_MALLOC, _Znaj, __builtin_vec_new );
#endif
// operator new[](unsigned long), GNU mangling
#if VG_WORDSIZE == 8
ALLOC_or_BOMB(VG_Z_LIBSTDCXX_SONAME, _Znam, __builtin_vec_new );
ALLOC_or_BOMB(VG_Z_LIBC_SONAME, _Znam, __builtin_vec_new );
+ ALLOC_or_BOMB(SO_SYN_MALLOC, _Znam, __builtin_vec_new );
#endif
#elif defined(VGO_darwin)
#if VG_WORDSIZE == 4
ALLOC_or_NULL(VG_Z_LIBSTDCXX_SONAME, _ZnajRKSt9nothrow_t, __builtin_vec_new );
ALLOC_or_NULL(VG_Z_LIBC_SONAME, _ZnajRKSt9nothrow_t, __builtin_vec_new );
+ ALLOC_or_NULL(SO_SYN_MALLOC, _ZnajRKSt9nothrow_t, __builtin_vec_new );
#endif
// operator new[](unsigned long, std::nothrow_t const&), GNU mangling
#if VG_WORDSIZE == 8
ALLOC_or_NULL(VG_Z_LIBSTDCXX_SONAME, _ZnamRKSt9nothrow_t, __builtin_vec_new );
ALLOC_or_NULL(VG_Z_LIBC_SONAME, _ZnamRKSt9nothrow_t, __builtin_vec_new );
+ ALLOC_or_NULL(SO_SYN_MALLOC, _ZnamRKSt9nothrow_t, __builtin_vec_new );
#endif
#elif defined(VGO_darwin)
(void)VALGRIND_NON_SIMD_CALL1( info.tl_##vg_replacement, p ); \
}
+
#if defined(VGO_linux)
FREE(VG_Z_LIBSTDCXX_SONAME, free, free );
FREE(VG_Z_LIBC_SONAME, free, free );
+ FREE(SO_SYN_MALLOC, free, free );
#elif defined(VGO_darwin)
FREE(VG_Z_LIBC_SONAME, free, free );
+ FREE(SO_SYN_MALLOC, free, free );
ZONEFREE(VG_Z_LIBC_SONAME, malloc_zone_free, free );
+ ZONEFREE(SO_SYN_MALLOC, malloc_zone_free, free );
#endif
#if defined(VGO_linux)
FREE(VG_Z_LIBSTDCXX_SONAME, cfree, free );
FREE(VG_Z_LIBC_SONAME, cfree, free );
+ FREE(SO_SYN_MALLOC, cfree, free );
#elif defined(VGO_darwin)
//FREE(VG_Z_LIBSTDCXX_SONAME, cfree, free );
// operator delete(void*), GNU mangling
FREE(VG_Z_LIBSTDCXX_SONAME, _ZdlPv, __builtin_delete );
FREE(VG_Z_LIBC_SONAME, _ZdlPv, __builtin_delete );
+ FREE(SO_SYN_MALLOC, _ZdlPv, __builtin_delete );
#elif defined(VGO_darwin)
// operator delete(void*), GNU mangling
// operator delete(void*, std::nothrow_t const&), GNU mangling
FREE(VG_Z_LIBSTDCXX_SONAME, _ZdlPvRKSt9nothrow_t, __builtin_delete );
FREE(VG_Z_LIBC_SONAME, _ZdlPvRKSt9nothrow_t, __builtin_delete );
+ FREE(SO_SYN_MALLOC, _ZdlPvRKSt9nothrow_t, __builtin_delete );
#elif defined(VGO_darwin)
// operator delete(void*, std::nothrow_t const&), GNU mangling
// operator delete[](void*), GNU mangling
FREE(VG_Z_LIBSTDCXX_SONAME, _ZdaPv, __builtin_vec_delete );
FREE(VG_Z_LIBC_SONAME, _ZdaPv, __builtin_vec_delete );
+ FREE(SO_SYN_MALLOC, _ZdaPv, __builtin_vec_delete );
#elif defined(VGO_darwin)
// operator delete[](void*), not mangled (for gcc 2.96)
// operator delete[](void*, std::nothrow_t const&), GNU mangling
FREE(VG_Z_LIBSTDCXX_SONAME, _ZdaPvRKSt9nothrow_t, __builtin_vec_delete );
FREE(VG_Z_LIBC_SONAME, _ZdaPvRKSt9nothrow_t, __builtin_vec_delete );
+ FREE(SO_SYN_MALLOC, _ZdaPvRKSt9nothrow_t, __builtin_vec_delete );
#elif defined(VGO_darwin)
// operator delete[](void*, std::nothrow_t const&), GNU mangling
#if defined(VGO_linux)
CALLOC(VG_Z_LIBC_SONAME, calloc);
+ CALLOC(SO_SYN_MALLOC, calloc);
#elif defined(VGO_darwin)
CALLOC(VG_Z_LIBC_SONAME, calloc);
+ CALLOC(SO_SYN_MALLOC, calloc);
ZONECALLOC(VG_Z_LIBC_SONAME, malloc_zone_calloc);
+ ZONECALLOC(SO_SYN_MALLOC, malloc_zone_calloc);
#endif
#if defined(VGO_linux)
REALLOC(VG_Z_LIBC_SONAME, realloc);
+ REALLOC(SO_SYN_MALLOC, realloc);
#elif defined(VGO_darwin)
REALLOC(VG_Z_LIBC_SONAME, realloc);
+ REALLOC(SO_SYN_MALLOC, realloc);
ZONEREALLOC(VG_Z_LIBC_SONAME, malloc_zone_realloc);
+ ZONEREALLOC(SO_SYN_MALLOC, malloc_zone_realloc);
#endif
#if defined(VGO_linux)
MEMALIGN(VG_Z_LIBC_SONAME, memalign);
+ MEMALIGN(SO_SYN_MALLOC, memalign);
#elif defined(VGO_darwin)
MEMALIGN(VG_Z_LIBC_SONAME, memalign);
+ MEMALIGN(SO_SYN_MALLOC, memalign);
ZONEMEMALIGN(VG_Z_LIBC_SONAME, malloc_zone_memalign);
+ ZONEMEMALIGN(SO_SYN_MALLOC, malloc_zone_memalign);
#endif
#if defined(VGO_linux)
VALLOC(VG_Z_LIBC_SONAME, valloc);
+ VALLOC(SO_SYN_MALLOC, valloc);
#elif defined(VGO_darwin)
VALLOC(VG_Z_LIBC_SONAME, valloc);
+ VALLOC(SO_SYN_MALLOC, valloc);
ZONEVALLOC(VG_Z_LIBC_SONAME, malloc_zone_valloc);
+ ZONEVALLOC(SO_SYN_MALLOC, malloc_zone_valloc);
#endif
#if defined(VGO_linux)
MALLOPT(VG_Z_LIBC_SONAME, mallopt);
+ MALLOPT(SO_SYN_MALLOC, mallopt);
#elif defined(VGO_darwin)
//MALLOPT(VG_Z_LIBC_SONAME, mallopt);
#if defined(VGO_linux)
MALLOC_TRIM(VG_Z_LIBC_SONAME, malloc_trim);
+ MALLOC_TRIM(SO_SYN_MALLOC, malloc_trim);
#elif defined(VGO_darwin)
//MALLOC_TRIM(VG_Z_LIBC_SONAME, malloc_trim);
#if defined(VGO_linux)
POSIX_MEMALIGN(VG_Z_LIBC_SONAME, posix_memalign);
+ POSIX_MEMALIGN(SO_SYN_MALLOC, posix_memalign);
#elif defined(VGO_darwin)
//POSIX_MEMALIGN(VG_Z_LIBC_SONAME, posix_memalign);
#if defined(VGO_linux)
MALLOC_USABLE_SIZE(VG_Z_LIBC_SONAME, malloc_usable_size);
+ MALLOC_USABLE_SIZE(SO_SYN_MALLOC, malloc_usable_size);
MALLOC_USABLE_SIZE(VG_Z_LIBC_SONAME, malloc_size);
+ MALLOC_USABLE_SIZE(SO_SYN_MALLOC, malloc_size);
# if defined(VGPV_arm_linux_android)
MALLOC_USABLE_SIZE(VG_Z_LIBC_SONAME, dlmalloc_usable_size);
+ MALLOC_USABLE_SIZE(SO_SYN_MALLOC, dlmalloc_usable_size);
# endif
#elif defined(VGO_darwin)
//MALLOC_USABLE_SIZE(VG_Z_LIBC_SONAME, malloc_usable_size);
MALLOC_USABLE_SIZE(VG_Z_LIBC_SONAME, malloc_size);
+ MALLOC_USABLE_SIZE(SO_SYN_MALLOC, malloc_size);
#endif
#if defined(VGO_linux)
MALLOC_STATS(VG_Z_LIBC_SONAME, malloc_stats);
+ MALLOC_STATS(SO_SYN_MALLOC, malloc_stats);
#elif defined(VGO_darwin)
//MALLOC_STATS(VG_Z_LIBC_SONAME, malloc_stats);
#if defined(VGO_linux)
MALLINFO(VG_Z_LIBC_SONAME, mallinfo);
+ MALLINFO(SO_SYN_MALLOC, mallinfo);
#elif defined(VGO_darwin)
//MALLINFO(VG_Z_LIBC_SONAME, mallinfo);
}
DEFAULT_ZONE(VG_Z_LIBC_SONAME, malloc_default_zone);
+DEFAULT_ZONE(SO_SYN_MALLOC, malloc_default_zone);
#define ZONE_FROM_PTR(soname, fnname) \
}
ZONE_FROM_PTR(VG_Z_LIBC_SONAME, malloc_zone_from_ptr);
+ZONE_FROM_PTR(SO_SYN_MALLOC, malloc_zone_from_ptr);
// GrP fixme bypass libc's use of zone->introspect->check
</listitem>
</varlistentry>
+ <varlistentry id="opt.soname-synonyms"
+ xreflabel="--soname-synonyms">
+ <term>
+ <option><![CDATA[--soname-synonyms=syn1=pattern1,syn2=pattern2,...]]></option>
+ </term>
+ <listitem>
+ <para>When a shared library is loaded, Valgrind examines if some
+ functions of this library must be replaced or wrapped.
+ For example, memcheck is replacing the malloc related
+ functions (malloc, free, calloc, ...).
+ Such replacements are done by default only in shared libraries whose
+ soname matches a predefined soname pattern (e.g.
+ <varname>libc.so*</varname> on linux).
+ By default, no replacement is done for a statically linked
+ library or for alternative libraries such as tcmalloc.
+ In some cases, the replacements allow
+ <option>--soname-synonyms</option> to specify one additional
+ synonym pattern, giving flexibility in the replacement. </para>
+
+ <para> Currently, this flexibility is only allowed for the
+ malloc related functions, using the
+ synonym <varname>somalloc</varname>. This synonym is usable for
+ all tools doing standard replacement of malloc related functions
+ (e.g. memcheck, massif, drd, helgrind, exp-dhat, exp-sgcheck).
+ </para>
+
+ <itemizedlist>
+ <listitem>
+
+ <para>Alternate malloc library: to replace the malloc
+ related functions in an alternate library with
+ soname <varname>mymalloclib.so</varname>, give the
+ option <option>--soname-synonyms=somalloc=mymalloclib.so</option>.
+ A pattern can be used to match multiple libraries sonames.
+ For
+ example, <option>--soname-synonyms=somalloc=*tcmalloc*</option>
+ will match the soname of all variants of the tcmalloc library
+ (native, debug, profiled, ... tcmalloc variants). </para>
+ <para>Note: the soname of a elf shared library can be
+ retrieved using the readelf utility. </para>
+
+ </listitem>
+
+ <listitem>
+ <para>Replacements in a statically linked library are done by
+ using the <varname>NONE</varname> pattern. For example, if
+ you link with <varname>libtcmalloc.a</varname>, memcheck
+ will properly work when you give the
+ option <option>--soname-synonyms=somalloc=NONE</option>. Note
+ that a NONE pattern will match the main executable and any
+ shared library having no soname. </para>
+ </listitem>
+ </itemizedlist>
+ </listitem>
+ </varlistentry>
+
</variablelist>
<!-- end of xi:include in the manpage -->