From 6ef76f3b515c45a83f7831f806bf97a2af9ed008 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Sat, 29 Oct 2011 16:39:03 -0400 Subject: [PATCH] Avoid assertion in processes with VM in bad shape --- ChangeLog | 4 ++++ malloc/malloc.c | 8 ++++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 21aa45134d..4fccd94ec6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2011-10-29 Ulrich Drepper + [BZ #13276] + * malloc/malloc.c (munmap_chunk): Don't use assertion to check munmap + return value. + * posix/sys/wait.h: Mark wait and wait4 with __THROWNL. * libio/stdio.h: Mark sprintf, vsprintf snprintf, vsnprintf, vasprintf, asprintf, __asprintf, obstack_printf, obstack_vprintf with __THROWNL. diff --git a/malloc/malloc.c b/malloc/malloc.c index 864c7d908b..8608083adb 100644 --- a/malloc/malloc.c +++ b/malloc/malloc.c @@ -2855,10 +2855,10 @@ munmap_chunk(mchunkptr p) mp_.n_mmaps--; mp_.mmapped_mem -= total_size; - int ret __attribute__ ((unused)) = munmap((char *)block, total_size); - - /* munmap returns non-zero on failure */ - assert(ret == 0); + /* If munmap failed the process virtual memory address space is in a + bad shape. Just leave the block hanging around, the process will + terminate shortly anyway since not much can be done. */ + munmap((char *)block, total_size); } #if HAVE_MREMAP