Bug 177240 - ptraced multithreaded exec dies with spurious SIGKILL
ptraced multithreaded exec dies with spurious SIGKILL
Product: Fedora
Classification: Fedora
Component: kernel (Show other bugs)
All Linux
medium Severity medium
: ---
: ---
Assigned To: Dave Jones
Brian Brock
Depends On:
Blocks: FC5Blocker 173278 180484
  Show dependency treegraph
Reported: 2006-01-07 22:19 EST by Roland McGrath
Modified: 2015-01-04 17:24 EST (History)
6 users (show)

See Also:
Fixed In Version: 2.6.16-1.2096_FC5
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2006-10-12 06:34:47 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
threaded execer program for test case (2.81 KB, text/plain)
2006-01-07 22:19 EST, Roland McGrath
no flags Details

External Trackers
Tracker ID Priority Status Summary Last Updated
Sourceware 2130 None None None Never

  None (edit)
Description Roland McGrath 2006-01-07 22:19:51 EST
Description of problem:

Version-Release number of selected component (if applicable):
2.6.14-1.1773_FC5smp, 2.6.15-1.1826.2.4_FC5

How reproducible:

Steps to Reproduce:
1. gcc -o threadexec -g threadexec.c -lpthread
2. ./threadexec /bin/echo hi => see it work
3. strace -f -o log ./threadexec /bin/echo hi => see it fail
Actual results:

In the traced run, the process dies by SIGKILL immediately after execing /bin/echo.

Expected results:

After the exec, /bin/echo should run normally (and be traced).

Additional info:
Comment 1 Roland McGrath 2006-01-07 22:19:52 EST
Created attachment 122915 [details]
threaded execer program for test case
Comment 2 Roland McGrath 2006-01-08 04:25:03 EST
Verified this bug is in the current upstream kernel.
Comment 3 wzhou 2006-03-02 04:11:15 EST
I believe I had found the code which trigger this testcase failure.  But I don't
the why yet.  It is triggered by the following code in kernel/ptrace.c:

+	if (child->signal->flags & SIGNAL_GROUP_EXIT) {
+		sigaddset(&child->pending.signal, SIGKILL);
+		signal_wake_up(child, 1);
+	}

This is checked into 2.6.15 by Andrea Arcangeli to fix a gdb deadlock problem he
didn't elaborate on. Here is the link:
http://marc.theaimsgroup.com/?l=linux-kernel&m=112833915827432&w=2.  After
reversing this patch, the above case works ok on both x86 and ppc64.
Comment 4 wzhou 2006-03-02 04:17:25 EST
BTW, could I use the above testcase in the public mail-list?  I believe it is. 
But I am not sure.  So I just want to ask.  :-)
Comment 5 Roland McGrath 2006-03-02 04:25:18 EST
Everything about this bug is public.  The attached test program is GPL'd code
already publically available from the Frysk project.

Thanks for looking into this.  Andrea's change is one among many recent kernel
changes on my backlog to review and about which I have been dubious but not yet
had the time to investigate fully and follow up to get them changed. 
Unfortunately I have still had my time monopolized by other things and that
backlog is growing and not shrinking.
Comment 6 Andrew Cagney 2006-03-02 14:55:47 EST
Can the above code be removed for the FC-5 kernel?
Comment 7 wzhou 2006-03-07 23:09:33 EST
I sent an email to Andrea and cc the linux-kernel mail-list about this problem.
 Here is the link:


Just FYI.
Comment 8 Roland McGrath 2006-04-17 17:25:43 EDT has fixed this upstream.
FC-5's next rebase should get it.
Comment 9 Roland McGrath 2006-10-12 06:34:47 EDT
 2.6.17-1.2174_FC5 tests fine, closing

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