public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
* [Bug translator/14369] New: Markers with $vars are reported "not found" when missing debuginfo
@ 2012-07-18  2:52 jistone at redhat dot com
  2012-07-18  7:21 ` [Bug translator/14369] " mjw at redhat dot com
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: jistone at redhat dot com @ 2012-07-18  2:52 UTC (permalink / raw)
  To: systemtap

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

             Bug #: 14369
           Summary: Markers with $vars are reported "not found" when
                    missing debuginfo
           Product: systemtap
           Version: unspecified
            Status: NEW
          Severity: normal
          Priority: P2
         Component: translator
        AssignedTo: systemtap@sourceware.org
        ReportedBy: jistone@redhat.com
    Classification: Unclassified


This is related to: https://bugzilla.redhat.com/show_bug.cgi?id=841057

As noted there: When we locate an SDT marker, stap takes different paths
depending on the presence of $vars in the handler.  Without any $var, we just
build the probe directly, and life is good.  With a $var, we decide we need
debuginfo, and so that goes down the query_addr path.

Now, if there's anything wrong with the debuginfo, then we end up throwing up
entirely with "semantic error: no match".  An unreachable $var is a problem,
sure, but we should use the right error.  And this also means that @defined()
can't work around this issue.

It doesn't even have to be corrupt debuginfo, as rhbz841057.  Even our sdt_asm
test binary can show this, when you don't have DWARF in part of a file.

First, with no DWARF at all:
> $ gcc ../testsuite/systemtap.base/sdt_asm.S -o sdt_asm.x
> $ ./run-stap -e 'probe process("./sdt_asm.x").mark("*") { println($foo) }' -p2 
> WARNING: cannot find module /home/jistone/systemtap/build/sdt_asm.x debuginfo: No DWARF information found
> semantic error: while resolving probe point: identifier 'process' at <input>:1:7
>         source: probe process("./sdt_asm.x").mark("*") { println($foo) }
>                       ^
> 
> semantic error: no match
> Pass 2: analysis failed.  Try again with another '--vp 01' option.

With some DWARF added (but nothing meaningful near asm probes):
> $ gcc ../testsuite/systemtap.base/sdt_asm.S -o sdt_asm.x -g
> $ ./run-stap -e 'probe process("./sdt_asm.x").mark("*") { println($foo) }' -p2 
> semantic error: while resolving probe point: identifier 'process' at <input>:1:7
>         source: probe process("./sdt_asm.x").mark("*") { println($foo) }
>                       ^
> 
> semantic error: no match
> Pass 2: analysis failed.  Try again with another '--vp 01' option.

And just to sanity check that the probe points do exist:
> $ ./run-stap -e 'probe process("./sdt_asm.x").mark("*") { println(1) }' -p2 
> # probes
> process("/home/jistone/systemtap/build/sdt_asm.x").statement(0x4004ab) /* pc=.absolute+0x4ab */ /* <- process("./sdt_asm.x").mark("memory") = process("./sdt_asm.x").statement(0x4004ab) <- process("./sdt_asm.x").mark("*") */
> process("/home/jistone/systemtap/build/sdt_asm.x").statement(0x4004b1) /* pc=.absolute+0x4b1 */ /* <- process("./sdt_asm.x").mark("a") = process("./sdt_asm.x").statement(0x4004b1) <- process("./sdt_asm.x").mark("*") */
[...]

We ought to fall back on this direct method when the query_addr path fails, and
then the $foo can fail later (if it even survives optimization).

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug translator/14369] Markers with $vars are reported "not found" when missing debuginfo
  2012-07-18  2:52 [Bug translator/14369] New: Markers with $vars are reported "not found" when missing debuginfo jistone at redhat dot com
@ 2012-07-18  7:21 ` mjw at redhat dot com
  2012-07-18 22:22 ` jistone at redhat dot com
  2012-08-18  1:53 ` jistone at redhat dot com
  2 siblings, 0 replies; 4+ messages in thread
From: mjw at redhat dot com @ 2012-07-18  7:21 UTC (permalink / raw)
  To: systemtap

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

