I want to be able to generate a core dump but not exit the process afterwards. I don't need it to continue execution, just not die. This is a C++ Ubuntu process.
I believe I'm dumping the core in a pretty standard way: I catch the offending signal via setting the signal handler with signal(), I set the core size limit via setrlimit() and then I prompt the core dump with signal() and raise():
signal(SIGSEGV, OnPosixSignal);
...
void OnPosixSignal(int iSignal)
{
struct rlimit CoreLimit;
CoreLimit.rlim_cur = RLIM_INFINITY;
CoreLimit.rlim_max = RLIM_INFINITY;
setrlimit(RLIMIT_CORE, &CoreLimit);
signal(iSignal, SIG_DFL);
raise(iSignal);
}
Is there something I can do to not have the process exit after dumping the core?
You can also do that using
gcore
: