I apologize if the following comes off like a techno-sermon:

As we all know, LD_LIBRARY_PATH is the environmental variable
that tells ld.so where to look (What directories) for all of the shared
libraries on a system.  My problem is not with LD_LIBRARY_PATH, but
how it is impliemented. Currently, as it exists, it is usually set globally. 
What happens is:

1.) LD_LIBRARY_PATH is totally ignored by executables that have been set to 
setuid or setgid. I'm not willing to compromise a system to enable an 
executable to use LD_LIBRARY_PATH. Regardless, a symbolic link will not solve 
this problem.

2.) ld will search LD_LIBRARY_PATH during linking (Even if you don't use the 
-L option... ) which can cause all sort of strangeness. So, for instance,  a 
package that compiles correctly on Debian, throws up on Slackware.

3.) All programs are compiled without any run time path specified. They depend 
on LD_LIBRARY_PATH being set globally. 

4.) Precompiled binaries more often than not already have the LD_LIBRARY_PATH
set. Whatever flavor of Linux/*NIX your running better have the same idea of
what should be in LD_LIBRARY_PATH or the app won't run.

The idea of LD_LIBRARY_PATH is brilliant, but the execution has been poor
leaving us with a mess. Further, what's so silly about the whole thing is that 
the problem centers around LD_LIBRARY_PATH being set globally (It's not 
defined as a standard, so everybody needs a crystal ball). It should be set 
individually (Until the time comes, if ever that there is a standard 
defintion). 

It's being set globally so it can be used as a fix-all. The result is that it 
breaks things. For proof, just do a quick google for "LD_LIBRARY_PATH 
problem" -  I just did it and it returned 164.000 hits.

Now, a lot of people say that LD_LIBRARY_PATH would have kept the glibc 
debacle from every happening (Circ. 1999 - 2000). This is total BS. I lived 
through that debacle and I can state, with absolute certainty that the 
breakage that occurred with that debacle could never have been avoided using 
LD_LIBRARY_PATH. 

Best

Marvin


On Monday 17 January 2005 11:09 pm, Ales Hvezda wrote:

> What problems did you or other people see because of the use of  
> LD_LIBRARY_PATH?  It's used all over the place, particularly in 
> wrapper scripts. 

Attachment: pgpF585tI40eV.pgp
Description: PGP signature

Reply via email to