From a962d7dc18f73d075ef0bc4b6e08b05920b49353 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Thu, 9 Sep 2004 21:10:29 +0000 Subject: Update. 2004-09-09 Ulrich Drepper * malloc/hooks.c (top_check): Print top chunk corruption as normal error message. * malloc/malloc.c (malloc_printerr): Don't make informational message look like error message. --- ChangeLog | 8 ++++++++ malloc/hooks.c | 2 +- malloc/malloc.c | 21 ++++++++++++++------- 3 files changed, 23 insertions(+), 8 deletions(-) diff --git a/ChangeLog b/ChangeLog index c0868ed174..f47efd0193 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2004-09-09 Ulrich Drepper + + * malloc/hooks.c (top_check): Print top chunk corruption as normal + error message. + + * malloc/malloc.c (malloc_printerr): Don't make informational + message look like error message. + 2004-09-09 Andreas Jaeger * nscd/Makefile (CFLAGS-nscd_setup_thread.c): Set to -fpie. diff --git a/malloc/hooks.c b/malloc/hooks.c index 4de558270f..8a94fd0be8 100644 --- a/malloc/hooks.c +++ b/malloc/hooks.c @@ -216,7 +216,7 @@ top_check() if((char*)t + chunksize(t) == mp_.sbrk_base + main_arena.system_mem || t == initial_top(&main_arena)) return 0; - malloc_printerr (check_action | 4, "malloc: top chunk is corrupt", NULL); + malloc_printerr (check_action, "malloc: top chunk is corrupt", t); /* Try to set up a new top chunk. */ brk = MORECORE(0); diff --git a/malloc/malloc.c b/malloc/malloc.c index 824b6cc3f4..0d0990cc35 100644 --- a/malloc/malloc.c +++ b/malloc/malloc.c @@ -5453,13 +5453,20 @@ malloc_printerr(int action, const char *str, void *ptr) } struct iovec iov[3]; - iov[0].iov_base = (char *) "*** glibc detected *** "; - iov[0].iov_len = strlen (iov[0].iov_base); - iov[1].iov_base = (char *) str; - iov[1].iov_len = strlen (str); - iov[2].iov_base = cp; - iov[2].iov_len = &buf[sizeof (buf) - 1] - cp; - TEMP_FAILURE_RETRY (__writev (STDERR_FILENO, iov, 3)); + int n = 0; + if ((action & 4) == 0) + { + iov[0].iov_base = (char *) "*** glibc detected *** "; + iov[0].iov_len = strlen (iov[0].iov_base); + ++n; + } + iov[n].iov_base = (char *) str; + iov[n].iov_len = strlen (str); + ++n; + iov[n].iov_base = cp; + iov[n].iov_len = &buf[sizeof (buf) - 1] - cp; + ++n; + TEMP_FAILURE_RETRY (__writev (STDERR_FILENO, iov, n)); } if (action & 2) abort (); -- cgit 1.4.1