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

From: Camm Maguire (camm@enhanced.com)
Date: Thu Mar 08 2001 - 17:27:50 EST


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,

-- 
Camm Maguire			     			camm@enhanced.com
==========================================================================
"The earth is but one country, and mankind its citizens."  --  Baha'u'llah
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Thu Mar 15 2001 - 21:00:09 EST