From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fee84,6b04f5359af5c957 X-Google-Attributes: gidfee84,public From: richardw@tiger.xs4all.nl (Richard Westerik) Subject: Re: Overwriting exe's crashes osf programs ? Why Date: 1996/02/23 Message-ID: <022396184941Rnf0.79b5@tiger.xs4all.nl>#1/1 X-Deja-AN: 140839380 distribution: world references: <4gie5u$ngn@lal.interserv.net> <4giut5$rvv@zk2nws.zko.dec.com> organization: The Tiger at home, The Netherlands newsgroups: comp.unix.osf.osf1 In article <4gie5u$ngn@lal.interserv.net>, levine@amarex.com writes: >>When we overwrite executables on disk programs running that exe crash...Can I aviod >>with any link options ??? >> Jeremy Levine - levine@amarex.com denham@denham.zk3.dec.com (Jeffrey M. Denham) responds: >This should be in the FAQ too. The Digitial UNIX I/O system doesn't >support the ETXTBUSY functionality of some UNIX-based OS. The core >dump happens when the thread running the overwritten program attempts >to page in something from the image. What evers was at the old location >may no longer be good text, so it dies with an illegal instruction fault. >There's no cc/ld option to prevent this directly. Instead, you need >a rule to mv a.out (or whatever -o specified) to the final image name. >The mv leaves the original file open internally without interference. >When the last processes running the program exits, the internal >copy of the replaced program will be deleted. I disagree. It's not "just" cc or ld that can cause a situation like this. A customer of ours was once badly bitten by this 'feature' of Digital Unix. He tried to restore (part of?) /usr while running the restore from a 'dxterm' under X11. When the restore process hit 'dxterm' it must have memory faulted, causing the 'dxterm' to close and killing the restore with it. The customer tried selecting 'dxterm' from the menu, but it died instantly. I tried 'xterm' which did work, and figured out the 'dxterm' had been corrupted (only partially restored). This can happen not only when you try to overwrite an executable with a *different* content, but also when the content is going to be exactly the same! I've seen this problem on numerous occasions. I consider it to be a bug. In my point of view the system only has two options: (A) allow overwriting executables *AND* surviving it (like the systems that do not have demand paging, if the system loads the entire executable in memory at process creation then it doesn't matter if the filesystem copy gets overwritten while it is running) (B) disallow it (like most vendors UNIXes do: HP-UX, SCO, IBM AIX etc.) Implementing ETXTBSY cannot be so difficult; some systems we sold 10 years ago already had demand paging *and* a protection against this sort of scheme. What is Digital's reaction to comments like this? Kind regards, Richard -- .------------------------- Richard M.J. Westerik --------------------------. |\@@@@\ | Private e-mail : richardw@tiger.xs4all.nl OR richardw@xs4all.nl | | \@@@@\ | Business e-mail: richardw@bssi.nl CompuServe: 100120,1136 | | \@@@@\| World wide web : http://www.xs4all.nl/~richardw (not finished) | `------------------- A day not loved is a day not lived -------------------'