Skip to contentSkip to conversation

2.2.x kernels not filling in siginfo_t.si_addr on SEGV?

DISCUSSION Camm Maguire 1 participant 1 message Mar 8, 2001

lore
Share & tools
lore
#0 lore raw

Greetings! Shouldn't a SIGSEGV fill in th si_addr member of the siginfo_t structure passed to a signal handler? Here is what I see (on several archs):
=============================================================================
q.c
=============================================================================
#include <stdio.h>
#include <signal.h>

void
nh(int s,siginfo_t *si,void *sc) {
printf("%p\n",si->si_addr);
exit(0);
}

int
main() {

  struct sigaction sa;
  char c[3];

  memset(&sa,0,sizeof(sa));
  sa.sa_sigaction=nh;
  sa.sa_flags=SA_RESTART|SA_SIGINFO;
  sigaction(SIGSEGV,&sa,0);
  c[4096]=0;

/* raise(SIGSEGV); */

return 0;

}
=============================================================================

camm@kullervo:~$ cc -g q.c -o q 
cc -g q.c -o q 
camm@kullervo:~$ ./q
./q
(nil)
=============================================================================
Take care,
Signature · 3 lines
Camm Maguire			     			[email protected]
==========================================================================
"The earth is but one country, and mankind its citizens."  --  Baha'u'llah