From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fee84,98408586e4f95a49 X-Google-Attributes: gidfee84,public X-Google-ArrivalTime: 1995-02-09 16:08:10 PST Newsgroups: comp.unix.osf.osf1 From: Andrew@cucumber.demon.co.uk (Andrew Gabriel) Path: swrinde!howland.reston.ans.net!news.sprintlink.net!peernews.demon.co.uk!cucumber.demon.co.uk!Andrew Cc: matap@lure.latrobe.edu.au Subject: Re: cc'ing a program crashes a running copy? References: Organization: home Reply-To: Andrew@cucumber.demon.co.uk X-Newsreader: Demon Internet Simple News v1.29 X-Posting-Host: cucumber.demon.co.uk Date: Thu, 9 Feb 1995 22:06:42 +0000 Message-ID: <792367602snz@cucumber.demon.co.uk> Sender: usenet@demon.co.uk In article matap@lure.latrobe.edu.au "Andrej Panjkov" writes: > Suppose 'prog' is the executable form prog.c. > Suppose prog is running. > Compile prog.c in another window (cc -o prog prog.c). > > When cc finishes, the excuting copy of prog crashes with a memory fault!? > > What th'...? > > Get this too: if prog is running and I recompile prog giving the new > executable a new name (cc -o xxx prog.c), prog doesn't crash. > > Why should overwriting the executable on disk crash the corresponding > active process in memory? Is this some weird sort of dynamic execution > thing that I don't know about? Some unixs swap in the read-only parts of a running process from the executable file, rather than the swap slice. It looks like this one does so from what you say. Normally, they protect the running process by preventing overwriting of the file whilst it's being executed; looks like this one doesn't :-(. -- Andrew Gabriel Home: Andrew@cucumber.demon.co.uk Consultant Software Engineer Work: Andrew.Gabriel@net-tel.co.uk