This is the mail archive of the systemtap@sourceware.org mailing list for the systemtap project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug uprobes/14537] New: Use of usymname() makes strace crash user processes


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

             Bug #: 14537
           Summary: Use of usymname() makes strace crash user processes
           Product: systemtap
           Version: unspecified
            Status: NEW
          Severity: critical
          Priority: P2
         Component: uprobes
        AssignedTo: systemtap@sourceware.org
        ReportedBy: agentzh@gmail.com
    Classification: Unclassified


Hello!

I've noticed that using the standard usymname() tapset function in my systemtap
scripts will make the user processes crash if I run the "strace" utility on the
user process that has been probed by my systemtap scripts.

I've tried both systemtap 1.8 release tarball and systemtap 2.0 (git master
HEAD, gaec884c) and got the same bad result.

I'm using Fedora 17 x86_64

    $ uname -a
    Linux w530 3.5.2-3.fc17.x86_64 #1 SMP Tue Aug 21 19:06:52 UTC 2012 x86_64
x86_64 x86_64 GNU/Linux

as well as strace 4.7.

Steps to reproduce:

1. Compile and run the following dead simple C program with gcc:

    int main(void) {
        for (;;) {
            sleep(1);
        }
        return 0;
    }

    The command that I use is "gcc -g a.c && ./a.out". The process ID for this
run of ./a.out was 29617.

2. Run the following dead simple systemtap script named a.stp with the "stap"
utility:

    probe process("./a.out").function("main") {
        printf("%s\n", usymname(0x123456))
        exit()
    }

   On the command line, I got

    $ stap a.stp
    0x123456

    Note that at this point, the stap program existed normally.

3. Run the "strace" utility against the ./a.out process that is still running
(started in step 1):

    $ strace -p 29617
    Process 29617 attached
    --- SIGTRAP {si_signo=SIGTRAP, si_code=0x5, si_pid=29617, si_uid=1000} ---
    --- SIGTRAP {si_signo=SIGTRAP, si_code=SI_KERNEL} ---
    +++ killed by SIGTRAP (core dumped) +++

    And at this point the process 29617 died horribly.

Removing the usymname() invocation from my stp script cannot reproduce this
issue.

If you need any further information, please let me know :)

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]