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 03:50:06 PST Newsgroups: comp.unix.osf.osf1 Path: nntp.gmd.de!dearn!esoc!linuxed1!peernews.demon.co.uk!doc.news.pipex.net! pipex!howland.reston.ans.net!Germany.EU.net!zib-berlin.de!news.th-darmstadt.de!muster!marvin.physik.uni-giessen.de!arndt From: arndt@marvin.physik.uni-giessen.de (Arndt Brenschede) Subject: Re: cc'ing a program crashes a running copy? Sender: news@muster.hrz.uni-giessen.de Message-ID: Date: Thu, 9 Feb 1995 11:50:06 GMT Reply-To: arndt@marvin.physik.uni-giessen.de (Arndt Brenschede) References: Organization: CERN European Lab for Particle Physics -- In article , matap@lure.latrobe.edu.au (Andrej Panjkov) writes: |> Hi-- |> |> On an ALPHA 3000/300x with DEC OSF/1 3.05, this strange thing happens: |> |> 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? |> |> Please explain this to me, and suggest a fix/workaround. |> The reason is that the part of the executable that is not in physical memory is not somewhere else in virtual memory, but only on the disk from where you startet it. So when you overwrite the executable, the program must crash. (This is not the case if the executable is on a NFS-mounted disk!) However, it is somewhat strange that it is possible to overwrite a running executable. On Ultrix, this was avoided by a mechanism called 'file locking'. ================================================================ Arndt Brenschede, Dipl.-Phys. II. Physikalisches Institut der Uni Giessen Heinrich-Buff-Ring 16, 35392 Giessen (Germany) Tel: 0641-702-2787 Fax: 0641-74390 Mail: arndt@marvin.physik.uni-giessen.de ================================================================