Bug 235521

Summary: utrace: ptrace operations should work on child in job control stop
Product: [Fedora] Fedora Reporter: Jan Kratochvil <jan.kratochvil>
Component: kernelAssignee: Roland McGrath <roland>
Status: CLOSED RAWHIDE QA Contact: Brian Brock <bbrock>
Severity: high Docs Contact:
Priority: medium    
Version: rawhideCC: cagney
Target Milestone: ---Keywords: Regression
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2007-09-04 20:37:49 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 233852, 235545    
Attachments:
Description Flags
Testcase.
none
cleaned up version of the test case none

Description Jan Kratochvil 2007-04-06 17:46:49 UTC
Description of problem:
Found a regression against kernel.org in RH kernels utrace based implementation
of ptrace(2).

Version-Release number of selected component (if applicable):
kernel-2.6.20-1.3045.fc7.x86_64
(on FC6 system)

How reproducible:
Always.

Steps to Reproduce:
1. gcc -o stopkills stopkills.c -Wall -ggdb3
2. ./stopkills

Actual results:
./stopkills: PTRACE_DETACH: No such process

Expected results:
(nothing; exit code 0)

Additional info:
ptrace (PTRACE_CONT, child_pid, NULL, (void *) SIGSTOP);
ptrace (PTRACE_DETACH, child_pid, NULL, NULL);
PTRACE_DETACH fails by ESRCH on the utrace kernels.

Comment 1 Jan Kratochvil 2007-04-06 17:47:04 UTC
Created attachment 151891 [details]
Testcase.

Comment 2 Roland McGrath 2007-04-06 20:58:48 UTC
The name of the test case and the description of the bug are confusing.
The actual problem is that after PTRACE_CONT,SIGSTOP the child is in job control
stop (TASK_STOPPED), not ptrace stop (TASK_TRACED).  The regression is that
ptrace should work on a child in job control stop as well, whereas currently the
utrace kernel returns ESRCH as it does when the child is not stopped.

Comment 3 Roland McGrath 2007-04-06 21:36:11 UTC
Created attachment 151898 [details]
cleaned up version of the test case

This is modified not to depend on timing.

Comment 4 Roland McGrath 2007-09-04 20:37:49 UTC
This was fixed a while back.