From owner-freebsd-questions Fri Jul 10 16:24:47 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id QAA11104 for freebsd-questions-outgoing; Fri, 10 Jul 1998 16:24:47 -0700 (PDT) (envelope-from owner-freebsd-questions@FreeBSD.ORG) Received: from mail.websidestory.com (mail.websidestory.com [209.75.20.4]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id QAA11092 for ; Fri, 10 Jul 1998 16:24:44 -0700 (PDT) (envelope-from vansax@mail.websidestory.com) Received: from localhost (vansax@localhost) by mail.websidestory.com (8.8.7/8.8.5) with SMTP id QAA19635; Fri, 10 Jul 1998 16:24:42 -0700 (PDT) Date: Fri, 10 Jul 1998 16:24:42 -0700 (PDT) From: Jim Van Baalen To: freebsd-questions@FreeBSD.ORG cc: Jim Van Baalen Subject: Multiple processes accessing a single file 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 I have been working for some time on a few programs that calculate webstats from standard apache logfiles. During this time I have been able to consistently crash machines by doing things that seemed reasonable (to me). Here is some general configuration information. o All the involved system are running either 2.2.5 or 2.2.6 release FreeBSD. o The filesystem to which systems are logging is NFS mounted. First I was modifying an existing program that rotates all the logs nightly and then does calculations using the "old" logfiles. The method used to rotate the files was to cp the active file to the "old" file and then cp /dev/null over the active logfile. I had never used this method, but it seemed the idea was to rotate the files without stopping httpd. This caused 2 problems 1) Systems would often hang when the logfiles were rotated in this fashion. They would log Panic: vm_fault: fault on nofault entry, addr: f774f000 to the console. The systems would sometimes sync and reboot and sometimes hang while attempting to sync. 2) When this rotation method did not crash the machines, copying /dev/null over files seems to often create a file with garbage in the first line. This garbage was often many megs of data. If viewed with vi it looked like ^@^@... I have subverted this problem by killing httpd, rotating the files, and restarting httpd. I wrote a second program that runs from MRTG and calculates output bits for a webpage every 5min. I believe that I have observed that this program also (if very rarely) crashes machines. I get the impression that when httpd is writing to a file it is possible to crash FreeBSD by accessing that file in any way. It appears that I don't have the same problem on the one 2.2.6 machine (but this may be misleading because this machine is nowhere near as busy as the other machines). Have any of you experienced this sort of behavior? Are there known bugs that were addressed in 2.2.6? Am I shooting myself in the foot by using an NFS mounted file system? Jim To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message