Bug 454404 - ptrace: PTRACE_DETACH(..., SIGSTOP) does not stop
ptrace: PTRACE_DETACH(..., SIGSTOP) does not stop
Product: Fedora
Classification: Fedora
Component: kernel (Show other bugs)
All Linux
low Severity medium
: ---
: ---
Assigned To: Roland McGrath
Fedora Extras Quality Assurance
: Reopened
Depends On:
Blocks: 453688 456333 456335
  Show dependency treegraph
Reported: 2008-07-08 06:05 EDT by Jan Kratochvil
Modified: 2009-07-14 14:18 EDT (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2009-07-14 14:18: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)
Testcase. (5.70 KB, text/plain)
2008-07-08 06:05 EDT, Jan Kratochvil
no flags Details
man-pages-2.78-2.fc9.noarch patch. (866 bytes, patch)
2008-07-18 11:28 EDT, Jan Kratochvil
no flags Details | Diff

  None (edit)
Description Jan Kratochvil 2008-07-08 06:05:19 EDT
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 06:05:19 EDT
Created attachment 311250 [details]
Comment 3 Jan Kratochvil 2008-07-13 16:48:14 EDT
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 11:28:40 EDT
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 17:59:32 EDT
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-23 22:58:07 EDT
Is this fixed in
Comment 7 Denys Vlasenko 2008-10-24 08:27:09 EDT
Yes, fixed in
Comment 8 Denys Vlasenko 2008-10-24 09:02:46 EDT
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-09 21:58:45 EDT
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 14:18:47 EDT
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.