1

I wanted to see the source code of the default handler of SIGABRT in Linux C, But I couldn't find it. Would you please mind help to find it?

  • in Linux C? You mean Linux kernel signals handler? – Oleksandr Kravchuk Nov 09 '16 at 13:52
  • There isn't a default signal handler at the user-level for SIGABRT (or any other signal, come to that). The default behaviour for SIGABRT is to terminate with a core dump; that is all handled by the kernel, not by user-level code. – Jonathan Leffler Nov 09 '16 at 14:26

1 Answers1

1

http://lxr.free-electrons.com is a great way to read the linux kernel's source.

Doing a quick search for SIGABRT shows that it is used only by the SIG_KERNEL_COREDUMP_MASK macro. This macro is in turn used exclusively by sig_kernel_coredump.

Tracing the usage of this macro leads us to the place where the signal handlers are executed in kernel/signal.c:2301.

This corresponds to what the man pages tell us, i.e. the default action for SIGABRT is to terminate the process and dump the program core memory.

xslr
  • 350
  • 5
  • 12