Re: Can't dlopen() a library containing Thread Local Storage - Incorrect path beinh taken (390 Views)
Reply
Occasional Advisor
Pankaj Agrawal
Posts: 18
Registered: ‎01-04-2005
Message 1 of 2 (390 Views)

Can't dlopen() a library containing Thread Local Storage - Incorrect path beinh taken

I have built an executable that dlopens a shared lib. Both the exe and the lib are PARISC1.1.

The shared lib thats dlopen'ed by the exe is dependent on libjvm.sl. While building the shared lib, I have used -Wl,+s linker option and used java1.4 for linking i.e. something like -L/opt/java1.4/jre/lib/PA_RISC/server/ -ljvm.

However, when I am testing ans trying to run the exe on another machine that has java 1.5, I get an error saying that

Can't dlopen() a library containing Thread Local Storage: /opt/java1.4/jre/lib/PA_RISC/server//libjvm.sl

I am getting this even though I have set SHLIB_PATH to java1.5 paths and also set LD_PRELOAD to java1.5 libjvm.sl. Why is the SHLIB_PATH not being taken even when +s linker flag has been specified while building the shared lib?

Can someone help me out?
Acclaimed Contributor
Dennis Handly
Posts: 25,296
Registered: ‎03-06-2006
Message 2 of 2 (390 Views)

Re: Can't dlopen() a library containing Thread Local Storage - Incorrect path beinh taken

You seemed to have used the right options and ENV vars.

I suppose for your "other" machine, you could try to use the java1.4 libs to see if that works.

Otherwise try using ldd(1) to see why the variables aren't working:

export SHLIB_PATH=...
LD_PRELOAD=.../java1.5/.../libjvm.sl ldd your-shlib

See if there is more than one libjvm.sl?

Can you show us the chatr(1) output on your shlib?

I suppose you could also use tusc to see what libs are being opened during loading.
The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the Terms of Use and Rules of Participation.