public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
From: "jistone at redhat dot com" <sourceware-bugzilla@sourceware.org>
To: systemtap@sources.redhat.com
Subject: [Bug runtime/10427] Multiple tracepoint OKs!
Date: Wed, 22 Jul 2009 18:05:00 -0000	[thread overview]
Message-ID: <20090722180449.8012.qmail@sourceware.org> (raw)
In-Reply-To: <20090722124254.10427.mjw@redhat.com>


------- Additional Comments From jistone at redhat dot com  2009-07-22 18:04 -------
(In reply to comment #2)
> O, I think I see what happens. Probably while we are doing the probe, printing
> the message and calling exit() some other tracepoint is hit, hits is already >
> 100 and so the probe gets triggered again. So this is probably just a testsuite
> bug. Although a slightly confusing one.

Yeah, there's an exit race condition.  The probe flow looks something like this:

1. If session_state != RUNNING, skip the probe
2. Lock the hits global
3. Increment hits
4. If hits >= 100, call exit() (which sets session_state = STOPPING)
5. Unlock hits

So 2-5 are atomic, but there is a chance that other cpus could have gotten past
#1 before exit() is called.

Reversing #1 and #2 would solve the race for this particular script, but
generally probe handlers may not have any mutual locks.  That's why we don't
make any guarantees that exit() will force any in-flight probes to skip.

Your fix looks fine.

-- 


http://sourceware.org/bugzilla/show_bug.cgi?id=10427

------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

      parent reply	other threads:[~2009-07-22 18:05 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-22 12:43 [Bug runtime/10427] New: " mjw at redhat dot com
2009-07-22 12:47 ` [Bug runtime/10427] " mjw at redhat dot com
2009-07-22 12:56 ` mjw at redhat dot com
2009-07-22 13:01 ` mjw at redhat dot com
2009-07-22 18:05 ` jistone at redhat dot com [this message]

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=20090722180449.8012.qmail@sourceware.org \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=systemtap@sources.redhat.com \
    /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 read-only IMAP folder(s) and NNTP newsgroup(s).