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 uprobes/27260] New: uprobes is unstable on centos6 x86_64 when running the same script repeatedly against the same target process
Date: Thu, 28 Jan 2021 02:07:49 +0000	[thread overview]
Message-ID: <bug-27260-6586@http.sourceware.org/bugzilla/> (raw)

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

            Bug ID: 27260
           Summary: uprobes is unstable on centos6 x86_64 when running the
                    same script repeatedly against the same target process
           Product: systemtap
           Version: unspecified
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: uprobes
          Assignee: systemtap at sourceware dot org
          Reporter: agentzh at gmail dot com
  Target Milestone: ---

We noted that use of uprobes on centos6 x86_64 is very unstable even with the
simplest script and the simplest target C program. Below is a minimal example
that can reliably reproduce the issue:

First of all, we create a simple C program as the target:


```
#include <stdio.h>

void foo(int i) {
    printf("hello %d\n", i);
}

int main(void) {
    int i = 0;
    while (1) {
        foo(i++);
    }
    return 0;
}
```

And then compile this C program without inlining:

```
gcc -O -fno-inline -g a.c
```

Run the target program forever:

```
./a.out > /dev/null
```

Finally, run a stap oneliner in a bash loop:

```
$ while true; do /opt/stap/bin/stap -d ~/a.out -e 'probe
process("/home/agentzh/a.out").function("foo") { println("Hit"); exit() }';
done
Hit
Hit
Hit
Hit
Hit
Hit
Hit
Hit
Hit
```

This loop will quickly hang sooner or later. Some times after 3 Hits, some
times after about 10.

And in the terminal running the ./a.out, we can see the target is already
killed:

```
[agentzh@centos6-pkg ~]$ ./a.out > /dev/null
Trace/breakpoint trap
[agentzh@centos6-pkg ~]$
```

I'm using the latest stap master (commit a790dc64a9d8d9):

```
[agentzh@centos6-pkg systemtap]$ /opt/stap/bin/stap -V
Systemtap translator/driver (version 4.5/0.177, commit
release-4.4-74-ga790dc64a9d8 + changes)
Copyright (C) 2005-2020 Red Hat, Inc. and others
This is free software; see the source for copying conditions.
tested kernel versions: 2.6.32 ... 5.10.0-rc
enabled features: JAVA LIBXML2 READLINE
```

Using the following centos6 stock kernel:

```
[agentzh@centos6-pkg systemtap]$ uname -r
2.6.32-754.18.2.el6.x86_64
```

Tested all the centos 6 kernels in the official repo. Same thing.

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

             reply	other threads:[~2021-01-28  2:07 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-28  2:07 agentzh at gmail dot com [this message]
2023-10-30 15:26 ` [Bug uprobes/27260] " 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-27260-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).