Solved

Threads, Mutexes on HP-UX 11.00 always crash

Posted on 2004-10-20
4
212 Views
Last Modified: 2013-12-26
I am porting c++ code from Linux to HP-UX 11.00 (32-bit).  The problem that I'm having is that the program crashes (with a memory fault) whenever it tries to lock a mutex.   I am compiling with
the  -DPOSIX_C_SOURCE=199506L flag and also -D_POSIX_THREADS.  I am compiling with gcc 3.4.2 and the OS is HP-UX 11.00.  It has the latest QPK1100 loaded on it. Also, I've used ldd to make sure that the libraries are being loaded in the correct order.  The order that I get back is:

/usr/lib/libc.2 =>      /usr/lib/libc.2
/usr/lib/libdld.2 =>    /usr/lib/libdld.2
/usr/lib/libc.2 =>      /usr/lib/libc.2
/usr/lib/libm.2 =>      /usr/lib/libm.2
/usr/lib/libpthread.1 =>        /usr/lib/libpthread.1

I read somewhere that on 32 bit machines, the order is reversed, so that libpthread is actually getting brought in first and  not last.
0
Comment
Question by:mromeo
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 12

Accepted Solution

by:
stefan73 earned 500 total points
ID: 12360783
Hi mromeo,
> I read somewhere that on 32 bit machines, the order is reversed, so
> that libpthread is actually getting brought in first and  not last.
Not on Solaris. It's the same for V8 + V9:

> ldd mdd
        libpthread.so.1 =>       /usr/lib/64/libpthread.so.1
        libc.so.1 =>     /usr/lib/64/libc.so.1
        libdl.so.1 =>    /usr/lib/64/libdl.so.1
        libthread.so.1 =>        /usr/lib/64/libthread.so.1
        /usr/platform/SUNW,Sun-Fire-15000/lib/sparcv9/libc_psr.so.1

> ldd mdd32
        libpthread.so.1 =>       /usr/lib/libpthread.so.1
        libc.so.1 =>     /usr/lib/libc.so.1
        libdl.so.1 =>    /usr/lib/libdl.so.1
        libthread.so.1 =>        /usr/lib/libthread.so.1
        /usr/platform/SUNW,Sun-Fire-15000/lib/libc_psr.so.1

But I don't know if HPUX is per se having a different shlib load order.


Cheers!

Stefan
0
 

Author Comment

by:mromeo
ID: 12361310
Ok, but I'm on HP-UX.  Is it true for HP-UX?
0
 
LVL 12

Expert Comment

by:stefan73
ID: 12475331
Try it; use "ldd".

You can also use the "pmap" utility (assuming HPUX has the proctools installed) for a  running process.

Simply try
pmap $$
on your shell.
0
 

Author Comment

by:mromeo
ID: 12476145
I don't have pmap.  Where can I get it from?
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
If you use Adobe Reader X it is possible you can't open OLE PDF documents in the standard. The reason is the 'save box mode' in adobe reader X. Many people think the protected Mode of adobe reader x is only to stop the write access. But this fe…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question