From owner-freebsd-amd64@FreeBSD.ORG Tue Oct 26 13:13:41 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 F0F6D16A4CE for ; Tue, 26 Oct 2004 13:13:41 +0000 (GMT) Received: from freebee.digiware.nl (dsl439.iae.nl [212.61.63.187]) by mx1.FreeBSD.org (Postfix) with ESMTP id 827F743D45 for ; Tue, 26 Oct 2004 13:13:36 +0000 (GMT) (envelope-from wjw@withagen.nl) Received: from [212.61.27.71] (dual [212.61.27.71]) by freebee.digiware.nl (8.12.10/8.12.10) with ESMTP id i9QDDG9S027974; Tue, 26 Oct 2004 15:13:27 +0200 (CEST) (envelope-from wjw@withagen.nl) Message-ID: <417E4D6C.4040508@withagen.nl> Date: Tue, 26 Oct 2004 15:13:16 +0200 From: Willem Jan Withagen User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.2) Gecko/20040804 Netscape/7.2 (ax) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Peter Pentchev References: <20041026115041.GE2841@sivokote.iziade.m$> <417E474A.1000401@withagen.nl> <20041026125709.GF1003@straylight.m.ringlet.net> In-Reply-To: <20041026125709.GF1003@straylight.m.ringlet.net> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit cc: Georgi Guninski 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 13:13:42 -0000 Peter Pentchev wrote: > On Tue, Oct 26, 2004 at 02:47:06PM +0200, Willem Jan Withagen wrote: > >>Georgi Guninski wrote: >> >> >>>on a freebsd amd64 box with more than 8GB swap i experience the following: > > [snip] > >>>amdkotef64# cat test.c > > [snip 2 * 4GB malloc] > >>>amdkotef64# gcc test.c >>>amdkotef64# ./a.out >>>100000000 >>>503000 >> >>>/: write failed, filesystem is full >>>Segmentation fault >> >>These 2 lines stem from the fact that the program is being dumped and there >>is not enough space to dump the full size core of that program. >> >>what does swapinfo tell you during the the run of the program??? >> >>I ran malloc tests in 4Gb with 5Gb of swap, which it nicely completely >>filled, and then in faulted, because there was no more space. >>This behaviour can be set, I think. Check man 5 malloc.conf, and check >>/etc/malloc.conf to see if you've got the X-flag on. > > > But shouldn't malloc() write out an 'out of memory' message before the > core dump then? There's no such message in Georgi's output. That depends on the flags set with malloc.conf. The X-flag tells you how errors are handled. But you are right, it is strange: malloc should either return 0, or give a warning. I think that std-malloc settings were AX for anything before -STABLE. > It's true that when he asked me on Saturday about this, I completely > forgot about malloc's X flag, but I don't think he's using it, and even > if he were, there ought to be a message there. That's why I send him to the man-page. He could even force the settings in the testprogram. And check the link!!! it is probably set to something, or something is assumed. So better be safe and force it one-selves. Could be that the message does not arrive because the out-of-mem trap killed it first.... ??? Perhaps also check /var/log/messages. I remember seeing things there as well. >>I have malloc.conf-> aj, and the program terminates in 3 seconds because it >>does not zero the memory. >> >>So pick and choose the behaviour you want. > > > Sure, the question is if this is the result of 'X' or something else :) Well given the fact that there are not yet that many big boxes, let alone people really wanting to allocate a 4Gb blob, I'm not going to bet the usual case of beer on it. :~) --WjW