gpt4 book ai didi

coredump - 哪个组件实际上转储核心?

转载 作者:行者123 更新时间:2023-12-02 15:20:15 28 4
gpt4 key购买 nike

我不确定这是否是 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)
{
...

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);

关于coredump - 哪个组件实际上转储核心?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1861727/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com