How to find which thread caused SEGFAULT in a post

2019-02-02 06:16发布

问题:

In my application I handle SIGSEG to produce a backtrace and call abort() to generate a core dump.

If I now run a gdb-post-mortem analysis of the core, the thread which caused the SEGFAULT is no longer visible. Is there anything I can do so I see the cause for the SEGFAULT?

Best regards, Martin

回答1:

You can use command thread apply all bt or thread apply all bt full to get backtraces of all threads. Might be useful.

By the way if you get rid of you handler will your OS create a core file?



标签: c++ gdb sigsegv