Solved

Threads, Mutexes on HP-UX 11.00 always crash

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

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…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
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.
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

747 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