From owner-freebsd-amd64@FreeBSD.ORG Tue Oct 26 12:47:11 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 C259B16A4CE; Tue, 26 Oct 2004 12:47:11 +0000 (GMT) Received: from freebee.digiware.nl (dsl439.iae.nl [212.61.63.187]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5DEB843D39; Tue, 26 Oct 2004 12:47:10 +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 i9QCl79S027088; Tue, 26 Oct 2004 14:47:08 +0200 (CEST) (envelope-from wjw@withagen.nl) Message-ID: <417E474A.1000401@withagen.nl> Date: Tue, 26 Oct 2004 14:47:06 +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: Georgi Guninski References: <20041026115041.GE2841@sivokote.iziade.m$> In-Reply-To: <20041026115041.GE2841@sivokote.iziade.m$> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit 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 12:47:11 -0000 Georgi Guninski wrote: > on a freebsd amd64 box with more than 8GB swap i experience the following: > > amdkotef64# uname -a > FreeBSD amdkotef64.localdomain 5.3-BETA6 FreeBSD 5.3-BETA6 #0: Sat Sep 25 > 21:49:38 UTC 2004 root@fanboy.samsco.home:/usr/obj/usr/src/sys/GENERIC > amd64 > amdkotef64# > > amdkotef64# cat test.c > #include > > int main(int ac, char **av) > { > char *a, *b; > size_t siz; > siz=4L*1024L*1024L*1024L; > printf("%lx\n",siz); > a=malloc(siz); > printf("%lx\n",a); > b=malloc(siz); > printf("%lx\n",b); > } > 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. 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. --WjW > amdkotef64# df -h > Filesystem Size Used Avail Capacity Mounted on > /dev/ad0s3a 3.8G 3.7G -236M 107% / > devfs 1.0K 1.0K 0B 100% /dev > /dev/ad0s3d 4.7G 34K 4.3G 0% /home > amdkotef64# du -h a.out.core > 2.5G a.out.core > amdkotef64#