Core dump not in sync with gdb stack trace-Collection of common programming errors
It is possible that you are simply looking at the wrong thread.
Try thread apply all where
, and see if one of the threads is in fact abort()
ing.
When debugging a live process, GDB will stop when a thread receives SIGABRT
, and so will likely show you the relevant thread.
When debugging a core (post-mortem), GDB doesn’t know which thread is relevant, and so shows them to you in whichever order the OS saved them into the core. Linux kernels save the thread which caused the process to die first, so GDB on Linux shows relevant thread from core. I am guessing that HP-UX does not do that, and so GDB shows you a “random” thread instead.