vppinfra: dlmalloc records wrong offset for tracing 87/20187/5
authorWei CHEN <weichen@astri.org>
Tue, 9 Apr 2019 04:38:40 +0000 (12:38 +0800)
committerDave Wallace <dwallacelf@gmail.com>
Tue, 18 Jun 2019 13:49:31 +0000 (13:49 +0000)
Fix a bug that mheap_get_trace is called with the wrong pointer when
mspace_get_aligned allocates a chunk with alignment greater than 16
but less than 4k.

Type: fix

Change-Id: Ic3b91fc9532248482662f019bbfa073da18645ed
Signed-off-by: Wei CHEN <weichen@astri.org>
(cherry picked from commit 5e282e93ad9f961d332cac9a033be33542979848)

src/vppinfra/dlmalloc.c

index 37721bb..2a40eeb 100644 (file)
@@ -4259,7 +4259,7 @@ void* mspace_get_aligned (mspace msp,
   if (use_trace(ms)) {
     mchunkptr p  = mem2chunk(rv);
     size_t psize = chunksize(p);
-    mheap_get_trace ((unsigned long)rv, psize);
+    mheap_get_trace (searchp, psize);
   }
   return (void *) searchp;
 }