]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Fix trace window unmapping bug
authorDJ Delorie <dj@delorie.com>
Tue, 19 Jul 2016 20:53:49 +0000 (16:53 -0400)
committerDJ Delorie <dj@delorie.com>
Tue, 19 Jul 2016 20:53:49 +0000 (16:53 -0400)
We were recording window number, not trace count, resulting in
windows not getting unmapped.

malloc/malloc.c

index 82608e16c690c5d72dfbb2f9284ea8922094b159..beaff40890c46b6812a2ada9d792856470bdd2e7 100644 (file)
@@ -1206,7 +1206,7 @@ __mtb_trace_entry (uint32_t type, size_t size, void *ptr1)
         counter for the current thread window.  */
       if (__malloc_trace_last_num != -1)
        {
-         int old_window = TRACE_COUNT_TO_MAPPING_NUM (__malloc_trace_last_num);
+         int old_window = __malloc_trace_last_num;
          int old_ref_count = catomic_exchange_and_add (&__malloc_trace_buffer[old_window].ref_count, -1);
          /* W3. If that reference counter reached 0, unmap the window. */
          if (old_ref_count == 1)