On Wed, Dec 05, 2007 at 08:37:30PM -0800, John Reiser wrote:
> Thanks for the tip. I was getting stuck trying to figure out the
> ptrace() shenanigans involved with the stub [skas0 mode] that turns
> SIGSEGV into SIGUSR1. Valgrind has its own ideas about what
> should happen with signals, and the ptracing gets complicated.
I think if you just don't follow that clone, things will be better.
However, since you ask, what happens is this:
process (at startup, in userspace_tramp) sets the handler in
the stub as its SIGSEGV handler
process accesses memory that hasn't been mapped and segfaults
UML kernel sees SIGSEGV and allows it to be delivered
stub SIGSEGV handler reads page fault information out of its
sigcontext struct and puts it someplace the UML kernel can find
handler sends itself a SIGUSR1
SIGUSR1 is masked in this handler, so it's delivered right
after the sigreturn
UML kernel sees SIGUSR1 and knows the page fault data is
available
> The very first thing that the skas0 stub does is field SIGSEGV because
> the page which contains the entry point of the PT_INTERP of /sbin/init
> is not present.
Right, that's the first page fault.
> The signal handler in the stub forwards this SIGSGEV
> to uml as SIGUSR1, and the ptrace()ing code inside uml "understands"
> what the child is doing.
See above, it's not really describable as forwarding.
> Perhaps valgrind could recognize the
> skas0 stub (SIGSEGV.sa_handler >= 0xbffe0000, etc.) and adapt,
> or perhaps both valgrind and uml should cooperate here. I'm still
> puzzling over this one.
I would just let this clone escape - things should just work then.
Jeff
--
Work email - jdike at linux dot intel dot com
-------------------------------------------------------------------------
SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell. From the desktop to the data center, Linux is going
mainstream. Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4
_______________________________________________
User-mode-linux-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel