From owner-freebsd-hackers Wed Jun 12 15:28:41 1996 Return-Path: owner-hackers Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id PAA09458 for hackers-outgoing; Wed, 12 Jun 1996 15:28:41 -0700 (PDT) Received: from paris.CS.Berkeley.EDU (paris.CS.Berkeley.EDU [128.32.34.47]) by freefall.freebsd.org (8.7.5/8.7.3) with SMTP id PAA09451 for ; Wed, 12 Jun 1996 15:28:39 -0700 (PDT) Received: from paris.CS.Berkeley.EDU (localhost.Berkeley.EDU [127.0.0.1]) by paris.CS.Berkeley.EDU (8.6.11/8.6.9) with ESMTP id PAA21366; Wed, 12 Jun 1996 15:27:42 -0700 From: Josh MacDonald Message-Id: <199606122227.PAA21366@paris.CS.Berkeley.EDU> To: "John S. Dyson" cc: freebsd-hackers@freebsd.org Subject: Re: strange mmap programming bug In-reply-to: Your message of "Wed, 12 Jun 1996 09:35:23 CDT." <199606121435.JAA01198@dyson.iquest.net> Date: Wed, 12 Jun 1996 15:27:41 -0700 Sender: owner-hackers@freebsd.org X-Loop: FreeBSD.org Precedence: bulk > > > > I'm having this problem. I don't know if its only on FreeBSD or not, > > as I have only experienced it on FreeBSD and its hard to reproduce. > > > > Occasionally, when a program of mine exits abnormally, it seems that > > small files which were opened O_RDONLY and then mmaped are being > > modified. I am mmaping the entire file. I have only noticed this > > for files smaller than PAGESIZE. The file's length is changed to > > be exactly 4096 bytes with zero's padding the original data. > > > More questions: > What filesystems were you using? > How much paging was going on? > Were you ever doing ANY read/write style I/O > to that file? (even in another process.) > > Tell me all you can... There has been a problem > (that hasn'nt been seen in -current) with mmap. > If you can run -current, try that also. > > Thanks... > John Sorry for not providing enough information. This is on a UFS filesystem, SCSI, 1G Seagate 1080N. The machine is FreeBSD deceit.xcf.berkeley.edu 2.2-960323-SNAP FreeBSD 2.2-960323-SNAP #0: Mon May 6 19:57:34 PDT 1996 root@:/home3/2.2-960323-SNAP-src/sys/compile/DECEIT i386 The machine has one other local filesystem mounted which is also a SCSI disk. I don't know how much paging was going on, I have 32 megs of ram and the machine was not too loaded. The process may have been paging due to it basically mmaps each of a (possibly long--100 in this case) list of files to compute checksum and then replace RCS-style keywords. Thinking about it further, I guess the file may have been the last one open before forking an RCS CI command on the file. I don't know how RCS opens files. I will try to reproduce this again. -josh