I have a program that has been stopped on kill -STOP. I want to take a basic dump without starting it (the program must be stopped for the whole time, if it receives SIGCONT, it will die without a coredump). How can i get coredump?
Is it possible to keep the program in its current state after taking coredump? This is a very rare situation, and I cannot reproduce it, but I must analyze it.
thank
UPDATES: gcore does not work. Gdb (even root) cannot connect to a stopped process (waiting for ptrace PTRACE_ATTACH forever). Even dd cannot read from / proc / 99999 / mem with good offsets from / proc / 99999 / maps (error No such process).
If I try to connect gdb to process and send SIGCONT to stop the process, I got
path... linux-nat.c:####: internal-error: linux_nat_attach: Assertion `pid == GET_PID (inferior_ptid) && WIFSTOPPED (status) && WSTOPSIG (status) == SIGSTOP' failed.
A problem internal to GDB has been detected,
further debugging may prove unreliable.
A problem internal to GDB has been detected,
further debugging may prove unreliable.
If I go to gdb and save the kernel, it will be corrupted. Msgstr "Error reading valid image of object file from memory."
source
share