Languages and Scripting
Showing results for 
Search instead for 
Did you mean: 

HP-UX 11.23 / Itanium â Hang issues

Go to solution
Occasional Contributor

HP-UX 11.23 / Itanium â Hang issues

I am doing a port from HP-UX 11.11 on PA-RISC to HPUX 11.23 on IA64 of complex applications.
The compilation/link have been done without any problem. Iâ m doing now the first runtime tests.
With the help of the HP Networking team, we have managed to solve a first hang issue. It apparently seems that all our binaries/libraries needs to be built with -DPTHREAD_COMPAT_MODE flag. I'm asking what this flag is for? Does someone know the meaning and the impact of this compilation option? Are there some other compilation options to use?

Then with this option, the first hangs have been solved but some others appear. Are there some known runtime issues on HP-UX 11.23 on Itanium due for example to more restrictions in the lock mechanism in multi-threaded applications?

Thanks in advance for any help

Trusted Contributor

Re: HP-UX 11.23 / Itanium â Hang issues


The DPTHREAD_COMPAT_MODE flag is for compiling the threads application in the Compatibality mode and not MxN threads model.

Probaly you may want to compile with -DREENTRANT option.

Honored Contributor

Re: HP-UX 11.23 / Itanium â Hang issues


Before 11.22 version,thread applications with DPTHREAD_COMPAT_MODE flag uses the 1 x 1 threads. From that it is changed to use M x N threads.

So threads application with DPTHREAD_COMPAT_MODE flag after 11.22 is initiates the pthread_attr_init(3T) call to initiate the M x N threads (PTHREAD_SCOPE_PROCESS).

You can knew this change with the pthread_attr_init man page with the 11.22 version and previous versions.

On 11.23,if you want to use the same application as like as in 11.11, don't use the DPTHREAD_COMPAT_MODE flag.

There is a memory leak / corruption problem in library on 11.23 version.
Check this out,

Easy to suggest when don't know about the problem!
Honored Contributor

Re: HP-UX 11.23 / Itanium â Hang issues

The -DPTHREAD_COMPAT_MODE setting is equivalent to starting threads with an attribute that was set to PTHREAD_SCOPE_SYSTEM with a call to pthread_attr_setscope(). The default had always been PTHREAD_SCOPE_PROCESS, but that had not actually been implemented until 11.23. With code recompiled on 11.23 the default will actually result in user-space threads that migrate amoung a pool of kernel threads. Some drivers may have trouble with the migration of user space threads between kernel threads.

The topic that Muthukumar pointed you to was a discussion regarding a pre-release of 11.23 on PA-RISC rather than the IPF release.

Application hangs of multithreaded processes are often very difficult to diagnose. They may be caused by synchronization defects that were always in an application, but which never showed a problem until some change in scheduling.

You could have a look at the 'visual threads' tool for more insight into hangs. You can download it from