Search code examples
gdbcoredump

Analyzing core dump generated by multiple applications with gdb


I have a core dump generated by 2 applications -> /usr/bin/python and /usr/bin/app1. I know the dump can be analyzed by

    gdb /path/to/app /path/to/core  

but is there a way to include both applications in the arguement?

I did try gdb '/usr/bin/python /usr/bin/app1' core.xxx but that doesnt seem right.

Any suggestions?


Solution

  • I think you cannot achieve what you want with a single invocation of gdb. But you could run gdb twice, in different terminal windows. I did that more than once, and it works quite well (except of course that your own brain could be slightly overloaded).

    a gdb process can debug only one single program, with one single debugged process or (for post mortem debug) one single core file.

    And a given core file is produced by abnormal termination of one single process (not several), so I don't understand your question.

    Apparently, you have a crash in some execution of python probably augmented by your faulty C code. I suggest having a debuggable variant of Python, perhaps by installing the python3-all-dbg package or something similar, then use gdb on it. Of course, compile your C code plugged into Python with debugging enabled. Perhaps you violated some invariant of the Python garbage collector.