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-567-gae99936
- From: dj at sourceware dot org
- To: glibc-cvs at sourceware dot org
- Date: 10 Aug 2016 17:03:18 -0000
- Subject: GNU C Library master sources branch dj/malloc updated. glibc-2.23-567-gae99936
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 ae99936eeab266a12999bbacd7a5f75d4d54652f (commit)
from 56414a409a70ac91719dbb1ae88f3fe1107f69c3 (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=ae99936eeab266a12999bbacd7a5f75d4d54652f
commit ae99936eeab266a12999bbacd7a5f75d4d54652f
Author: DJ Delorie <dj@delorie.com>
Date: Wed Aug 10 13:02:27 2016 -0400
Remove debugging; fix trace error handling
Comment out _m_printf until it's needed again.
Properly unlock the trace mutex when we error out because
of file errors; also disable tracing when that happens.
diff --git a/malloc/malloc.c b/malloc/malloc.c
index 8008e86..51f8818 100644
--- a/malloc/malloc.c
+++ b/malloc/malloc.c
@@ -320,6 +320,7 @@ __malloc_assert (const char *assertion, const char *file, unsigned int line,
}
#endif
+#if 0
static void
_m_printf(const char *fmt, ...)
{
@@ -336,6 +337,7 @@ _m_printf(const char *fmt, ...)
strcat(buf+strlen(buf), "\033[0m");
write(2, buf, strlen(buf));
}
+#endif
/*
INTERNAL_SIZE_T is the word-size used for internal bookkeeping
@@ -1275,8 +1277,9 @@ __mtb_trace_record (void)
if (trace_fd < 0)
{
/* FIXME: Better handling of errors? */
- _m_printf("Can't open trace_buffer file %s\n", __malloc_trace_filename);
+ __libc_message (0, "Can't open trace buffer file %s\n", __malloc_trace_filename);
atomic_store_release (&__malloc_trace_enabled, 0);
+ (void) mutex_unlock (&__malloc_trace_mutex);
return;
}
@@ -1292,8 +1295,9 @@ __mtb_trace_record (void)
if (ptr == NULL)
{
/* FIXME: Better handling of errors? */
- _m_printf("Can't map trace_buffer file %s\n", __malloc_trace_filename);
+ __libc_message (0, "Can't map trace_buffer file %s\n", __malloc_trace_filename);
atomic_store_release (&__malloc_trace_enabled, 0);
+ (void) mutex_unlock (&__malloc_trace_mutex);
return;
}
@@ -1365,9 +1369,9 @@ __malloc_trace_init (char *filename)
__malloc_trace_count = 0;
__mtb_trace_entry (__MTB_TYPE_MAGIC, sizeof(void *), (void *)0x1234);
- __mtb_trace_record ();
-
atomic_store_release (&__malloc_trace_enabled, 1);
+ /* This will reset __malloc_trace_enabled if it fails. */
+ __mtb_trace_record ();
}
/* All remaining functions return current count of trace records. */
@@ -1821,10 +1825,7 @@ typedef struct malloc_chunk *mbinptr;
FD = P->fd; \
BK = P->bk; \
if (__builtin_expect (FD->bk != P || BK->fd != P, 0)) \
- {\
- _m_printf("%p->%p %p %p->%p\n", FD, FD->bk, P, BK, BK->fd); \
malloc_printerr (check_action, "corrupted double-linked list", P, AV); \
- } \
else { \
FD->bk = BK; \
BK->fd = FD; \
@@ -4956,8 +4957,6 @@ _int_free (mstate av, mchunkptr p, int have_lock)
|| chunksize (chunk_at_offset (p, size)) >= av->system_mem;
}))
{
- _m_printf("%p %p %lx vs %lx %lx\n", p, chunk_at_offset (p, size), chunk_at_offset (p, size)->size,
- 2 * SIZE_SZ, av->system_mem);
errstr = "free(): invalid next size (fast)";
goto errout;
}
-----------------------------------------------------------------------
Summary of changes:
malloc/malloc.c | 17 ++++++++---------
1 files changed, 8 insertions(+), 9 deletions(-)
hooks/post-receive
--
GNU C Library master sources