Bug 1898

Summary: occasional ptrace.detach errors when a cloning detach
Product: frysk Reporter: Andrew Cagney <cagney>
Component: generalAssignee: Andrew Cagney <cagney>
Status: RESOLVED FIXED    
Severity: normal    
Priority: P1    
Version: unspecified   
Target Milestone: ---   
Host: Target:
Build: Last reconfirmed:
Bug Depends on:    
Bug Blocks: 1857    

Description Andrew Cagney 2005-11-21 17:33:20 UTC
There's a race condition when detaching simultaneous to a clone vis:
- frysk sends detach to Task object
- Task object receives detach, sends stop to kernel task
- Task object receives clone
At this point the Task-object can detach, but the clone cannot:
- the clone _probably_ hasn't yet stopped; ptrace.detach(clone) will fail
- the owning proc doesn't know about clone; so won't wait for it to detach
Comment 1 Andrew Cagney 2005-11-21 21:46:48 UTC
Index: frysk-core/frysk/proc/ChangeLog
2005-11-21  Andrew Cagney  <cagney@redhat.com>

        * Proc.java (performTaskAttachCompleted(Task,Task)): Add
        * ProcState.java: Handle performTaskAttachCompleted.
        * TaskState.java: In .detaching, when a clone, notify owning
        process of the clone Task.  Replace .initial with .mainState,
        .unattachedState, and .clonedState.  Replace .Stating states with
        .Start states.  Simplify.
        * Task.java: Update.
Comment 2 Andrew Cagney 2005-11-22 03:30:30 UTC
tests passing