From 7ec5224de5559413830fb5e4c79c1282fcd8d506 Mon Sep 17 00:00:00 2001 From: Philippe Waroquiers Date: Thu, 1 Mar 2012 22:00:36 +0000 Subject: [PATCH] In case VALGRIND_MALLOCLIKE_BLOCK is wrongly used, output the execontext where the overlapping blocks have been reported before crashing. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12412 --- memcheck/mc_leakcheck.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/memcheck/mc_leakcheck.c b/memcheck/mc_leakcheck.c index 8d462b94c7..edd19b8fa4 100644 --- a/memcheck/mc_leakcheck.c +++ b/memcheck/mc_leakcheck.c @@ -1376,10 +1376,14 @@ void MC_(detect_memory_leaks) ( ThreadId tid, LeakCheckParams* lcp) lc_n_chunks--; } else { - VG_(umsg)("Block 0x%lx..0x%lx overlaps with block 0x%lx..0x%lx", + VG_(umsg)("Block 0x%lx..0x%lx overlaps with block 0x%lx..0x%lx\n", start1, end1, start2, end2); + VG_(umsg)("Blocks allocation contexts:\n"), + VG_(pp_ExeContext)( ch1->where); + VG_(umsg)("\n"), + VG_(pp_ExeContext)( ch2->where); VG_(umsg)("This is usually caused by using VALGRIND_MALLOCLIKE_BLOCK"); - VG_(umsg)("in an inappropriate way."); + VG_(umsg)("in an inappropriate way.\n"); tl_assert (0); } } -- 2.47.2