Re: Catch SIGSEGV from Linux kernel



On Feb 20, 2:30 pm, "F.Julien" <stops...@xxxxxxxxxxxx> wrote:

I'd like to catch all processes that end because of a segmentation fault. My
goal is to print a kernel log when a process exit in that case.
I did look into the kernel code and the only solution I found is to patch the
function "send_signal" (file kernel/signal.c).
I did also search on google an existing kernel patch but I only found a very
old patch for 2.2 kernel.
I'm surprised that nobody wants to monitor this (especially sysadmin). Maybe I
missed something and a solution is already available.
So, is it possible to catch process that SIGSEGV with the 2.6.X kernel ? I can
patch the kernel but I feel that a simplest solution already exist...
Any thought would me appreciated.

Please DO NOT DO THIS unless the application has not arranged to catch
and handle the signal! Deliberately creating and catching a SIGSEGV is
a perfectly legitimate (and sometimes extremely useful) programming
technique.

DS
.



Relevant Pages

  • Re: RT patch acceptance
    ... judge the complexity of a design for that type of system. ... claim that you cannot judge the complexity of a kernel modification. ... Since the patch in question doesn't actually need that information to ... nanokernel's API up to date with additions to Linux's API that RT people ...
    (Linux-Kernel)
  • Re: inline asm semantics: output constraint width smaller than input
    ... Now in this case the patch you suggest might end up hurting the end result ... The below patch is to build the kernel for x86_64, ... # Device Drivers ... # PCI IDE chipsets support ...
    (Linux-Kernel)
  • [RFC] Making percpu module variables have their own memory.
    ... Someone using the -rt patch found that one of the tracing options caused ... 64K for every CPU to cover all the per_cpu variables used in the kernel ... static void wakeup_softirqd_prio ...
    (Linux-Kernel)
  • Re: This is [Re:] How to improve the quality of the kernel[?].
    ... The -mm kernel already implements what your proposed PTS would do. ... If patch have no TS ID, ... Thus i can apply for example lguest patches and implement and test new ... How many open source projects use Bugzilla and how many use the Debian BTS? ...
    (Linux-Kernel)
  • Re: Documentation - how to apply patches for various trees
    ... >> explanation of the various kernel trees and how to apply their patches. ... +a patch to the kernel or, more specifically, what base kernel a patch for ... +and what new version the patch will change the source tree into. ...
    (Linux-Kernel)