Bug 14537 - Use of usymname() makes strace crash user processes
Summary: Use of usymname() makes strace crash user processes
Status: RESOLVED DUPLICATE of bug 14659
Alias: None
Product: systemtap
Classification: Unclassified
Component: tapsets (show other bugs)
Version: unspecified
: P2 normal
Target Milestone: ---
Assignee: Unassigned
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-08-31 22:28 UTC by agentzh
Modified: 2012-10-11 22:29 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description agentzh 2012-08-31 22:28:35 UTC
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 :)
Comment 1 agentzh 2012-10-11 22:29:58 UTC
git commit c5516866 seems to have fixed this issue. thanks!

*** This bug has been marked as a duplicate of bug 14659 ***