Sample Header Ad - 728x90

Failed to core dump with send_sig(task, SIGSEGV, 1) from Linux kernel

1 vote
2 answers
66 views
I am working in an embedded Linux system, and now I want to trigger a core dump from within kernel by using send_sig(task, SIGSEGV, 1). There is a process A having 10 threads, occasionally, there is a kernel oops occurred and at that time, one thread of A is the current process reported by kernel. So I want to dump the core of the process A to find out what happened. So I did followings. 1. Enable core dump in kernel configuration. 2. Running ulimit -c unlimited in init script. 3. echo '/mnt/core.%p.%e' > /proc/sys/kernel/core_pattern. 4. Changed the kernel oops codes to call send_sig(task_A, SIGSEGV, 1) to send SIGSEGV to the process A. Then I tried to reproduce the kernel oops, and I found the log of Segmentation Fault from process A, but I did NOT see any core dumped in /mnt/. If I changed the process A to access 0 of address, it can trigger a core dump correctly. Why it failed to dump core from my kernel codes (the process A did is killed by SIGSEGV)? And how can I trigger a core-dump to capture the user space context in the case of kernel oops???
Asked by wangt13 (631 rep)
Dec 2, 2024, 11:38 AM
Last activity: Dec 4, 2024, 03:08 AM