From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23662 invoked by alias); 19 Nov 2014 13:51:15 -0000 Mailing-List: contact systemtap-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: systemtap-owner@sourceware.org Received: (qmail 23542 invoked by uid 48); 19 Nov 2014 13:51:11 -0000 From: "peter at peca dot dk" To: systemtap@sourceware.org Subject: [Bug uprobes/17623] New: Sometimes probes fail to fire events when running against a multi-threaded application Date: Wed, 19 Nov 2014 13:51:00 -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: peter at peca dot dk X-Bugzilla-Status: NEW 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 attachments.created Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2014-q4/txt/msg00160.txt.bz2 https://sourceware.org/bugzilla/show_bug.cgi?id=17623 Bug ID: 17623 Summary: Sometimes probes fail to fire events when running against a multi-threaded application Product: systemtap Version: unspecified Status: NEW Severity: normal Priority: P2 Component: uprobes Assignee: systemtap at sourceware dot org Reporter: peter at peca dot dk Created attachment 7948 --> https://sourceware.org/bugzilla/attachment.cgi?id=7948&action=edit The example program that triggers the behavior I have the following test program (attached as testprog.c) #include #include #define WAIT_US 1 void func1() { } void func2() { } void* thread_main(void *foo) { for (;;) { func1(); usleep(WAIT_US); func2(); } } int main() { pthread_t thread; pthread_create(&thread, NULL, thread_main, NULL); pthread_join(thread, NULL); return 0; } I run this program, after compiling it with "gcc -O0 -g -Wall testprog.c -o testprog -lpthread", and then run this systemtap script (attached as trace_funcs.stp): probe process("testprog").function("func1") { printf("func1\n") } probe process("testprog").function("func2") { printf("func2\n") } Expected output: An endless repetition of "func1\nfunc2\n". Actual output: Sometimes an endless repetition of "func1\n", and at other times the expected output. When I compile with WAIT_US set to 1, it almost always fails. If I set it to 50 about half of the runs fails. If I set it 50000 almost all runs succeed. If I run "testprog" via the "-c" option to stap, it always works. If I call thread_main() directly from main() instead of using pthreads, it always works. I am experiencing is on a Ubuntu 14.04.1, with the Ubuntu supplies Systemtap of version 2.3. I have compiled Systemtap version 2.6 from source and got the same results. -- You are receiving this mail because: You are the assignee for the bug.