SUMMARY: Strange dependence of executable on disk image

From: Brett Lymn (
Date: Mon Jul 20 1992 - 21:16:13 CDT

Last week I posted the following:

> Hello Sun Managers,
> This is not really a problem but a puzzling
> observation. I have noticed that in some circumstances when I remove
> a file that is running (e.g. I have tvtwm running as my window manager
> and then do rm /usr/local/bin/tvtwm) the application quits, this does
> not just happen with tvtwm but with other applications as well. I
> thought that when an application is started the image was loaded into
> "core" and the disk file was no longer referenced, if this is so why
> the strange dependency on the disk image after the application is
> loaded?

And have had a whole flood of replies. All the people that replied
were of the same opinion, namely that when unix loads in the
executable it does not necessarily load it all and also it recognises
the fact that the code is read only and hence instead of taking up
swap space will dump the memory pages and re-read them from the disk
image if the code pages need to be swapped out. The extra wrinkle I
was experiencing comes from the fact that I was using an NFS mounted
partition, normally unix knows that a file is opened and will not
delete the open file when it is being referenced, NFS due to the
stateless protocol used does not know when a file is in use on a
client so you can easily cut and executable out from under an NFS
mounted client - which is exactly what happened to me, in which case
the application folded up due to lack of code when the kernel tried to
swap in some pages.
  A number of people warned of the dangers of updating NFS mounted
executables because if the disk image is updated when the code is
running on a NFS client then there is a chance of the wrong pages
being read in on a swap and making the code go troppo.

Thanks to the following for their answers: (Birger A. Wathne)
Chris Keane <chris@rufus.state.COM.AU> (Geert Jan de Groot)
bernards@ECN.NL (Marcel Bernards)
"Casper H.S. Dik" <>
Postmaster <>
Matt Crawford <>
Mr T Crummey (DIJ) <>
stern@sunne.East.Sun.COM (Hal Stern - NE Area Systems Engineer)
Mike Raffety <> (William LeFebvre)
"Hilarie Orman" <>
trdlnk! (Michael Sullivan)
rmsun! (Robert Morse) (Matthew Donaldson) (Bruce Oneel )
Colin Macleod <>
kalli!kevin@fourx.Aus.Sun.COM (Kevin Sheehan {Consulting Poster Child}) (James Ashton)
mce@sdcc10.UCSD.EDU (Mark Edwards) (System Administrator)

Brett Lymn
Computer Systems Administrator
AWA Defence Industries

This archive was generated by hypermail 2.1.2 : Fri Sep 28 2001 - 23:06:46 CDT