Operating System - HP-UX
1753481 Members
4483 Online
108794 Solutions
New Discussion юеВ

Re: libcma vs. libpthread

 

libcma vs. libpthread

Hello,

I have severe problems with a selfwritten PA-RISC application across HP-UX 11i v1, v2 and v3:

Background is a new Integrity Server with HP-UX 11.31. On that server our old app wasn't running any more:

The callstack of the coredump was:

#0 0xc373ab58 in pthread_mutex_unlock+0x48 () from /usr/lib/libcma.2
#1 0x451978 in sltsimr+0x10 ()
#2 0x388d90 in kpummpin+0x4a8 ()
#3 0x592288 in kpupin+0x7c ()
#4 0x3cfbac in OCIInitialize+0x30 ()
#5 0x31680c in sqgctx+0xc4 ()
#6 0x31671c in sqgrct+0x50 ()
#7 0x30b0f8 in sqlcmex+0x3e0 ()
#8 0x30b5f0 in sqlcxt+0x78 ()


OK, I found in another thread here at ITRC, that under HP-UX 11i libcma is deprecated and libpthread should be used instead.

That worked, at least for HP-UX 11.31.

But the application doesn't run on 11.23 nor 11.11 any more...

On a PA-RISC machine running 11.11 I simply get a:

"FATAL ERROR: cannot open display; program aborted" ('xclock' worked, so no problem of $DISPLAY or Xn.hosts)

OK, I don't expect that anybody can comment on that... but on 11.11/PA-RISC I get no core dump.

On an Integrity-Server running 11.23 the following callstack can be extracted from the coredump:

#0 0xc1d61e68 in kill+0x10 () from /usr/lib/libc.2
#1 0xc1cf95d4 in raise+0x24 () from /usr/lib/libc.2
#2 0xc1d3f2f8 in abort_C+0x160 () from /usr/lib/libc.2
#3 0xc1d3f354 in abort+0x1c () from /usr/lib/libc.2
#4 0xc1cc96b8 in _assert+0x178 () from /usr/lib/libc.2
#5 0xc1d75dd8 in pthread_mutexattr_init+0x58 () from /usr/lib/libc.2
#6 0xc1d728dc in __libc_init+0x6fc () from /usr/lib/libc.2
#7 0xc335c90c in __hp__init_libc+0x28 () from /usr/lib/libpthread.1
#8 0xc3360ec0 in __pthread_startup+0x414 () from /usr/lib/libpthread.1
#9 0xc530674c in stat64+0xc52d4674 () from /usr/lib/dld.sl
#10 0xc1cf95d4 in raise+0x24 () from /usr/lib/libc.2
Cannot access memory at address 0xc5304f94


Since the recommendation to replace libcma with libpthread was in the 11i release notes, I expected this to work on 11i *generally*, not only on 11.31.

Did I overlook something?
Has anybody some hints or at least ideas how
to make the app run on the whole spectrum of
OS releases and processor architectures?
Normally HP-UX binaries have exactly that flexibility - something that impresses me very much! :-)

Thank you very much

Matthew
3 REPLIES 3
Dennis Handly
Acclaimed Contributor

Re: libcma vs. libpthread

>that under HP-UX 11i libcma is deprecated

This was true for 11.00.

>#0 0xc373ab58 in pthread_mutex_unlock+0x48 /usr/lib/libcma.2

What are the parms being passed to pthread_mutex_unlock? Is the mutex corrupted?
What version of libcma.2 do you have? Mine says PHSS_33426.

>#5 0xc1d75dd8 in pthread_mutexattr_init+0x58 /usr/lib/libc.2

This indicates you have linked your application incorrectly. You must have -lpthread and NOT list -lc at all!

>Did I overlook something?

You have to change the code to use libpthread vs libcm.

Re: libcma vs. libpthread

Thanks a lot for your reply.

Basically you're right with your assumption of wrong linkage.

The problem is solved now and the solution was to omit -lcma at all and *not* to replace it with -lpthreads.

-lcma was necessary for 10.20 only and is not needed any more for HP-UX 11i. Since we have no productive 10.20 machines any more, this solved our problem.

Now our transition to 11.31 seems to be completed :-) Thanks a lot again

Matthew

Re: libcma vs. libpthread

Thread closed, solution see above :-)

Matthew