another argument against shared libraries

dan at bbncd dan at bbncd
Sat Aug 13 02:52:28 AEST 1983


From:  Dan Franklin <dan at bbncd>

What people seem to forget is that shared libraries would be easier to change
in EVERY way.  With respect to changes that might introduce bugs, shared
libraries are actually superior to regular libraries, especially if they are
done with the flexibility of Multics-style dynamic linking.  When you made a
change to the library, you would first make the change in a private version of
the library that only your own process tree would use.  Now every UNIX command
(that you run) will get tested with the new library--a fairly complete test!
There would be no possibility of releasing a version of the library in which
exec did not work; on the contrary, library changes would be tested far
more thoroughly than they are now.

Once you decided to release the library, you would again find any remaining bugs
much faster than with the current system, because EVERYTHING would be using it.
And as soon as users found a sufficiently bad bug, they would just switch
to the older version of the library, which you have of course retained in a
well-known place.  Meanwhile, you go and fix the bug, and now again EVERYTHING
is using the fixed version.

Someone else brought up the matter of incompatible changes, e.g. to the printf
format characters.  This is not an argument against shared libraries, but an
argument against shared anything, including kernels.  You can't make an
incompatible change to the kernel without providing some provision for older
programs; you would have to be just as careful with shared libraries.  And you
should already be taking that care with libraries, so that a program doesn't
break merely because it's reloaded.  (And thus make you think that it was the
change you made before you reloaded that caused the problem!)  Incompatible
changes can almost always be avoided (printf CAN interpret both character
sequences), but when they must happen, you can just keep the old version around
for awhile.  If a program were sufficiently ancient, you would have to have the
older version of the library resuscitated from backup tapes, just as you would
have to do anyway as soon as someone tried to recompile it.  If you haven't
made any incompatible changes to the kernel which require the new library, it
will work just fine.  If you have, well, the shared libraries don't matter; the
program would still be broken anyway.

In short, shared libraries (properly implemented) would make changing the library
routines an easier, safer task than they are now.

	Dan Franklin



More information about the Comp.unix.wizards mailing list