Bug 11089 - process.mark() probes with same name trigger wrongly
Summary: process.mark() probes with same name trigger wrongly
Status: RESOLVED FIXED
Alias: None
Product: systemtap
Classification: Unclassified
Component: translator (show other bugs)
Version: unspecified
: P2 normal
Target Milestone: ---
Assignee: Stan Cox
URL:
Keywords:
Depends on:
Blocks: blockers-1.1
  Show dependency treegraph
 
Reported: 2009-12-14 12:30 UTC by Mark Wielaard
Modified: 2009-12-16 03:23 UTC (History)
0 users

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


Attachments
.probes for 4.4.1 and 4.4.2 (570 bytes, text/plain)
2009-12-15 17:17 UTC, Stan Cox
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Mark Wielaard 2009-12-14 12:30:44 UTC
When a process.mark() probe is in the .probes section multiple times with
different addresses it looks like only one address is being triggered for a
probe on the mark() for that name (and it is triggered multiple times for that
one address).

One example is the cxxclass.exp test on i386:

> $ stap ./systemtap.base/cxxclass.stp cxxclass.exe -c ./cxxclass.exe
> main_enter
> call: 64
> cons call: 64
> cons call: 64
> meth call: 64 24
> meth call: 64 24
> dest call: 42
> dest call: 42
> call2: 24
> main_exit
> 
> Seems there is double call on process.mark.

The issue seems to be that some of the static probe points get
duplicated in the code. This shouldn't be a problem, and the .probes
section does contain both places with different addresses. You can also
see (with enough -vvvvv) that stap finds both locations while resolving
the mark("cons") probe. But, only the first is registered twice, as can
be seen in the generated code:

  { .address=(unsigned
long)0x8048476ULL,
.pp="process(\"/home/mark/src/systemtap/testsuite/cxxclass.exe\").statement(134513782)",
.ph=&probe_1895, },
  { .address=(unsigned
long)0x8048476ULL,
.pp="process(\"/home/mark/src/systemtap/testsuite/cxxclass.exe\").statement(134513782)",
.ph=&probe_1895, },

This means the first call of the constructor is triggered as probe twice
(as is the method, and destructor call) but the second call isn't
triggered as probe at all.

It looks like this is a problem in how sdt_query::convert_location() is
called (it seems to do duplication detection based on probe name, but
not address. I haven't looked very deeply into it yet though.
Comment 1 Mark Wielaard 2009-12-14 13:59:03 UTC
Seeing the same issue on x86_64 btw, so it isn't i386 specific.
GCC: 4.4.2 [gcc (GCC) 4.4.2 20091027 (Red Hat 4.4.2-7)]
Comment 2 Stan Cox 2009-12-15 16:18:44 UTC
This is because g++ 4.4.2 is now laying out the .probes section differently.
Comment 3 Stan Cox 2009-12-15 17:17:43 UTC
Created attachment 4469 [details]
.probes for 4.4.1 and 4.4.2
Comment 4 Stan Cox 2009-12-16 03:23:58 UTC
commit 39a3e39706

A component was being reused instead of recreated.  (Oddly enough this works
okay with an older version of stap I have hanging around.