`valgrind --num-callers=1 ./hello_world`
515265 Add SSE4.1 BLENDPS and PBLENDW instruction for x86 32 bit
515612 Sanity check VG_(realpath) and VG_(readlink) return values
-
+515731 Distinguish between realloc functions in realloc size 0 error messages
To see details of a given bug, visit
https://bugs.kde.org/show_bug.cgi?id=XXXXXX
return null_ExeContext;
}
+const HChar* VG_(get_ExeContext_first_fnname)(ExeContext* ec)
+{
+ const HChar* fn_name;
+ vg_assert(ec->n_ips > 0);
+ Bool found_fn = VG_(get_fnname)(VG_(get_ExeContext_epoch)(ec), ec->ips[0], &fn_name);
+ if (found_fn) {
+ return fn_name;
+ }
+ return NULL;
+}
+
/*--------------------------------------------------------------------*/
/*--- end m_execontext.c ---*/
/*--------------------------------------------------------------------*/
// Make an ExeContext containing exactly the specified stack frames.
ExeContext* VG_(make_ExeContext_from_StackTrace)( const Addr* ips, UInt n_ips );
+// Get the name of the topmost function from an ExeContext
+const HChar* VG_(get_ExeContext_first_fnname)(ExeContext* ec);
+
+
// Returns the "null" exe context. The null execontext is an artificial
// exe context, with a stack trace made of one Addr (the NULL address).
extern
}
break;
- case Err_ReallocSizeZero:
+ case Err_ReallocSizeZero: {
+ const HChar* fn_name = VG_(get_ExeContext_first_fnname)(VG_(get_error_where)(err));
+ if (fn_name == NULL)
+ fn_name = "realloc"; // just in case
if (xml) {
emit( " <kind>ReallocSizeZero</kind>\n" );
- emit( " <what>realloc() with size 0</what>\n" );
+ emit( " <what>%s() with size 0</what>\n", fn_name );
VG_(pp_ExeContext)( VG_(get_error_where)(err) );
VG_(pp_addrinfo_mc)(VG_(get_error_address)(err),
&extra->Err.ReallocSizeZero.ai, False);
} else {
- emit( "realloc() with size 0\n" );
+ emit( "%s() with size 0\n", fn_name );
VG_(pp_ExeContext)( VG_(get_error_where)(err) );
VG_(pp_addrinfo_mc)(VG_(get_error_address)(err),
&extra->Err.ReallocSizeZero.ai, False);
}
break;
+ }
case Err_BadAlign:
if (extra->Err.BadAlign.size) {
Reachable blocks (those to which a pointer was found) are not shown.
To see them, rerun with: --leak-check=full --show-leak-kinds=all
-realloc() with size 0
+reallocarray() with size 0
at 0x........: reallocarray (vg_replace_malloc.c:...)
by 0x........: main (reallocarray.c:19)
Address 0x........ is 0 bytes inside a block of size 40 alloc'd
Reachable blocks (those to which a pointer was found) are not shown.
To see them, rerun with: --leak-check=full --show-leak-kinds=all
-realloc() with size 0
+reallocarray() with size 0
at 0x........: reallocarray (vg_replace_malloc.c:...)
by 0x........: main (reallocarray.c:23)
Address 0x........ is 0 bytes inside a block of size 1 alloc'd
Reachable blocks (those to which a pointer was found) are not shown.
To see them, rerun with: --leak-check=full --show-leak-kinds=all
-realloc() with size 0
+reallocf() with size 0
at 0x........: reallocf (vg_replace_malloc.c:...)
by 0x........: main (reallocf.c:12)
Address 0x........ is 0 bytes inside a block of size 40 alloc'd
Reachable blocks (those to which a pointer was found) are not shown.
To see them, rerun with: --leak-check=full --show-leak-kinds=all
-realloc() with size 0
+reallocarray() with size 0
at 0x........: reallocarray (vg_replace_malloc.c:...)
by 0x........: main (reallocarray.c:19)
Address 0x........ is 0 bytes inside a block of size 40 alloc'd
Added leak check, expect all blocks freed
All heap blocks were freed -- no leaks are possible
-realloc() with size 0
+reallocarray() with size 0
at 0x........: reallocarray (vg_replace_malloc.c:...)
by 0x........: main (reallocarray.c:25)
Address 0x........ is 0 bytes inside a block of size 10 alloc'd
-realloc() with size 0
+reallocf() with size 0
at 0x........: reallocf (vg_replace_malloc.c:...)
by 0x........: main (static_allocs.c:36)
Address 0x........ is 0 bytes inside a block of size 160 alloc'd
Reachable blocks (those to which a pointer was found) are not shown.
To see them, rerun with: --leak-check=full --show-leak-kinds=all
-realloc() with size 0
+reallocarray() with size 0
at 0x........: reallocarray (vg_replace_malloc.c:...)
by 0x........: main (reallocarray.c:13)
Address 0x........ is 0 bytes inside a block of size 40 alloc'd
Reachable blocks (those to which a pointer was found) are not shown.
To see them, rerun with: --leak-check=full --show-leak-kinds=all
-realloc() with size 0
+reallocarray() with size 0
at 0x........: reallocarray (vg_replace_malloc.c:...)
by 0x........: main (reallocarray.c:15)
Address 0x........ is 0 bytes inside a block of size 1 alloc'd