two 4GB mallocs => SEGV

Georgi Guninski guninski at guninski.com
Tue Oct 26 04:50:19 PDT 2004


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 at fanboy.samsco.home:/usr/obj/usr/src/sys/GENERIC
amd64
amdkotef64#

amdkotef64# cat test.c
#include <stdlib.h>

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
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# 






More information about the freebsd-amd64 mailing list