Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 10 Jul 1998 16:24:42 -0700 (PDT)
From:      Jim Van Baalen <vansax@mail.websidestory.com>
To:        freebsd-questions@FreeBSD.ORG
Cc:        Jim Van Baalen <vansax@mail.websidestory.com>
Subject:   Multiple processes accessing a single file
Message-ID:  <Pine.BSI.3.96.980710155020.14070J-100000@mail.websidestory.com>

next in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSI.3.96.980710155020.14070J-100000>