Mark Wielaard <mjw at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |mjw at redhat dot com

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug translator/14369] Markers with $vars are reported "not found" when missing debuginfo
  2012-07-18  2:52 [Bug translator/14369] New: Markers with $vars are reported "not found" when missing debuginfo jistone at redhat dot com
  2012-07-18  7:21 ` [Bug translator/14369] " mjw at redhat dot com
@ 2012-07-18 22:22 ` jistone at redhat dot com
  2012-08-18  1:53 ` jistone at redhat dot com
  2 siblings, 0 replies; 4+ messages in thread
From: jistone at redhat dot com @ 2012-07-18 22:22 UTC (permalink / raw)
  To: systemtap

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

Josh Stone <jistone at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |WAITING

--- Comment #1 from Josh Stone <jistone at redhat dot com> 2012-07-18 22:21:47 UTC ---
(In reply to comment #0)
> We ought to fall back on this direct method when the query_addr path fails, and
> then the $foo can fail later (if it even survives optimization).

commit 73d53dd2213ce54a72db9b3bd029eb1f39760656

With this, we now get:

> $ gcc ../testsuite/systemtap.base/sdt_asm.S -o sdt_asm.x 
> $ ./run-stap -e 'probe process("./sdt_asm.x").mark("*") { println($foo) }' -p2
> WARNING: cannot find module /home/jistone/systemtap/build/sdt_asm.x debuginfo: No DWARF information found
> semantic error: target-symbol requires debuginfo: identifier '$foo' at <input>:1:50
>         source: probe process("./sdt_asm.x").mark("*") { println($foo) }
>                                                                  ^
> 
> Pass 2: analysis failed.  Try again with another '--vp 01' option.

> $ gcc ../testsuite/systemtap.base/sdt_asm.S -o sdt_asm.x -g
> $ ./run-stap -e 'probe process("./sdt_asm.x").mark("*") { println($foo) }' -p2
> semantic error: target-symbol requires debuginfo: identifier '$foo' at <input>:1:50
>         source: probe process("./sdt_asm.x").mark("*") { println($foo) }
>                                                                  ^
> 
> Pass 2: analysis failed.  Try again with another '--vp 01' option.

> $ ./run-stap -e 'probe process("./sdt_asm.x").mark("*") { println(@defined($foo)) }' -p2
> # probes
> process("/home/jistone/systemtap/build/sdt_asm.x").statement(0x4004ab) /* pc=.absolute+0x4ab */ /* <- process("./sdt_asm.x").mark("memory") = process("./sdt_asm.x").statement(0x4004ab) <- process("./sdt_asm.x").mark("*") */
> process("/home/jistone/systemtap/build/sdt_asm.x").statement(0x4004b1) /* pc=.absolute+0x4b1 */ /* <- process("./sdt_asm.x").mark("a") = process("./sdt_asm.x").statement(0x4004b1) <- process("./sdt_asm.x").mark("*") */


I'm not entirely thrilled with how the new error gets chained though, when full
debuginfo is present:

> $ ./run-stap -e 'probe process("./stap").mark("*") { println($foo) }' -p2
> semantic error: unable to find local 'foo' near pc 0x41140f in cleanup ../main.cxx ( (alternatives: $s $rc): identifier '$foo' at <input>:1:45
>         source: probe process("./stap").mark("*") { println($foo) }
>                                                             ^
> 
> semantic error: target-symbol requires debuginfo: identifier '$foo' at :1:45
>         source: probe process("./stap").mark("*") { println($foo) }
>                                                             ^
> 
> Pass 2: analysis failed.  Try again with another '--vp 01' option.

Ideas on how to improve that are welcome...

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug translator/14369] Markers with $vars are reported "not found" when missing debuginfo
  2012-07-18  2:52 [Bug translator/14369] New: Markers with $vars are reported "not found" when missing debuginfo jistone at redhat dot com
  2012-07-18  7:21 ` [Bug translator/14369] " mjw at redhat dot com
  2012-07-18 22:22 ` jistone at redhat dot com
@ 2012-08-18  1:53 ` jistone at redhat dot com
  2 siblings, 0 replies; 4+ messages in thread
From: jistone at redhat dot com @ 2012-08-18  1:53 UTC (permalink / raw)
  To: systemtap

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

Josh Stone <jistone at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|WAITING                     |RESOLVED
         Resolution|                            |FIXED

--- Comment #2 from Josh Stone <jistone at redhat dot com> 2012-08-18 01:53:04 UTC ---
(In reply to comment #1)
> I'm not entirely thrilled with how the new error gets chained though, when full
> debuginfo is present: [...] Ideas on how to improve that are welcome...

fche declared it Good Enough, so I'm closing this bug.

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2012-08-18  1:53 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-07-18  2:52 [Bug translator/14369] New: Markers with $vars are reported "not found" when missing debuginfo jistone at redhat dot com
2012-07-18  7:21 ` [Bug translator/14369] " mjw at redhat dot com
2012-07-18 22:22 ` jistone at redhat dot com
2012-08-18  1:53 ` jistone at redhat dot com

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).