Solved

Threads, Mutexes on HP-UX 11.00 always crash

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Windows Drag & Drop Location 2 94
Generic progress indicator 6 113
lucky13 challenge 11 123
pre4 challenge 19 94
Introduction: Displaying information on the statusbar.   Continuing from the third article about sudoku.   Open the project in visual studio. Status bar – let’s display the timestamp there.  We need to get the timestamp from the document s…
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
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.

896 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now