Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 232369 - Exit notifications missing when tracing multi-threaded processes
Summary: Exit notifications missing when tracing multi-threaded processes
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: kernel
Version: 5.0
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
: ---
Assignee: Roland McGrath
QA Contact: Martin Jenner
URL:
Whiteboard:
Depends On: 232236
Blocks:
TreeView+ depends on / blocked
 
Reported: 2007-03-15 01:03 UTC by Roland McGrath
Modified: 2007-11-30 22:07 UTC (History)
2 users (show)

Fixed In Version: RHBA-2007-0959
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2007-11-07 19:44:17 UTC
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2007:0959 normal SHIPPED_LIVE Updated kernel packages for Red Hat Enterprise Linux 5 Update 1 2007-11-08 00:47:37 UTC

Description Roland McGrath 2007-03-15 01:03:45 UTC
+++ This bug was initially created as a clone of Bug #232236 +++

Description of problem:
When tracing multiple threads in a process using ptrace the Fedora Core kernel
only delivers an exit notification through wait for the initial thread. Vanilla
Linux kernels deliver an exit notification for each traced thread.

Version-Release number of selected component (if applicable):
2.6.19-1.2911.6.5.fc6

How reproducible:
Every time.

Steps to Reproduce:
1. Untar the attached test.
2. cd exit-test
3. make
4. ./monitor

Actual results:
Prints only one exit notification.

Expected results:
Should print two exit notifications.

Additional info:

For a less synthetic testcase, strace is also affected by this. Try compiling
this program with "gcc -fopenmp -o foo foo.c":

int main(int argc, char **argv) {
    int i;
#pragma omp parallel for
    for (i = 0; i < 1; i++)
        ;

    return 0;
}

Then trace it with "strace -f ./foo". Strace reports multiple detaches for the
same thread or bogus SIGSEGVs:

...
[pid  4586] futex(0x886b048, FUTEX_WAKE, 1) = 1
[pid  4585] <... futex resumed> )       = 0
[pid  4585] futex(0x886b048, FUTEX_WAKE, 1) = 0
[pid  4585] exit_group(0)               = ?
Process 4585 detached
Process 4586 detached
Process 4585 detached

...
[pid  4589] futex(0x19d830, FUTEX_WAIT, 0, NULL <unfinished ...>
[pid  4588] <... futex resumed> )       = 0
[pid  4588] exit_group(0)               = ?
[pid  4589] <... futex resumed> )       = 9
[pid  4589] --- SIGSEGV (Segmentation fault) @ 0 (0) ---

-- Additional comment from magnus_vesterlund@hotmail.com on 2007-03-14 11:08 EST --
Created an attachment (id=150042)
Test case


-- Additional comment from cebbert@redhat.com on 2007-03-14 11:13 EST --
Please test 2.6.20-1.2925.fc6

It's in Fedora testing now and should be released today.

-- Additional comment from roland@redhat.com on 2007-03-14 14:53 EST --
Looks like this is still a problem.

-- Additional comment from roland@redhat.com on 2007-03-14 20:14 EST --
Created an attachment (id=150103)
test case contained in one source file

This is the version of the test case I'm using.

-- Additional comment from roland@redhat.com on 2007-03-14 20:56 EST --
Created an attachment (id=150106)
fix patch

I've fixed the bug and the attached patch is now part of the "upstream" utrace
patches.

-- Additional comment from roland@redhat.com on 2007-03-14 21:01 EST --
I've committed the new utrace patch to the rawhide kernel cvs.
The attached patch can be folded into the utrace patch for fc6.

Comment 1 Roland McGrath 2007-03-15 01:07:25 UTC
See attachments to bug #232236 for test case and fix patch.
This is a regression vs RHEL4 and all prior and upstream kernels.
The fix will be included with other utrace updates in a replacement utrace patch
for 5.1.

Comment 2 RHEL Product and Program Management 2007-03-15 02:04:16 UTC
This bugzilla has Keywords: Regression.  

Since no regressions are allowed between releases, 
it is also being proposed as a blocker for this release.  

Please resolve ASAP.

Comment 5 RHEL Product and Program Management 2007-06-20 12:31:41 UTC
This request was evaluated by Red Hat Kernel Team for inclusion in a Red
Hat Enterprise Linux maintenance release, and has moved to bugzilla 
status POST.

Comment 6 Don Zickus 2007-07-19 20:05:34 UTC
in kernel-2.6.18-30.el5

Comment 8 Mike Gahagan 2007-09-11 18:52:29 UTC
confirmed fix using testcase attached as attachment (id=150103) 

Comment 10 errata-xmlrpc 2007-11-07 19:44:17 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on the solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2007-0959.html



Note You need to log in before you can comment on or make changes to this bug.