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-17 07:22:16 PST Path: nntp.gmd.de!stern.fokus.gmd.de!ceres.fokus.gmd.de!zib-berlin.de!uni-duisburg.de!RRZ.Uni-Koeln.DE!news.dfn.de!ikarus.rz.tu-clausthal.de!troubadix.rz.tu-clausthal.de!injc From: czeranski@informatik.tu-clausthal.de (Joerg Czeranski) Newsgroups: comp.unix.osf.osf1 Subject: Re: cc'ing a program crashes a running copy? Date: 17 Feb 1995 15:22:16 GMT Organization: TU Clausthal, IfI Message-ID: <3i2ev9$et7@ikarus.rz.tu-clausthal.de> References: <792367602snz@cucumber.demon.co.uk> NNTP-Posting-Host: troubadix.rz.tu-clausthal.de X-Newsreader: TIN [version 1.2 RZ-TUC(2) PL2] Andrew Gabriel (Andrew@cucumber.demon.co.uk) wrote: ] 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. [...] A simple workaround is to "rm prog" (or "mv prog prog.running") before compiling. This ensures that the compiler creates "prog" with a new inode and your running "prog" won't crash. joerg -- Joerg Czeranski EMail czeranski@informatik.tu-clausthal.de Osteroeder Strasse 55 czeranski@rz.tu-clausthal.de D 38678 Clausthal-Zellerfeld WWW http://www.in.tu-clausthal.de/~injc/