Bug 1853 - add fork observer race condition
Summary: add fork observer race condition
Status: NEW
Alias: None
Product: frysk
Classification: Unclassified
Component: general (show other bugs)
Version: unspecified
: P1 normal
Target Milestone: ---
Assignee: Unassigned
URL:
Keywords:
Depends on:
Blocks: 1516 1586 1654
  Show dependency treegraph
 
Reported: 2005-11-11 16:21 UTC by Sami Wagiaalla
Modified: 2008-10-21 21:39 UTC (History)
2 users (show)

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 Sami Wagiaalla 2005-11-11 16:21:17 UTC
In the update function of a fork when one tries to add an observer to the child
process the state machine does not handel the transition.

This however works:

public Action updateForked(Task task, Proc child) {
//...
     child.observableTaskAdded.addObserver(new Observer(){
     public void update(Observable arg0, Object task) {
       Task myTask = (Task) task;
       myTask.requestAddForkedObserver(customObserver);					
     }
  });
//...
Comment 1 Sami Wagiaalla 2005-11-11 16:47:30 UTC
public Action updateForked(Task task, Proc child) {
//...
     child.observableTaskAdded.addObserver(new Observer(){
     public void update(Observable arg0, Object task) {
       Task myTask = (Task) task;
       myTask.requestAddForkedObserver(customObserver);					
     }
  });
//...

This does not actually work... it just does not throw an exception.
I tested this by trying to trace the execution tree of firefox;
only the very first fork is caught.
Comment 2 Andrew Cagney 2005-12-11 17:12:37 UTC
(title changed, it isn't an unhandled state)

is this still broken?  known problems with the observer code have been fixed
Comment 3 Nurdin Premji 2006-11-16 20:31:56 UTC
frysk.proc.TestTaskForkedObserver.testTaskForkedObserver seems to test for this
and passes.