public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
* [Bug dyninst/23513] New: Dyninst runtime kills the target process when attaching to the target process for a second time
@ 2018-08-11  0:34 agentzh at gmail dot com
  2018-08-11  0:39 ` [Bug dyninst/23513] " fche at redhat dot com
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: agentzh at gmail dot com @ 2018-08-11  0:34 UTC (permalink / raw)
  To: systemtap

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

            Bug ID: 23513
           Summary: Dyninst runtime kills the target process when
                    attaching to the target process for a second time
           Product: systemtap
           Version: unspecified
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: dyninst
          Assignee: systemtap at sourceware dot org
          Reporter: agentzh at gmail dot com
  Target Milestone: ---

Created attachment 11178
  --> https://sourceware.org/bugzilla/attachment.cgi?id=11178&action=edit
stap-report output on the same box

Consider the following simple forever-running C program:

```C
#include <unistd.h>

int main(void) {
    while (1) {
        usleep (1000);
    }
    return 0;
}
```

Compile it and generate `./a.out`:

```
gcc -g -Wall a.c
```

Then start it in one terminal (let's call it terminal A):

```
$ ./a.out
```

It hangs as expected.

Then try running the stap dyninst command like below in another terminal (let's
say, terminal B):

```
$ /opt/stap/bin/stap -e 'probe process("/lib64/libc.so.6").function("usleep") {
println("hi") exit() }' -x `pgrep -f './a.out'` --dyninst
hi
```

It works as expected. And in terminal A, the `./a.out` program is still
running. So far so good.

But now as soon as we run the `stap` command above again, we got the following
error on terminal B:

```
$ /opt/stap/bin/stap -e 'probe process("/lib64/libc.so.6").function("usleep") {
println("hi") exit() }' -x `pgrep -f './a.out'` --dyninst
--FATAL-- #68: Dyninst was unable to attach to the specified process
--FATAL-- #68: BPatch.C[1047]: no process 40758 defined in procsByPid

stapdyn: ERROR: Couldn't attach to the target process
WARNING: /opt/stap/bin/stapdyn exited with status: 1
Pass 5: run failed.  [man error::pass5]
```

And in terminal A, the `./a.out` process is already killed too:

```
agentzh@work2 ~ $ ./a.out
Killed
```

This can also be reproduced by a `probe begin` one-liner:

```
agentzh@work2 ~ $ /opt/stap/bin/stap -e 'probe begin { println("hi") exit() }'
-x `pgrep -f './a.out'` --dyninst
hi

agentzh@work2 ~ $ /opt/stap/bin/stap -e 'probe begin { println("hi") exit() }'
-x `pgrep -f './a.out'` --dyninst
--FATAL-- #68: Dyninst was unable to attach to the specified process
--FATAL-- #68: BPatch.C[1047]: no process 40816 defined in procsByPid

stapdyn: ERROR: Couldn't attach to the target process
WARNING: /opt/stap/bin/stapdyn exited with status: 1
Pass 5: run failed.  [man error::pass5]
```

I'm using the 3.3 release tag of systemtap on Fedora 27 x86_64:

```
$ /opt/stap/bin/stap --version
Systemtap translator/driver (version 3.3/0.173, commit
release-3.3-0-g48867d1cface)
Copyright (C) 2005-2018 Red Hat, Inc. and others
This is free software; see the source for copying conditions.
tested kernel versions: 2.6.18 ... 4.18-rc0
enabled features: BOOST_STRING_REF DYNINST BPF NLS NSS
```

Also attached the stap-report output for the same box.

Am I doing anything wrong here?

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2019-12-11 16:25 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-08-11  0:34 [Bug dyninst/23513] New: Dyninst runtime kills the target process when attaching to the target process for a second time agentzh at gmail dot com
2018-08-11  0:39 ` [Bug dyninst/23513] " fche at redhat dot com
2018-08-11  0:46 ` agentzh at gmail dot com
2019-04-05 19:07 ` scox at redhat dot com
2019-04-06  1:01 ` scox at redhat dot com
2019-04-10 12:42 ` scox at redhat dot com
2019-12-11 16:25 ` avi@cloudius-systems.com

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).