public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
From: "agentzh at gmail dot com" <sourceware-bugzilla@sourceware.org>
To: systemtap@sourceware.org
Subject: [Bug runtime/24935] New: Reading userland static data always leads to read faults on Fedora 29 x86_64
Date: Sat, 24 Aug 2019 01:13:00 -0000	[thread overview]
Message-ID: <bug-24935-6586@http.sourceware.org/bugzilla/> (raw)

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

            Bug ID: 24935
           Summary: Reading userland static data always leads to read
                    faults on Fedora 29 x86_64
           Product: systemtap
           Version: unspecified
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: runtime
          Assignee: systemtap at sourceware dot org
          Reporter: agentzh at gmail dot com
  Target Milestone: ---

I've noted that reading userland C static data always fails with read faults
(-14) on Fedora 29 x86_64. Below is a minimal example that can demonstrate this
issue:

File test.c:

    static const char *s = "hi";

    int main(void) {
        return 0;
    }

File test.stp:

    probe process.function("main") {
        printf("s = %s\n", user_string(@var("s")));
    }

And then compile the test.c C program:

    gcc -g test.c

And then run the test.stp script:

    $ stap test.stp -c './a.out'
    ERROR: user string copy fault -14 at 00000000a25ef291 [man error::fault]
near identifier 'user_string_n' at
/opt/stap/share/systemtap/tapset/uconversions.stp:114:10
    WARNING: Number of errors: 1, skipped probes: 0
    WARNING: /opt/stap/bin/staprun exited with status: 1
    Pass 5: run failed.  [man error::pass5]

I'm using the latest stap master branch (commit 8ffab23ff4):

    $ /opt/stap/bin/stap -V
    Systemtap translator/driver (version 4.2/0.176, commit
release-4.1-72-g8ffab23ff4a1)
    Copyright (C) 2005-2019 Red Hat, Inc. and others
    This is free software; see the source for copying conditions.
    tested kernel versions: 2.6.18 ... 5.1-rc2
    enabled features: AVAHI BPF PYTHON2 LIBSQLITE3 LIBXML2 NLS NSS READLINE

The system is Fedora 29:

    $ cat /etc/redhat-release
    Fedora release 29 (Twenty Nine)


More info:

    $ gcc --version
    gcc (GCC) 8.3.1 20190223 (Red Hat 8.3.1-2)
    Copyright (C) 2018 Free Software Foundation, Inc.
    This is free software; see the source for copying conditions.  There is NO
    warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

    $ uname -a
    Linux glass 5.1.20-200.fc29.x86_64 #1 SMP Fri Jul 26 15:15:46 UTC 2019
x86_64 x86_64 x86_64 GNU/Linux

The same test example works flawlessly on CentOS 7:

    $ stap -c './a.out' test.stp
    s = hi

Using gcc options -fpic -pie to compile the test.c program makes no difference:

    ERROR: user string copy fault -14 at 000000004e89a066 [man error::fault]
near identifier 'user_string_n' at
/opt/stap/share/systemtap/tapset/uconversions.stp:114:10
    WARNING: Number of errors: 1, skipped probes: 0
    WARNING: /opt/stap/bin/staprun exited with status: 1
    Pass 5: run failed.  [man error::pass5]

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

             reply	other threads:[~2019-08-24  1:13 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-24  1:13 agentzh at gmail dot com [this message]
2024-04-10 21:25 ` [Bug runtime/24935] " wcohen 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-24935-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).