I am writing an application for a system with a very limited RAM value. Since the application crash is always possible, and it uses dynamic memory allocation, I created callbacks for all possible ways the application can stop and clear all buffers there, for example:
sigaddset ( &sigact.sa_mask, SIGSEGV );
sigaction ( SIGSEGV, &sigact, ( struct sigaction* ) NULL );
It triggers some notifications and tries to restart itself several times. But still I want to know what caused the crash, so I need crashdump. GDB is not suitable for such a small system, and only a core core dump is possible. But since the application intercepted such a signal and after all exits by itself, the kernel does not receive a signal - the kernel has not been created.
I can not give out
kill(getpid(), kernel_signal);
How this leads to recursion - this signal is also intercepted. Is it even possible in such a situation?
source
share