Re: How to dump more info when received a SIGSEGV signal?



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.

--
.



Relevant Pages

  • Re: kernel_thread() usage found in staging
    ... I found the original posting via Google while trying to compile the openPOWERLINK protocol stack with a recent Linux kernel. ... there are some issues with the kthread-API and signals. ...
    (Linux-Kernel)
  • Re: 54mbit 80211g atheros w/obsd
    ... wireless access-point and have tried old and new versions of madwifi, hostapd, ... and the linux kernel, along with different configs and wireless settings and ... Is obsd's atheros drivers and hostap known to work well, give strong signals, ...
    (comp.unix.bsd.openbsd.misc)
  • Re: Linux Kernel bug report (includes fix)
    ... Glibc has its own exported set. ... >You should know that GLIBc is unrelated to the Linux kernel interfaces we are ... The kernel headers are _still_ not meant to be used by userspace, ... send the line "unsubscribe linux-kernel" in ...
    (Linux-Kernel)
  • Re: Linux Kernel bug report (includes fix)
    ... Glibc has its own exported set. ... > You should know that GLIBc is unrelated to the Linux kernel interfaces we are> talking about. ... headers in userspace programs has been deprecated for about six years. ... send the line "unsubscribe linux-kernel" in ...
    (Linux-Kernel)
  • Re: Kernel update to 2.6.x.x, do we need a glibc update?
    ... > currently we are running a 2.4.26 Linux kernel on an embedded PPC ... > machine and a corresponding glibc 2.2.5. ... > Or is the system call interface of the 2.6.x.x backwards compatible to ...
    (comp.os.linux.embedded)