This is the mail archive of the
glibc-cvs@sourceware.org
mailing list for the glibc project.
GNU C Library master sources branch dj/malloc updated. glibc-2.23-558-gf57aaed
- From: dj at sourceware dot org
- To: glibc-cvs at sourceware dot org
- Date: 20 Jul 2016 02:23:34 -0000
- Subject: GNU C Library master sources branch dj/malloc updated. glibc-2.23-558-gf57aaed
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".
The branch, dj/malloc has been updated
via f57aaed3b2fb73aa3ecc40e5afa1030681c93bf4 (commit)
from 2c5e3bf401fa46ca2545820a68b4c2b5c1ee1bce (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=f57aaed3b2fb73aa3ecc40e5afa1030681c93bf4
commit f57aaed3b2fb73aa3ecc40e5afa1030681c93bf4
Author: DJ Delorie <dj@delorie.com>
Date: Tue Jul 19 22:22:46 2016 -0400
Minor tweaks to trace_run and trace2wl
trace_run - fix realloc returning NULL behavior
trace2wl - hard stop on multi-level inversion, print number
of fixed inversions.
diff --git a/malloc/trace2wl.cc b/malloc/trace2wl.cc
index 5cab475..e1e8bb6 100644
--- a/malloc/trace2wl.cc
+++ b/malloc/trace2wl.cc
@@ -182,6 +182,7 @@ PerThread *master_thread = NULL;
int last_tid = -1;
PerThread *thread = NULL;
int pending_inversions = 0;
+int fixed_inversions = 0;
static void
process_one_trace_record (__malloc_trace_buffer_s *r)
@@ -231,8 +232,14 @@ process_one_trace_record (__malloc_trace_buffer_s *r)
if (pa2 && pa2->valid)
{
if (pa2->inverted)
- printf ("%d: pointer %p alloc'd again? %d:%s\n", i, pa2->ptr, pa2->reason_idx, pa2->reason);
+ {
+ printf ("%d: pointer %p alloc'd again? (possible multi-level inversion) size %d %d:%s\n",
+ i, pa2->ptr, (int)r->size, pa2->reason_idx, pa2->reason);
+ exit (1);
+ }
+ printf("inversion for type %d\n", r->type);
pa2->inverted = r;
+ fixed_inversions ++;
pending_inversions ++;
return;
}
@@ -468,6 +475,8 @@ main(int argc, char **argv)
if (pending_inversions)
printf("%d pending inversions remain\n", pending_inversions);
+ if (fixed_inversions)
+ printf("%d inversions fixed\n", fixed_inversions);
return 0;
}
diff --git a/malloc/trace_run.c b/malloc/trace_run.c
index 3b74ce3..91331e4 100644
--- a/malloc/trace_run.c
+++ b/malloc/trace_run.c
@@ -413,19 +413,13 @@ thread_common (void *my_data_v)
myabort();
if (p2 > n_ptrs)
myabort();
+ /* we can't force realloc to return NULL (fail), so just skip it. */
+ if (p2 == 0)
+ break;
+
if (ptrs[p1])
atomic_rss (-sizes[p1]);
free_wipe(p1);
- /* we can't force realloc to return NULL (fail), so just skip it. */
- if (p2 == 0)
- {
- if (p1)
- {
- free ((void *)ptrs[p1]);
- ptrs[p1] = 0;
- }
- break;
- }
stime = rdtsc_s();
Q1;
#ifdef MDEBUG
-----------------------------------------------------------------------
Summary of changes:
malloc/trace2wl.cc | 11 ++++++++++-
malloc/trace_run.c | 14 ++++----------
2 files changed, 14 insertions(+), 11 deletions(-)
hooks/post-receive
--
GNU C Library master sources