This is the mail archive of the
libc-alpha@sources.redhat.com
mailing list for the glibc project.
Re: Problems with malloc.
- From: Wolfram Gloger <Wolfram dot Gloger at dent dot med dot uni-muenchen dot de>
- To: schwidefsky at de dot ibm dot com
- Cc: libc-alpha at sources dot redhat dot com
- Date: Thu, 30 Jan 2003 13:29:50 +0100 ("MET)
- Subject: Re: Problems with malloc.
- References: <200301301108.08747.schwidefsky@de.ibm.com>
> 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);
}