i have a question: exists any system call for generate a core dump?
I know which a core dump could be generated by a signal, but i want know if it's possible generated from system call
Core dumps are triggered by the kernel in response to program crashes, and may be passed to a helper program (such as systemd-coredump) for further processing.
A core dump is a file that gets automatically generated by the Linux kernel after a program crashes. This file contains the memory, register values, and the call stack of an application at the point of crashing.
Core dumps can be used to capture data freed during dynamic memory allocation and may thus be used to retrieve information from a program that is no longer running. In the absence of an interactive debugger, the core dump may be used by an assiduous programmer to determine the error from direct examination.
void createdump(void)
{
if(!fork()) { //child process
// Crash the app
abort() || (*((void*)0) = 42);
}
}
What ever place you wan't to dump call the function. This will create a child and crash it. So you can get dump even without exiting your program
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With