From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 20FB6386181D; Thu, 28 Jan 2021 02:07:50 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 20FB6386181D From: "agentzh at gmail dot com" 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 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: systemtap X-Bugzilla-Component: uprobes X-Bugzilla-Version: unspecified X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: agentzh at gmail dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: systemtap at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: systemtap@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Systemtap mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Jan 2021 02:07:50 -0000 https://sourceware.org/bugzilla/show_bug.cgi?id=3D27260 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 t= he simplest script and the simplest target C program. Below is a minimal examp= le that can reliably reproduce the issue: First of all, we create a simple C program as the target: ``` #include void foo(int i) { printf("hello %d\n", i); } int main(void) { int i =3D 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. --=20 You are receiving this mail because: You are the assignee for the bug.=