Re: Address of instruction causing SIGSEGV

From: Jeroen N. Witmond (jnw_at_xs4all.nl)
Date: 08/25/04


Date: 25 Aug 2004 12:35:11 -0700

Ulrich Weigand <weigand@informatik.uni-erlangen.de> wrote in message news:<2p1o8eFflplfU1@uni-berlin.de>...
> jnw@xs4all.nl (Jeroen N. Witmond) writes:
>
> >- Is using an undeclared and undocumented parameter of the handler
> >(and a cast of the handler's address to sighandler_t to kill gcc's
> >warnings) the only way to access struct sigcontext?
>
> Yes. However, you could instead install your handler as SA_SIGINFO,
> in which case you'd get a (declared and documented) ucontext_t pointer
> as third argument, which holds a (platform-specific) mcontext_t element,
> which in turn also contains register information including eip.
>

Just for the record (and all other people running into the same
problem): with "static void siginfoAction(int sig, siginfo_t *siginfo,
void *context)" as declaration of the handler,
"(void*)((ucontext_t*)context)->uc_mcontext.gregs[REG_EIP]" is the
address of the instruction that causes the SIGSEGV, at least for
Linux/i386.

Jeroen.



Relevant Pages

  • Re: DelphiSpeedUP 1.69
    ... Actually you had the same problem, if you take a look at the declaration ... After install v1.69 under Delphi 7, When double click to create a form ... I click on an event in ObjectInspector, it gives me an error response ... handler. ...
    (borland.public.delphi.thirdpartytools.general)
  • Re: [PATCH] FRV: Use the generic IRQ stuff
    ... +static void frv_fpga_disable(unsigned int irq) ... Why do you have a endhandler? ... + * FPGA PIC interrupt handler ...
    (Linux-Kernel)
  • Re: Failed To Install Any Update From Web Only
    ... This error message may occur if you have insufficient permissions to the Windows Update registry keys. ... If I download the updates and install manually, ... Got error "80070005:wuauclt handler: failed to spawn COM server" from update log. ...
    (microsoft.public.windowsupdate)
  • Re: Very Odd Behavior - Using a form on Outlook 2003 AddIn
    ... I am using the setup project that VS 2005 builds for me to install the ... let them live for as long as Outlook is running? ... The goal of the addin is to provide the user that sends an email the ... and in the addin event handler code i put the following code: ...
    (microsoft.public.office.developer.com.add_ins)
  • RE: Auto-restarting Forms Applications
    ... aborts by attempting to restart the thread. ... //Application.Run(new Form1()); ... Console.WriteLineerror handler"); ... static void Application_ThreadException(object sender, ...
    (microsoft.public.dotnet.framework.windowsforms)