Bug 1898 - occasional ptrace.detach errors when a cloning detach
Summary: occasional ptrace.detach errors when a cloning detach
Status: RESOLVED FIXED
Alias: None
Product: frysk
Classification: Unclassified
Component: general (show other bugs)
Version: unspecified
: P1 normal
Target Milestone: ---
Assignee: Andrew Cagney
URL:
Keywords:
Depends on:
Blocks: 1857
  Show dependency treegraph
 
Reported: 2005-11-21 17:33 UTC by Andrew Cagney
Modified: 2005-11-22 03:30 UTC (History)
0 users

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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