From owner-freebsd-amd64@FreeBSD.ORG Tue Oct 26 17:55: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 E362616A4CE; Tue, 26 Oct 2004 17:55:07 +0000 (GMT) Received: from mail.jrv.org (rrcs-24-73-246-106.sw.biz.rr.com [24.73.246.106]) by mx1.FreeBSD.org (Postfix) with ESMTP id 64FFA43D53; Tue, 26 Oct 2004 17:55:07 +0000 (GMT) (envelope-from james@jrv.org) Received: from [192.168.3.156] (zippy.jrv.org [192.168.3.156]) (authenticated bits=0) by mail.jrv.org (8.12.11/8.12.10) with ESMTP id i9QHt62e029341 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 26 Oct 2004 12:55:06 -0500 (CDT) (envelope-from james@jrv.org) Message-ID: <417E8F7A.70009@jrv.org> Date: Tue, 26 Oct 2004 12:55:06 -0500 From: "James R. Van Artsalen" User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.3) Gecko/20040910 X-Accept-Language: en-us, en MIME-Version: 1.0 To: obrien@freebsd.org References: <20041026115041.GE2841@sivokote.iziade.m$> <20041026173005.GA2984@dragon.nuxi.com> In-Reply-To: <20041026173005.GA2984@dragon.nuxi.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit 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 List-Id: Porting FreeBSD to the AMD64 platform List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Oct 2004 17:55:08 -0000 David O'Brien wrote: >malloc.c:map_pages() calls brk(2) and this is where it goes to la-la land. > > > The brk() kernel call is probably failing due to ulimit being exceeded and not anything mysterious. 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 #ifdef PIC movq PIC_GOT(HIDENAME(cerror)),%rdx jmp *%rdx