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 454404 - ptrace: PTRACE_DETACH(..., SIGSTOP) does not stop
Summary: ptrace: PTRACE_DETACH(..., SIGSTOP) does not stop
Alias: None
Product: Fedora
Classification: Fedora
Component: kernel
Version: 9
Hardware: All
OS: Linux
Target Milestone: ---
Assignee: Roland McGrath
QA Contact: Fedora Extras Quality Assurance
Depends On:
Blocks: 453688 456333 456335
TreeView+ depends on / blocked
Reported: 2008-07-08 10:05 UTC by Jan Kratochvil
Modified: 2009-07-14 18:18 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2009-07-14 18:18:47 UTC

Attachments (Terms of Use)
Testcase. (deleted)
2008-07-08 10:05 UTC, Jan Kratochvil
no flags Details
man-pages-2.78-2.fc9.noarch patch. (deleted)
2008-07-18 15:28 UTC, Jan Kratochvil
no flags Details | Diff

Description Jan Kratochvil 2008-07-08 10:05:19 UTC
Description of problem:
While trying to detach a multithreaded program to remain T (stopped) it works on
i686 but some tasks are left unstopped on x86_64.
Singlethreaded program is left T (stopped) reliably.

Version-Release number of selected component (if applicable):
FAIL F-9 kernel-
FAIL F-9 kernel-vanilla- (KVM)
PASS F-9 kernel- (KVM)
PASS F-9 kernel-vanilla- (KVM)
PASS RHEL-5.2 kernel-2.6.18-92.el5.x86_64
PASS RHEL-4.6 kernel-smp-2.6.9-67.0.20.EL.x86_64
vanilla-2.4.33.i686 nothing stopped (FAIL)

But it is very racy, any of these PASSes can be in fact also a FAIL.

How reproducible:
With #define THREADS 10 or more in fact always.

Steps to Reproduce:
gcc -o detach-stopped detach-stopped.c -Wall -ggdb2
-pthread;./detach-stopped;echo $?
Actual results:
0: State:	S (sleeping)
1: State:	S (sleeping)
2: State:	T (stopped)
3: State:	S (sleeping)
4: State:	T (stopped)
5: State:	T (stopped)
6: State:	T (stopped)
7: State:	T (stopped)
8: State:	T (stopped)
9: State:	T (stopped)

Expected results:
0: State:	T (stopped)
1: State:	T (stopped)
2: State:	T (stopped)
3: State:	T (stopped)
4: State:	T (stopped)
5: State:	T (stopped)
6: State:	T (stopped)
7: State:	T (stopped)
8: State:	T (stopped)
9: State:	T (stopped)

Additional info:
Please advice wherether it is supposed to work at all.  Due to the racy behavior
one can never be sure just by the kernel black-box testing.
Additional delays during the detaching do not help anything.

Comment 1 Jan Kratochvil 2008-07-08 10:05:19 UTC
Created attachment 311250 [details]

Comment 3 Jan Kratochvil 2008-07-13 20:48:14 UTC
FYI kernel-2.6.26-0.131.rc9.git9.fc10.x86_64 is stable that it NEVER stops the
detached tasks.

Comment 4 Jan Kratochvil 2008-07-18 15:28:40 UTC
Created attachment 312150 [details]
man-pages-2.78-2.fc9.noarch patch.

As RHEL-5.3 behaves according to the `Expected state' and the GDB sources
   On newer GNU/Linux kernels (>= 2.5.61)
   the handling of SIGSTOP for a ptraced process has changed. Earlier
   versions of the kernel would ignore these SIGSTOPs, while now
   SIGSTOP is treated like any other signal, i.e. it is not muffled.

   If the gdb user does a 'continue' after the 'attach', gdb passes
   the global variable stop_signal (which stores the signal from the
   attach, SIGSTOP) to the ptrace(PTRACE_CONT,...)  call.  This is
   problematic, because the kernel doesn't ignore such SIGSTOP

If the RHEL-5.3 behavior is the desired state proposing the attached ptrace(2)
man page update.

Comment 5 Jan Kratochvil 2008-07-22 21:59:32 UTC
Made this Bug the official F-9 problem instance for:

FAIL F-9    kernel-

FAIL RHEL-5 kernel-2.6.18-92.1.6.el5.x86_64
FAIL RHEL-5 kernel-2.6.18-92.1.6.el5.i686
FAIL RHEL-5 kernel-2.6.18-53.el5.s390x

PASS RHEL-4 kernel-smp-2.6.9-67.0.20.EL.x86_64

Comment 6 Chuck Ebbert 2008-10-24 02:58:07 UTC
Is this fixed in

Comment 7 Denys Vlasenko 2008-10-24 12:27:09 UTC
Yes, fixed in

Comment 8 Denys Vlasenko 2008-10-24 13:02:46 UTC
My bad. This is the only testcase which is NOT fixed in F9 yet, and I erroneously closed the bug! :|

Reopening. Not fixed in

Comment 9 Bug Zapper 2009-06-10 01:58:45 UTC
This message is a reminder that Fedora 9 is nearing its end of life.
Approximately 30 (thirty) days from now Fedora will stop maintaining
and issuing updates for Fedora 9.  It is Fedora's policy to close all
bug reports from releases that are no longer maintained.  At that time
this bug will be closed as WONTFIX if it remains open with a Fedora 
'version' of '9'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version prior to Fedora 9's end of life.

Bug Reporter: Thank you for reporting this issue and we are sorry that 
we may not be able to fix it before Fedora 9 is end of life.  If you 
would still like to see this bug fixed and are able to reproduce it 
against a later version of Fedora please change the 'version' of this 
bug to the applicable version.  If you are unable to change the version, 
please add a comment here and someone will do it for you.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events.  Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

The process we are following is described here:

Comment 10 Bug Zapper 2009-07-14 18:18:47 UTC
Fedora 9 changed to end-of-life (EOL) status on 2009-07-10. Fedora 9 is 
no longer maintained, which means that it will not receive any further 
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of 
Fedora please feel free to reopen this bug against that version.

Thank you for reporting this bug and we are sorry it could not be fixed.

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