Determining address which caused SEGV

From: Patrick J. LoPresti (patl@cag.lcs.mit.edu)
Date: Fri Jan 07 2000 - 16:52:58 EST


I am trying to write a signal handler for SEGV that can figure out
what address was being accessed to cause the fault. Yes, I have a
good reason for wanting this.

The man page for sigaction() implies that the attached program below
should print "si_addr = 0x20". But when I run it on Linux/x86 2.2.14,
it says the si_addr field is always NULL. As near as I can tell by
grepping the sources, only the m68k port even tries to set si_addr
appropriately when a memory fault occurs.

Two questions:

  1) Is there an easy way to do what I want on Linux/x86?
     (Disassembling the instruction which caused the fault does not
     qualify as "easy".)

  2) Can the kernel not set si_addr in the siginfo_t correctly?

 - Pat



-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sat Jan 15 2000 - 21:00:11 EST