This is the mail archive of the libc-alpha@sources.redhat.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Problems with malloc.


> sYSMALLOc returns NULL and the calloc fails. I wonder if the "else if"
> might be incorrect. 

Please try this patch, which I already posted for the FreeBSD port.
If it works for you too, it should be applied to glibc.

Thanks,
Wolfram.

2002-10-07  Wolfram Gloger  <wg@malloc.de>

	* malloc/malloc.c (sYSMALLOc): Only check for breakage due
	to foreign sbrk()'s if arena is contiguous.  Bug report from
	Bruno Haible <bruno@clisp.org>.

--- malloc.c	2002/06/11 09:36:14	1.10
+++ malloc.c	2002/10/07 15:33:46
@@ -2911,7 +2911,7 @@
     if (brk == old_end && snd_brk == (char*)(MORECORE_FAILURE))
       set_head(old_top, (size + old_size) | PREV_INUSE);
 
-    else if (old_size && brk < old_end) {
+    else if (contiguous(av) && old_size && brk < old_end) {
       /* Oops!  Someone else killed our space..  Can't touch anything.  */
       assert(0);
     }


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]