Usenet comp.unix.osf.osf1 (1992-2004)
 help / color / mirror / Atom feed
From: richardw@tiger.xs4all.nl (Richard Westerik)
Subject: Re: Overwriting exe's crashes osf programs ? Why
Date: 1996/02/23	[thread overview]
Message-ID: <022396184941Rnf0.79b5@tiger.xs4all.nl> (raw)
In-Reply-To: 4giut5$rvv@zk2nws.zko.dec.com


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 -------------------'



  reply	other threads:[~1996-02-23  5:00 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1996-02-22  5:00 Overwriting exe's crashes osf programs ? Why levine
1996-02-22  5:00 ` Thomas Graichen
1996-02-27  5:00   ` Jon Trulson
1996-02-22  5:00 ` Jeffrey M. Denham
1996-02-23  5:00   ` Richard Westerik [this message]
1996-02-25  5:00     ` Mike Iglesias
1996-02-25  5:00       ` Richard Westerik
1996-02-22  5:00 ` Alan Rollow - Dr. File System's Home for Wayward Inodes.
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox