Solved

Threads, Mutexes on HP-UX 11.00 always crash

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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
repeateFront java challenge 31 93
Pressing cancel button with C# UI Automation 3 70
format the code in java 6 93
Problem to open Excel file 15 133
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…
Introduction: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
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.
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.

777 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