* the fault address of a traced process
@ 2001-09-30 11:47 Bruce Janson
2001-10-01 0:53 ` Jeff Dike
0 siblings, 1 reply; 2+ messages in thread
From: Bruce Janson @ 2001-09-30 11:47 UTC (permalink / raw)
To: linux-kernel
One process traces another.
When the traced process tries to read, write or execute an unmapped
address it is stopped with a SIGSEGV signal.
The tracer now wants to determine the traced process' faulted address.
According to the (2.2.19) kernel source
.../arch/i386/mm/fault.c:do_page_fault()
such a fault in user mode causes the offending address and error code to
be saved in
tsk->tss.cr2
and
tsk->tss.error_code
respectively. There do not appear to be ptrace() or /proc hooks
to extract this data directly. In earlier unices extraction of this
data would have required grubbing around in /dev/kmem using the
kernel namelist as a guide.
How should a tracer extract this information under a current
(2.2.*, 2.4.*) Linux?
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: the fault address of a traced process
2001-09-30 11:47 the fault address of a traced process Bruce Janson
@ 2001-10-01 0:53 ` Jeff Dike
0 siblings, 0 replies; 2+ messages in thread
From: Jeff Dike @ 2001-10-01 0:53 UTC (permalink / raw)
To: Bruce Janson; +Cc: linux-kernel
bruce@cs.usyd.edu.au said:
> The tracer now wants to determine the traced process' faulted address.
> According to the (2.2.19) kernel source
[snip]
> How should a tracer extract this information under a current (2.2.*,
> 2.4.*) Linux?
Read some more UML source, specifically,
segv_handler() in arch/um/kernel/trap_user.c and also the i386 definitions
in arch/um/include/sysdep-i386/sigcontext.h
Basically, you are passed the necessary information in a sigcontext struct.
Jeff
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2001-09-30 23:35 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-09-30 11:47 the fault address of a traced process Bruce Janson
2001-10-01 0:53 ` Jeff Dike
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®