Re: vfork

Jeff Dike (jdike@karaya.com)
Wed, 10 Nov 1999 17:34:27 -0500


> > Sounds like the correct fix is not vfork()-related at all, but rather
> > a flag to clone() to set "trace child process", so that the new child
> > starts out stopped and traced.
> That would be nice. However, there is a workaround. You change fork
> (or vfork) to a clone which starts off on a trampoline, which stops
> itself and allows strace to get the pid and ptrace it.

Sorry to follow up my own post, but I misspoke here. I do have this problem
solved, but not in a way that strace would find useful.

The user-mode port has enough control over its processes that it can simulate
a fork. So, what the tracer does is null out the fork, call clone itself, and
impose the proper state on the new child.

This works because tracer and tracee are in the same address space, and
obviously doesn't cut it for strace.

Jeff

-
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/