Re: How to dump more info when received a SIGSEGV signal?
- From: John Reiser <jreiser@xxxxxxxxxxxx>
- Date: Fri, 27 Jan 2006 07:35:29 -0800
Andrei Voropaev wrote:
> On 2006-01-27, cyril.li@xxxxxxxxx <cyril.li@xxxxxxxxx> wrote:
> [...]
>
>>The processor is IA32 and Linux kernel is 2.6
> Read man pages! :)
Usually a good source, but in this case not.
First, the charade performed by glibc confuses the issue.
The kernel<->user_mode interface is not the glibc<->C_user interface,
particularly with respect to signals. [BSD's 1024 signals are insane,
and glibc goes for the lowest common denominator.]
The linux kernel signal mask is exactly 64 bits, and is placed
at the end of the structure. The real kernel<->user_mode
interface is in:
-----
#include <asm/signal.h>
#include <asm/sigcontext.h>
#include <asm/ucontext.h>
#include <asm/siginfo.h>
-----
but you will have some difficulty because the linux kernel does not
export an ABI that is usable from C user code, and the typedefs are
sometimes conflicting.
Secondly, different versions of glibc have different versions of
the C user interface with respect to how they "package" the non-existent
kernel ABI for consumption by C users.
The technique I use is to declare linux signal handlers as:
handler(int signum, siginfo_t const *info, ucontext_t *uc)
then adjust the #includes (perhaps copy-and-paste into my own #include)
as necessary to get it to compile. Yes, it is work and is not portable,
but it is also what is required until the linux kernel has an official ABI.
--
.
- References:
- How to dump more info when received a SIGSEGV signal?
- From: cyril.li@xxxxxxxxx
- Re: How to dump more info when received a SIGSEGV signal?
- From: Andrei Voropaev
- How to dump more info when received a SIGSEGV signal?
- Prev by Date: Re: How to dump more info when received a SIGSEGV signal?
- Next by Date: Re: How to dump more info when received a SIGSEGV signal?
- Previous by thread: Re: How to dump more info when received a SIGSEGV signal?
- Next by thread: Re: How to dump more info when received a SIGSEGV signal?
- Index(es):
Relevant Pages
|