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.
Created attachment 151891 [details] Testcase.
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.
Created attachment 151898 [details] cleaned up version of the test case This is modified not to depend on timing.
This was fixed a while back.