Bug 10655 - SDT semaphores should be prepared for multiple tasks per probe
Summary: SDT semaphores should be prepared for multiple tasks per probe
Status: RESOLVED FIXED
Alias: None
Product: systemtap
Classification: Unclassified
Component: tapsets (show other bugs)
Version: unspecified
: P2 critical
Target Milestone: ---
Assignee: Stan Cox
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-09-18 02:49 UTC by Josh Stone
Modified: 2016-05-24 19:06 UTC (History)
0 users

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Josh Stone 2009-09-18 02:49:16 UTC
We shouldn't be keeping a tsk field in stap_uprobe_spec or stap_utrace_probe,
because each of those may get many tasks associated with them.  The XXX comments
added in commit a9b59347 show the places where this is happening.  Instead, we
should be poking the semaphores when we are detaching from each task at the end
of the script.  I think task finder may need to be expanded to give the right
callbacks here.

Task death is also a consideration, though it won't matter whether the semaphore
is adjusted in that case.  We just need to make sure we don't try to adjust the
semaphore *after* death, when the memory doesn't exist anymore.
Comment 1 Frank Ch. Eigler 2009-09-18 19:29:04 UTC
This is critical, since the current code includes statements that
modify const static data (struct stap_uprobe_specs[]; the new ->tgt
field).  This is successfully blocked on some machines (my 4cpu
kvm VM on a xeon5150 pair being one of them), resulting in panic's.
So it has to be fixed.

There may be other such bugs that for some reason are only caught
on a peculiar simulator environment.  Others should check whether
they have NX-capable hardware and kvm, as that seems to be a factor.
Comment 2 Frank Ch. Eigler 2009-09-18 20:39:45 UTC
http://lwn.net/Articles/338015/
Comment 3 Frank Ch. Eigler 2009-09-19 01:44:38 UTC
coommit 8faa1fc fixes the uprobes variant; tapset-utrace.cxx needs
similar treatment (though is not as critical since it's not causing
kernel crashes).
Comment 4 Josh Stone 2010-03-31 00:39:49 UTC
SDT on utrace has been removed (commit bbafcb1e), but now we have the same
problem with SDT semaphores on kprobes (commit b642c901).
Comment 5 Josh Stone 2016-05-24 19:06:49 UTC
The kprobe side was removed a while ago, in commit 08b5a50cd667.  We should be fine with the remaining uprobes implementation, per comment #3.  Closing!