[Bug runtime/24935] New: Reading userland static data always leads to read faults on Fedora 29 x86_64

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[Bug runtime/24935] New: Reading userland static data always leads to read faults on Fedora 29 x86_64

glaubitz at physik dot fu-berlin.de
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.