9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: ron minnich <rminnich@gmail.com>
To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net>
Subject: [9fans] ratrace problem; debuggers welcome
Date: Sun, 13 Feb 2011 16:32:27 -0800	[thread overview]
Message-ID: <AANLkTikhV3ziTtMVwz2BtJ9h8EX76-5ZWaE6gKZJM_F7@mail.gmail.com> (raw)

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



             reply	other threads:[~2011-02-14  0:32 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-14  0:32 ron minnich [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=AANLkTikhV3ziTtMVwz2BtJ9h8EX76-5ZWaE6gKZJM_F7@mail.gmail.com \
    --to=rminnich@gmail.com \
    --cc=9fans@9fans.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).