From owner-freebsd-questions Tue Aug 10 12:35:15 1999 Delivered-To: freebsd-questions@freebsd.org Received: from houston.matchlogic.com (houston.matchlogic.com [205.216.147.127]) by hub.freebsd.org (Postfix) with ESMTP id 5B19115176 for ; Tue, 10 Aug 1999 12:35:12 -0700 (PDT) (envelope-from crandall@matchlogic.com) Received: by houston.matchlogic.com with Internet Mail Service (5.5.2448.0) id ; Tue, 10 Aug 1999 13:34:51 -0600 Message-ID: <64003B21ECCAD11185C500805F31EC0303786B03@houston.matchlogic.com> From: Charles Randall To: Charlie ROOT , freebsd-questions@FreeBSD.ORG Subject: RE: System hang when mmap() large files Date: Tue, 10 Aug 1999 13:34:51 -0600 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2448.0) Content-Type: text/plain; charset="iso-8859-1" Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Are you running the machine out of swap? Looks like you mmap 10 new MB on each iteration. What happens if you munmap() the region before the close()? Charles -----Original Message----- From: Charlie ROOT [mailto:root@sani-c.vrn.ru] Sent: Tuesday, August 10, 1999 1:53 AM To: freebsd-questions@FreeBSD.ORG Subject: System hang when mmap() large files 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 known 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 ? ;-) To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message