Jim
Jim

Reputation: 111

Linux Core Dump Without Killing Process

Is it possible to generate a core dump without killing the process? If so, what is the command/signal to do so?

Thanks, Jim

Upvotes: 11

Views: 11940

Answers (3)

Jérôme Pouiller
Jérôme Pouiller

Reputation: 10197

A method to generate a coredump directly from program without gdb is described here: https://unix.stackexchange.com/questions/11185/dump-process-core-without-killing-the-process

It make sense only if you are developing. Principle is to fork program and to raise SIGABRT from child.

Upvotes: 0

bluepin
bluepin

Reputation: 82

I had the best success with attaching gdb in batch mode to the running program, get a backtrace and then detach.

gdb --batch --quiet -ex "set pagination off" -ex "thread apply all bt"
-ex "detach" -ex "quit" pid pid_of_process

Upvotes: 3

janneb
janneb

Reputation: 37188

See the 'gcore' command, part of GDB.

Upvotes: 13

Related Questions