Reputation: 40140
For purposes of my own, I would like to take a regular core dump of my running application - from within the applciation - but continue running the program.
How can I do so? The app has a single process, with multiple threads.
Google core dump looked promising, but is no longer supported. Is there another way?
Upvotes: 2
Views: 977
Reputation: 410
You can use GDB
Let say I am running an app call matrix (a simple ncurses sample app that emulates the words flow).
I can obtain the process id by using pgrep and pass to gcore like this:
gcore `pgrep matrix`
The core file you obtain will be core.pid format like this:
core.6129
http://linux.byexamples.com/archives/371/gcore-obtain-core-dump-of-current-running-application/
Upvotes: 0
Reputation: 182753
Call fork
and then dump core in the fork
ed process. This has one significant disadvantage -- you can't see the stacks of threads other than the one that called fork
.
Upvotes: 1