Re: Shared library problem

From: Jamie Lokier (lk@tantalophile.demon.co.uk)
Date: Wed Feb 23 2000 - 16:37:27 EST


Jesse Pollard wrote:
> The problems with replacing shared libraries are:
>
> 1. deletion is not good: the file reference to the library is removed and
> may be needed by the next process started.
> 2. over write is very bad: current processes will abort immediately

Current processes _may_ abort. Or, if you're unlucky, they may just go
ahead and do the wrong thing. This includes ostensibly secure programs,
if you upgrade libc. So overwrite isn't just very bad, it's very, very
bad.

> The best way to update active shared libraries:
>
> 1. load the new libraries - usually they will have a new version number
> 2. add the libraries to the cache list - ld.so.conf - if necessary.
> 3. re-run ld.so to rebuild the cache to include the new files
> 4. rename the old files. Do not delete since active processes may
> be using them - unless you are in the process of rebooting.

You forgot (or perhaps it is implied): ld.so should create the new
symbolic links under different names, and rename them to atomically
replace the old links. I don't know if ld.so does this.

enjoy,
-- Jamie

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Wed Feb 23 2000 - 21:00:34 EST