我不确定这是C库还是其他将内容转储到核心文件并使程序退出的东西.我的意思是glibc或libc处理SIGSEGV并在处理函数中创建核心转储?请解释.
在linux中,内核进程执行和信号处理机制是负责任的.
http://lxr.linux.no/#linux+v2.6.32/fs/exec.c#L1752
void do_coredump(long signr, int exit_code, struct pt_regs *regs)
{
...
Run Code Online (Sandbox Code Playgroud)
http://lxr.linux.no/#linux+v2.6.32/kernel/signal.c#L1926
if (sig_kernel_coredump(signr)) {
if (print_fatal_signals)
print_fatal_signal(regs, info->si_signo);
/*
* If it was able to dump core, this kills all
* other threads in the group and synchronizes with
* their demise. If we lost the race with another
* thread getting here, it set group_exit_code
* first and our do_group_exit call below will use
* that value and ignore the one we pass it.
*/
do_coredump(info->si_signo, info->si_signo, regs);
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
1472 次 |
| 最近记录: |