Avoid assertion in processes with VM in bad shape
authorUlrich Drepper <drepper@gmail.com>
Sat, 29 Oct 2011 20:39:03 +0000 (16:39 -0400)
committerUlrich Drepper <drepper@gmail.com>
Sat, 29 Oct 2011 20:39:03 +0000 (16:39 -0400)
ChangeLog
malloc/malloc.c

index 21aa451..4fccd94 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 2011-10-29  Ulrich Drepper  <drepper@gmail.com>
 
+       [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.
index 864c7d9..8608083 100644 (file)
@@ -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