Re: i386 page fault clobbers error code in trap frame
- From: Tijl Coosemans <tijl@xxxxxxxxxxx>
- Date: Sun, 30 Jul 2006 18:34:11 +0200
On Saturday 29 July 2006 21:57, Kip Macy wrote:
Looking at siginfo it isn't clear that there is a "right way" to
provide SIGSEGV, eva, and the error code.
_fault._trapno should contain the machine's error code and si_signo
should contain SIGSEGV, and si_addr contains the faulting pc. Maybe
one could abuse si_code to contain eva. Sorry for asking a question
that has already been answered but where is eva being put currently?
si_addr doesn't contain the faulting pc, it contains the address that
caused the page fault (i.e. eva). pc at the time of the fault is stored
in the sigcontext as sc_eip.
But siginfo is ok. The problem is in sigcontext (mostly a copy of
trapframe), where sc_err is incorrect. However, it appears that all the
relevant code has changed significantly in CURRENT to the point that
the offending line can simply be removed. It would be nice if somebody
could review/verify/test this, because I don't have CURRENT installed
at the moment.
--- sys/i386/i386/trap.c.orig Sun Jul 30 18:27:21 2006
+++ sys/i386/i386/trap.c Sun Jul 30 18:27:56 2006
@@ -777,9 +777,6 @@
return (-1);
}
- /* kludge to pass faulting virtual address to sendsig */
- frame->tf_err = eva;
-
return((rv == KERN_PROTECTION_FAILURE) ? SIGBUS : SIGSEGV);
}
Attachment:
pgp7luAx0s1g1.pgp
Description: PGP signature
- Follow-Ups:
- Re: i386 page fault clobbers error code in trap frame
- From: Kip Macy
- Re: i386 page fault clobbers error code in trap frame
- References:
- i386 page fault clobbers error code in trap frame
- From: Tijl Coosemans
- Re: i386 page fault clobbers error code in trap frame
- From: Kip Macy
- i386 page fault clobbers error code in trap frame
- Prev by Date: Re: VM question related to faults
- Next by Date: Re: disklabel differences FreeBSD, DragonFly
- Previous by thread: Re: i386 page fault clobbers error code in trap frame
- Next by thread: Re: i386 page fault clobbers error code in trap frame
- Index(es):