9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] ratrace problem; debuggers welcome
@ 2011-02-14  0:32 ron minnich
  2011-02-14  3:50 ` erik quanstrom
  0 siblings, 1 reply; 6+ messages in thread
From: ron minnich @ 2011-02-14  0:32 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

there's a race in ratrace: programs can escape. The reason is that the
parent forks a child and writes stop to its ctl file. But the child
can run any number of system calls -- even to completion -- before the
parent writes that stop command. I'm seeing this on arm.

The fix is simple, in the child, write "hang" to proc/getpid()/ctl.

Simple, right? Well, not so simple.

In the old ratrace, I can (e.g.)
ratrace -c /bin/rc
and I will trace all the rcs and their kids, foever and ever.

In the ratrace with the child process writing hang to its own ctl,
eventually, ratrace goes away. Not Broken, just gone, and the
symptom is that the first command in the traced rc is traced, but no
further commands are.

Anyway, if somebody is up for debugging fun, I can send you the
modified ratrace and you can see what I might have gotten wrong.

thanks

ron



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2011-02-14 12:48 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-02-14  0:32 [9fans] ratrace problem; debuggers welcome ron minnich
2011-02-14  3:50 ` erik quanstrom
2011-02-14  4:40   ` ron minnich
2011-02-14  6:03     ` erik quanstrom
2011-02-14 12:45       ` [9fans] Formats %H, $<, %[ (Was re. ratrace problem; debuggers welcome) Joel C. Salomon
2011-02-14 12:48         ` erik quanstrom

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).