From owner-freebsd-questions Fri Aug 6 6:54:13 1999 Delivered-To: freebsd-questions@freebsd.org Received: from sani-c.vrn.ru (sani-c.vrn.ru [195.98.74.81]) by hub.freebsd.org (Postfix) with ESMTP id A70C315005 for ; Fri, 6 Aug 1999 06:53:45 -0700 (PDT) (envelope-from root@sani-c.vrn.ru) Received: from localhost (root@localhost) by sani-c.vrn.ru (8.9.3/8.9.3) with ESMTP id QAA10799 for ; Thu, 5 Aug 1999 16:16:05 +0400 (MSD) Date: Thu, 5 Aug 1999 16:16:05 +0400 (MSD) From: Charlie ROOT To: freebsd-questions@FreeBSD.ORG Subject: System hang when mmap() large files Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG My FreeBSD 3.1-STABLE hangs when this small program running: #include #include #include #include #include main() { int fd; int i; int len=1024*1024*10; /*ie 10Mbytes*/ caddr_t addr; char ttt[80]; for (i=0;;i++) { sprintf (ttt,"%d",i); fd=open(ttt,O_CREAT|O_RDWR,0666); if (fd<0) { printf("open error %ld\n",errno); exit(1); } lseek(fd,len-1,SEEK_SET); write(fd,"",1); addr=mmap(0,len,PROT_READ|PROT_WRITE,MAP_SHARED,fd,0); if (addr==MAP_FAILED) { printf("mmap error %ld",errno); exit(1); } close(fd); memset(addr,'x',len); } } uname -a on my machine shows: FreeBSD oleg.sani-c.vrn.ru 3.1-STABLE FreeBSD 3.1-STABLE #2: Fri Apr 23 13:31:08 MSD 1999 root@oleg.sani-c.vrn.ru:/usr/src/sys/compile/KERNEL-CURRENT i386 Is this a unknown bug ? I'm very sorry, but I can't cvsup now, so if this bug has been fixed already, please don't beat me, OK ? ;-) Sorry for my bad English... To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message