gSystem->Load searches in wrong directory with ROOT 5.27

Dear all,

A call to gSystem->Load() used to search the LD_LIBRARY_PATH to find the library. In 5.26 and before it was the case. However, since 5.27 the current directory and subdirectories are also searched if the name of the directory corresponds. I believe this is wrong. Let’s take an example, because it is difficult to explain :slight_smile:

I attached a library to this message. It was compiled with ROOT 5.21 so we are sure to get an error when loading it and thus we will know where the library is actually taken from. The following was done on lxplus.

  1. Save the library on your disk, let’s say in your home, untar it.
  2. mkdir /tmp/lib
  3. cp libAmoreQAPublisher.so /tmp/lib
  4. export LD_LIBRARY_PATH=/tmp/lib:$LD_LIBRARY_PATH
  5. mkdir tmp
  6. mkdir tmp/lib
  7. cp libAmoreQAPublisher.so tmp/lib
    // At this point we have the library in two places : /tmp/lib and ~/tmp/lib. However only the first one is in LD_LIBRARY_PATH and thus I expect only this one to be loaded.
  8. root
root [0] gSystem->Load("libAmoreQAPublisher.so")
dlopen error: .//tmp/lib/libAmoreQAPublisher.so: wrong ELF class: ELFCLASS32
Load Error: Failed to load Dynamic link library .//tmp/lib/libAmoreQAPublisher.so
(int)(-1)
*** Interpreter error recovered ***

==> We see that it is loading the library in ~/tmp/lib (.//tmp/lib/libAmoreQAPublisher.so) even though it is not in the LD_LIBRARY_PATH.
If you try to do this with root 5.26 it will load the one in /tmp/lib.

What do you think ?

Thanks
Barth
libAmoreQAPublisher.so.tgz (189 Bytes)

Any news on this ?
Have you been able to reproduce the problem ?
Or is it a feature ? :wink:

Barth

Hi Barth,

Yes, I was able to reproduce and fix the problem in time for v5.28

Cheers,
Philippe.

Excellent !
Thanks a lot !

Barth