Bug 6912 - uretprobes support for longjmp/exceptions
Summary: uretprobes support for longjmp/exceptions
Status: RESOLVED DUPLICATE of bug 5274
Alias: None
Product: systemtap
Classification: Unclassified
Component: uprobes (show other bugs)
Version: unspecified
: P2 normal
Target Milestone: ---
Assignee: Unassigned
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-09-23 02:49 UTC by Frank Ch. Eigler
Modified: 2008-09-23 17:49 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 Frank Ch. Eigler 2008-09-23 02:49:17 UTC
uretprobes probably needs to learn how to deal with userspace
longjmp and c++ exceptions, at least to the extent of letting
simple tracing scripts produce reasonable output.

# stap para-callgraph.stp 'process("...").function("...")'

is a simple way of tracing function entry/exit pairs, but when
functions return abnormally, we lose notifications and the
nesting loses its balance.

One possibility is to have a hack that is similar to emulated-alloca,
where if the system notices that a new breakpoint is being hit in a
thread that has known uretprobes outstanding, it can check whether
the stack pointer at those pending ureprobes is deeper than the current
hit.  If so, the system can infer that the returns were skipped over,
and ought to be emulated / cleaned up.

uretprobes could fire synthetically at such a time (with pt_regs = NULL
to indicate that we never had current registers).  At least, the uretprobes
instances need to be freed to avoid memory leaks.

Alternately, it may be possible to work around missed uretprobes at the
script level by doing the SP value-based heuristic with a bunch more
systemtap script code.  But this would not help with the possible memory
leak issue above.
Comment 1 Jim Keniston 2008-09-23 17:49:29 UTC

*** This bug has been marked as a duplicate of 5274 ***