Operating System - Linux
1752571 Members
4507 Online
108788 Solutions
New Discussion юеВ

Re: Can't open shared library: /usr/lib/libpthread.1

 
pguzman
Occasional Contributor

Can't open shared library: /usr/lib/libpthread.1

Hi,

We have a piece of code that fails while loading one of our libraries.
We reproduce the problem with this simple program:
******************************
#include
#include
#include

int main(void){

char* env_path = 0;

void* rc;
char* rs = 0;

env_path = getenv("SHLIB_PATH");

printf("value for SHLIB_PATH is: %s\n", env_path);

putenv("SHLIB_PATH=/opt/ibm/gsk7/lib:/usr/lib");

putenv("ICC_IGNORE_FIPS=yes");

env_path = getenv("SHLIB_PATH");

printf("New value for SHLIB_PATH is: %s\n", env_path);

rc = dlopen("libgsk7ssl.sl",RTLD_NOW | RTLD_GLOBAL);

rs = dlerror();
printf("Reason is %s\n",rs);
if (!rc) {
printf("ERROR. library not loaded\n");
} else {
printf("OK, library loaded\n");

}
}
**********************

libgsk7ssl.sl is our dll.
this is the output of 'ldd libgsk7ssl.sl'
/usr/lib/libpthread.1 => /usr/lib/libpthread.1
./../gsk_cms/gskcms/hpuxrelease//libgsk7cms.sl => /usr/lib/libgsk7cms.sl
/usr/lib/libpthread.1 => /usr/lib/libpthread.1
/usr/lib/libCsup_v2.2 => /usr/lib/libCsup_v2.2
/usr/lib/libstd_v2.2 => /usr/lib/libstd_v2.2
./gsksys/hpuxrelease//libgsk7sys.sl => /usr/lib/libgsk7sys.sl
/usr/lib/libpthread.1 => /usr/lib/libpthread.1

I have some machines where this sample program works, some machines where it doesn't. I compile it with aCC:
aCC -lpthread -lm sample_code.c

I recognized that the difference between the failing machines and the good one for my sample is the presence of patch phss_33037. The presence of this patch triggers the problem.
Is it something related to the patch?

thanks.
9 REPLIES 9
Steven E. Protter
Exalted Contributor

Re: Can't open shared library: /usr/lib/libpthread.1

Shalom,

Patch causes the problem. You said it. Check the patch database for a successor patch. Or swremove it.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
pguzman
Occasional Contributor

Re: Can't open shared library: /usr/lib/libpthread.1

Thanks for the reply.
Do you already know if there's some problem with this patch? Or if this patch added some side-effect in the way to load libraries?

I ask this because I cannot find superseded patches to this one and I need to be 100% sure before asking to remove an OS patch.

Thanks.
Arunvijai_4
Honored Contributor

Re: Can't open shared library: /usr/lib/libpthread.1

Hi,

phss_33037 is s700_800 11.11 ld(1) and linker tools cumulative patch. Do you have latest aCC patches installed ? or, what is your acc version ? Take a look at PHSS_33944.

-Arun

"A ship in the harbor is safe, but that is not what ships are built for"
Dennis Handly
Acclaimed Contributor

Re: Can't open shared library: /usr/lib/libpthread.1

What is the output from dlerror? (It would help if you would put that printf inside your error block.)

Note if you need to load libpthread.1, it is probably the Thread Local Storage error. I.e. you must link your executable with -lpthread and it seems you have it.

The only other weird case of this error occurs if you patch libpthread while the application was running. But that would only show up once, then go away.
pguzman
Occasional Contributor

Re: Can't open shared library: /usr/lib/libpthread.1

My compiler version is A.03.33. I can try to install the latest patch of aCC (PHSS_33944).

The dlerror I get is "Can't open shared library: /usr/lib/libpthread.1"

I've run the sample code after having completed the patch installation.

Do I have to follow some specific rules while linking to libc? (At the moment aCC does it for me)
Dennis Handly
Acclaimed Contributor

Re: Can't open shared library: /usr/lib/libpthread.1

>I can try to install the latest patch of aCC (PHSS_33944).

You can but I doubt it will make a difference since it is dld that's the problem. As mentioned by Steven, you should probably remove PHSS_33037. (See comment below for one last change before removing the patch.)

>The dlerror I get is "Can't open shared library: /usr/lib/libpthread.1"

This isn't a good message since it doesn't say why it can't open it. Does it still say this if you move these into the error block?
rs = dlerror();
printf("Reason is %s\n",rs);

>I've run the sample code after having completed the patch installation.
aCC -lpthread -lm sample_code.c

This isn't correct. Your libgsk7ssl.sl is compiled with -AA. So you need to compile sample_code.c with -AA too. (You probably could compile with cc.)

So fix your source and add -AA before you remove the patch.

>Do I have to follow some specific rules while linking to libc? (At the moment aCC does it for me)

No, not for libc, just let the driver handle it.
ranganath ramachandra
Esteemed Contributor

Re: Can't open shared library: /usr/lib/libpthread.1

this is reported against PHSS_33037 as JAGag16003 . the fix will be released in a superseding patch in a couple of weeks, till then you should uninstall this patch.
 
--
ranga
[i work for hpe]

Accept or Kudo

pguzman
Occasional Contributor

Re: Can't open shared library: /usr/lib/libpthread.1

Thanks for the update!

Do you know if there's a place where to get this info officially from HP? (i.e. a public website or other). I have to be 100% sure before asking to remove a OS patch from a system or to wait for a new patch.

Thanks again
V. Nyga
Honored Contributor

Re: Can't open shared library: /usr/lib/libpthread.1

Hi,

check the patch details:
http://www4.itrc.hp.com/service/cki/patchDocDisplay.do?patchId=PHSS_33037

As mentioned you can remove this patch and install the previous PHSS_33033.

Volkmar
*** Say 'Thanks' with Kudos ***