Bug 232236 - Exit notifications missing when tracing multi-threaded processes
Exit notifications missing when tracing multi-threaded processes
Status: CLOSED CURRENTRELEASE
Product: Fedora
Classification: Fedora
Component: kernel (Show other bugs)
6
All Linux
medium Severity medium
: ---
: ---
Assigned To: Kernel Maintainer List
Brian Brock
:
Depends On:
Blocks: 232369
  Show dependency treegraph
 
Reported: 2007-03-14 11:08 EDT by Magnus Vesterlund
Modified: 2011-12-13 17:28 EST (History)
1 user (show)

See Also:
Fixed In Version: 2.6.20-1.2933.fc6
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2007-04-02 10:00:00 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Test case (884 bytes, application/x-gzip)
2007-03-14 11:08 EDT, Magnus Vesterlund
no flags Details
test case contained in one source file (1.75 KB, text/plain)
2007-03-14 20:14 EDT, Roland McGrath
no flags Details
fix patch (2.08 KB, patch)
2007-03-14 20:56 EDT, Roland McGrath
no flags Details | Diff

  None (edit)
Description Magnus Vesterlund 2007-03-14 11:08:30 EDT
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) ---
Comment 1 Magnus Vesterlund 2007-03-14 11:08:30 EDT
Created attachment 150042 [details]
Test case
Comment 2 Chuck Ebbert 2007-03-14 11:13:47 EDT
Please test 2.6.20-1.2925.fc6

It's in Fedora testing now and should be released today.
Comment 3 Roland McGrath 2007-03-14 14:53:35 EDT
Looks like this is still a problem.
Comment 4 Roland McGrath 2007-03-14 20:14:54 EDT
Created attachment 150103 [details]
test case contained in one source file

This is the version of the test case I'm using.
Comment 5 Roland McGrath 2007-03-14 20:56:12 EDT
Created attachment 150106 [details]
fix patch

I've fixed the bug and the attached patch is now part of the "upstream" utrace
patches.
Comment 6 Roland McGrath 2007-03-14 21:01:09 EDT
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 7 Chuck Ebbert 2007-03-30 18:08:42 EDT
Is this bug fixed? Kernel 2933 is out with this fix and kernel 2937
or better (from http://people.redhat.com/cebbert) has more fixes.
Comment 8 Magnus Vesterlund 2007-04-01 03:19:28 EDT
Yes, the bug is fixed in both 2933 and 2937.

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