Re: signal.h



garfo2006@xxxxxxxxx <garfo2006@xxxxxxxxx> wrote:
With a SIGSEGV signal handler you can get some very usefull
information. You should register you handler with sigaction and the
SA_SIGINFO flag on. Then, your handler will be like

static void segv_handler(sig, sip, uap)
int sig;
struct siginfo *sip;
struct ucontext *uap;

Then, the address of the fault faulting memory reference will be
(siginfo.si_addr),

I tried exactly this but unfortunately the si_addr member of the
siginfo_t structure was always NULL (on i386). I have no idea why
and also didn't find an explanation...

Regards, Jens
--
\ Jens Thoms Toerring ___ jt@xxxxxxxxxxx
\__________________________ http://toerring.de
.



Relevant Pages

  • Re: [PATCH][RFC] kprobes: Add user entry-handler in kretprobes
    ... .handler = return_handler, ... Kprobes establishes a kprobe at ... +handler calls the user-specified return handler associated with the kretprobe, ... +field of the kretprobe struct. ...
    (Linux-Kernel)
  • Re: [PATCH][RFC] kprobes: Add user entry-handler in kretprobes
    ... .handler = return_handler, ... Kprobes establishes a kprobe at ... +handler calls the user-specified return handler associated with the kretprobe, ... +field of the kretprobe struct. ...
    (Linux-Kernel)
  • [2.6 patch] merge some from Rustys trivial patches
    ... This patch contains the most trivial from Rusty's trivial patches: ... Next, you must create a sysrq_key_op struct, and populate it with A) the key ... Your handler must conform to the protoype in 'sysrq.h'. ... + * the RAID driver will use the maximum available bandwidth if the IO ...
    (Linux-Kernel)
  • Re: Simple Event Framework - Suggestions?
    ... > Command pattern type class that is passed into the Event when registered, ... define a struct to provide handlers for all the ... Provide a virtual method in the Event class; ... of Thread handler; that way, the Handler methods don't need to be ...
    (comp.lang.cpp)
  • Re: [PATCH][RFC] kprobes: Add user entry-handler in kretprobes
    ... have m kretprobe "misses", we may report n calls but only returns. ... allocation should be left to user entry handlers, ... 'ri' can uniquely identify any entry-return handler ... No. Handlers shouldn't be writing to the pt_regs struct unless they ...
    (Linux-Kernel)