Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 09 Apr 2004 03:31:00 -0500
From:      "James R. Van Artsalen" <james@jrv.org>
To:        freebsd-amd64@freebsd.org
Subject:   Re: malloc: bug or feature ?
Message-ID:  <40765F44.9070705@jrv.org>
In-Reply-To: <407539A6.4090701@jrv.org>
References:  <4073F699.6010402@cri.ensmp.fr> <20040407125532.GA75228@stack.nl> <200404070837.43253.peter@wemm.org> <407539A6.4090701@jrv.org>

index | next in thread | previous in thread | raw e-mail

[-- Attachment #1 --]
Peter Wemm wrote:

> The SEGV looks suspicious though.  I wonder if malloc is trying to put 
> the junk in without checking if malloc failed.


Attached is a proposed patch for this bug.  It fixes the test program 
(which now fails the ASSERT in main() as it ought to).  I have not 
tested it in any other way.

Without this change I expect every brk(2) call that fails to crash.

I haven't checked for equivalent bugs in other functions.

[-- Attachment #2 --]
--- lib/libc/amd64/sys/brk.S.~1~	Sat May 24 12:35:23 2003
+++ lib/libc/amd64/sys/brk.S	Fri Apr  9 02:02:22 2004
@@ -78,6 +78,7 @@
 	popq	%rdi
 	ret
 err:
+	popq	%rdi
 #ifdef PIC
 	movq	PIC_GOT(HIDENAME(cerror)),%rdx
 	jmp	*%rdx
home | help

Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?40765F44.9070705>