Debugging threads with HP Wilde Beest
Common conditions or events in thread programming
The following are the most common conditions or events in thread programming that
could lead to errors:
1. The thread attempts to acquire a non-recursive mutex that it currently holds.
2. The thread attempts to unlock a mutex or a read-write lock that it has not acquired.
3. The thread waits on a mutex or a read-write lock that is held by a thread with a
different scheduling policy.
4. Different threads non-concurrently wait on the same condition variable, but with
different associated mutexes.
5. The thread terminates execution without unlocking the associated mutexes or
read-write locks.
6. The thread waits on a condition variable for which the associated mutex is not
locked.
7. The thread terminates execution, and the resources associated with the thread
continue to exist in the application because the thread has not been joined or
detached.
8. The thread uses more than the specified percentage of the stack allocated to the
thread.
9. The number of threads waiting on any pthread object exceeds the specified
threshold number.
HP Wildebeest Debugger (WDB) offers advanced thread debugging features to support
debugging of threaded applications and detection of these conditions.
Introducing the HP WDB Debugger
HP Wildebeest Debugger (WDB) is an HP-supported implementation of the open
source debugger GDB.
HP WDB enables you to debug threaded programs written in HP C and HP aC++ on
Itanium®-based systems running HP-UX 11i v2 or HP-UX 11i v3, and HP 9000 systems
running HP-UX 11i v2, or HP-UX 11i v3 operating systems.
The main features related to thread-debugging in HP WDB are as follows:
• Enable and disable a thread
• Enable and disable advanced thread-debugging feature
• Display the stack trace of the current thread
• View information on the state of pthread primitives such as mutexes, read-write
locks, and conditional variables
• Detect most thread-related conditions that are potential causes for errors in thread
programming, through advanced thread-debugging feature
• Debug threads interactively after you attach GDB to a process
12