I don't know the precise details but this is a known shortcoming in
2.2.x - this has been fixed for most platforms in 2.3.x.
Mohammad Banikazemi wrote:
> I am trying to write a handler for SIGSEGV.
> My handler is of the following form:
> void segv_handler(sig, scs)
> int sig;
> struct sigcontext_struct scs;
> I expect to find the virtual address which caused the SIGSEGV
> in scs.cr2 and based on that my handler is supposed to take an action.
> However, in *some* of my programs, this field of scs doesn't contain
> the correct virtual address. Inside my segv_handler routine, I print the
> contents of different fields of scs. I have noticed that the virtual
> is sometimes in one of the following fields: scs.esp_at_signal and
> The linux kernel version is 2.2.5.
> Does anyone know what is going on?
> Any help is greatly appreciated.
> P.S. I posted the same question in comp.os.linux.development.apps and
> one suggested that I use a handler of the following form
> void segv_handler(iSig, pSigInfo, pContext)
> int iSig;
> struct siginfo *pSigInfo;
> void *pContext;
> segv_address = pSigInfo->si_addr;
> I assume that I have to set the sa_flags to SA_SIGINFO when I set my
> segv_handler to be the segv handler by using the sigaction call. I have
> done this
> but the address I find in pSigInfo->si_addr is incorrect. I am pretty
> about the address which causes the execution of my segv_handler.
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to email@example.com
> Please read the FAQ at http://www.tux.org/lkml/
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to firstname.lastname@example.org
Please read the FAQ at http://www.tux.org/lkml/
This archive was generated by hypermail 2b29 : Wed Jun 07 2000 - 21:00:11 EST