From owner-freebsd-amd64@FreeBSD.ORG Wed Oct 27 17:13:07 2004 Return-Path: Delivered-To: freebsd-amd64@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 92AFE16A4CE; Wed, 27 Oct 2004 17:13:07 +0000 (GMT) Received: from dragon.nuxi.com (trang.nuxi.com [66.93.134.19]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6273743D41; Wed, 27 Oct 2004 17:13:07 +0000 (GMT) (envelope-from obrien@NUXI.com) Received: from dragon.nuxi.com (obrien@localhost [127.0.0.1]) by dragon.nuxi.com (8.13.1/8.13.1) with ESMTP id i9RHD62A073951; Wed, 27 Oct 2004 10:13:06 -0700 (PDT) (envelope-from obrien@dragon.nuxi.com) Received: (from obrien@localhost) by dragon.nuxi.com (8.13.1/8.13.1/Submit) id i9RHD4Ju073950; Wed, 27 Oct 2004 10:13:04 -0700 (PDT) (envelope-from obrien) Date: Wed, 27 Oct 2004 10:13:04 -0700 From: "David O'Brien" To: "James R. Van Artsalen" Message-ID: <20041027171304.GA73746@dragon.nuxi.com> References: <20041026115041.GE2841@sivokote.iziade.m$> <20041026173005.GA2984@dragon.nuxi.com> <417E8F7A.70009@jrv.org> <20041026213227.GA95016@dragon.nuxi.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20041026213227.GA95016@dragon.nuxi.com> User-Agent: Mutt/1.4.1i X-Operating-System: FreeBSD 6.0-CURRENT Organization: The NUXI BSD Group X-Pgp-Rsa-Fingerprint: B7 4D 3E E9 11 39 5F A3 90 76 5D 69 58 D9 98 7A X-Pgp-Rsa-Keyid: 1024/34F9F9D5 cc: Georgi Guninski cc: roam@freebsd.org cc: freebsd-amd64@freebsd.org Subject: Re: two 4GB mallocs => SEGV X-BeenThere: freebsd-amd64@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: obrien@NUXI.com List-Id: Porting FreeBSD to the AMD64 platform List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Oct 2004 17:13:07 -0000 On Tue, Oct 26, 2004 at 02:32:27PM -0700, David O'Brien wrote: > On Tue, Oct 26, 2004 at 12:55:06PM -0500, James R. Van Artsalen wrote: > > A few months ago I posted this bug in the libc brk(2) code - the stack > > is not balanced if the kernel returns an error. I'm not running current > > code at the moment but see if you brk.S has a stack issue at the err: > > label. Stick in this pop if so and report if malloc(3c) then returns > > NULL instead of crashing, then up your ulimit and try again and see if > > all works without error. > > > > --- 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 VERY sorry. I looked at sbrk.S not brk.S. Your fix is correct. ^^^ Starting program: /var/tmp/a.out 3221225472 5255168 3226480640 -- -- David (obrien@NUXI.com)