Debugging threads with HP Wilde Beest
The following is a segment of the HP WDB output:
(gdb) set thread-check stack-util 101
Invalid value: stack utilization must be between 0 and 100.
(gdb) set thread-check stack-util 80
(gdb) run
Starting program: /home/gdb/enh_thr_stack_util
[Switching to thread 2 (system thread 39877)]
warning: Thread 2 exceeded stack utilization threshold of 80%.
0x800003ffeffcc608 in __rtc_pthread_dummy+0 () from ../librtc64.sl
This warning indicates that the thread attempts to exceed its stack utilization limit.
This may cause memory access violations, bus errors, or segmentation faults, if the
stack utilization reaches 100%.
TIP:
• Increase the stack allocation available to the thread when you create it
• Change the code running in the thread to reduce its use of stack space
Problem: The number of threads waiting on any pthread object exceeds the specified threshold
number.
This check identifies contention that results from too many threads attempting to
acquire the same lock object.
The set thread-check num-waiters [num] command checks if the number of
threads waiting on any pthread object exceeds the specified threshold number [num].
The debugger transfers the execution control to the user and displays a warning message
when this condition is detected.
A relatively large number of threads waiting on pthread synchronization object can
indicate a performance constraint on the application.
TIP: To avoid this condition:
• Check if any of the data object shared among the application threads can be accessed
using its own synchronization object.
• Check if the program has too many threads whose activity depends on concurrent
access to the contended mutex.
Thread-debugging in Batch mode
HP WDB 5.8 supports batch mode of debugging threads for HP-UX 11iv2 and later,
on Integrity systems and on HP-UX 11i v3 in PA-RISC systems for 64 bit applications.
The debugger provides a log file with the list of thread-related errors that occur in the
application.
Modes of Thread debugging in HP WDB 37