Operating System - HP-UX
1751860 Members
5433 Online
108782 Solutions
New Discussion юеВ

Re: Cannot dlopen load module '/usr/lib/pa20_64/libpthread.1' because it contains thread specific data.

 
Rock Brown
New Member

Cannot dlopen load module '/usr/lib/pa20_64/libpthread.1' because it contains thread specific data.

I have an 64-bit executable built without thread support, trying to load a shared library
linked with -lpthread and are unable to
load the library. I was looking for solution
that allows the two to co-exist versus,
removing threading from my library or adding
to existing executable.

Any help is appreciated.

Thanks,

Rock
4 REPLIES 4
MAUCCI_2
Frequent Advisor

Re: Cannot dlopen load module '/usr/lib/pa20_64/libpthread.1' because it contains thread specific data.

Have you tried relinking your application with -lpthread?

++Cyrille
Alexey Roytman
Frequent Advisor

Re: Cannot dlopen load module '/usr/lib/pa20_64/libpthread.1' because it contains thread specific data.

If you really-really do not want to relink either of them, you can try to define environment variable LD_PRELOAD to be /usr/lib/pa20_64/libpthread.1 before starting the application:
LD_PREALOAD=/usr/lib/pa20_64/libpthread.1
export LD_PRELOAD
exec your_application_binary
Rock Brown
New Member

Re: Cannot dlopen load module '/usr/lib/pa20_64/libpthread.1' because it contains thread specific data.

Thanks for the feedback.

I went with linking against -lpthread for
various reasons and it fixed the problem, however I then tried to dlopen() a 2nd shared library from within the first loaded
shared library and the problem returned.
The 2nd failure was resolved by linking
my executable against -lcl, which is
used by the last shared library. The
last shared library is not mind so I
can't change it. I still prefer a solution
I could implement in the first shared library since that is my development focus.

Alexey Roytman
Frequent Advisor

Re: Cannot dlopen load module '/usr/lib/pa20_64/libpthread.1' because it contains thread specific data.

Either relink both executable and first library with -lpthread and with -lcl, or set LD_PRELOAD to have both libpthread and libcl (full pathes, colon-separated).