what happens if you strip a binary that's executing?

Kevin P. Fleming kpfleming at linuxfromscratch.org
Sat Feb 19 13:32:58 PST 2005

Mason Oliver Dickson wrote:

> What happens if you absentmindedly strip a binary that's executing?

Nothing out of the ordinary. Standard Unix and Unix-like behavior is to 
keep the file around until it's no longer needed, and since the strip 
tool actually copies the file into a new file then removes the old one, 
this works fine (see discussion of this in the lfs-dev archives from 
last year). The old file will disappear from view, but continue to be 
present on the filesystem until any processes using it are completed, 
then it will go away for good.

Now if the strip tool (or any other tool) actually modified the binary 
in place, that would be very bad :-) It's likely that it wouldn't be 
able to open the file for writing, though, since the kernel knows it's 
being used to provide backing store for a running process.

More information about the lfs-chat mailing list