public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
From: "jistone at redhat dot com" <sourceware-bugzilla@sourceware.org>
To: systemtap@sourceware.org
Subject: [Bug translator/17231] New: sysroot is too often prepended
Date: Tue, 05 Aug 2014 22:06:00 -0000	[thread overview]
Message-ID: <bug-17231-6586@http.sourceware.org/bugzilla/> (raw)

https://sourceware.org/bugzilla/show_bug.cgi?id=17231

            Bug ID: 17231
           Summary: sysroot is too often prepended
           Product: systemtap
           Version: unspecified
            Status: NEW
          Severity: normal
          Priority: P2
         Component: translator
          Assignee: systemtap at sourceware dot org
          Reporter: jistone at redhat dot com

# normal:
$ stap -l 'process("/bin/ls").function("main")' 
process("/usr/bin/ls").function("main")

# symroot identity:
$ ./stap -l 'process("/bin/ls").function("main")' --sysroot / 
process("/usr/bin/ls").function("main")

# add a trivial real symroot
$ sudo mount --bind / /mnt
$ ls -l /mnt/bin/ls
-rwxr-xr-x. 1 root root 121K Mar  5 05:09 /mnt/bin/ls
$ stap -l 'process("/bin/ls").function("main")' --sysroot /mnt --vp 02
semantic error: while resolving probe point: identifier 'process' at
<input>:1:7
   thrown from: ../elaborate.cxx:1061
        source: probe process("/bin/ls").function("main") {}
                      ^

semantic error: cannot find executable '/mnt//mnt//bin/ls'
   thrown from: ../tapsets.cxx:672


The sysroot is first prepended in dwarf_builder::build(), then again when
base_query::base_query() calls find_executable(), and then it fails when
is_fully_resolved() compares the path to yet another find_executable().  By
that time we have twice-prepended compared to thrice, which of course is not
equal.


It also fails when the filename has no path to start with, which ought to
search $PATH in the sysroot:

$ stap -l 'process("ls").function("main")' 
process("/usr/bin/ls").function("main")

$ stap -l 'process("ls").function("main")' --sysroot /mnt --vp 02
semantic error: while resolving probe point: identifier 'process' at
<input>:1:7
   thrown from: ../elaborate.cxx:1061
        source: probe process("ls").function("main") {}
                      ^

semantic error: cannot find executable '/mnt//mnt/ls'
   thrown from: ../tapsets.cxx:672

or even:
$ stap -l 'process("ls").function("main")' --sysroot / --vp 02
semantic error: while resolving probe point: identifier 'process' at
<input>:1:7
   thrown from: ../elaborate.cxx:1061
        source: probe process("ls").function("main") {}
                      ^

semantic error: cannot find executable '//ls'
   thrown from: ../tapsets.cxx:672

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

             reply	other threads:[~2014-08-05 22:06 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-05 22:06 jistone at redhat dot com [this message]
2014-08-05 22:06 ` [Bug translator/17231] " jistone at redhat dot com

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=bug-17231-6586@http.sourceware.org/bugzilla/ \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=systemtap@sourceware.org \
    /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).