Solved

Threads, Mutexes on HP-UX 11.00 always crash

Posted on 2004-10-20
4
213 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

Want Experts Exchange at your fingertips?

With Experts Exchange’s latest app release, you can now experience our most recent features, updates, and the same community interface while on-the-go. Download our latest app release at the Android or Apple stores today!

Question has a verified solution.

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

Introduction: Finishing the grid – keyboard support for arrow keys to manoeuvre, entering the numbers.  The PreTranslateMessage function is to be used to intercept and respond to keyboard events. Continuing from the fourth article about sudoku. …
Introduction: Hints for the grid button.  Nested classes, templated collections.  Squash that darned bug! Continuing from the sixth article about sudoku.   Open the project in visual studio. First we will finish with the SUD_SETVALUE messa…
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.
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
Suggested Courses

627 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