Bug 1853

Summary: add fork observer race condition
Product: frysk Reporter: Sami Wagiaalla <swagiaal>
Component: generalAssignee: Unassigned <frysk-bugzilla>
Status: NEW ---    
Severity: normal CC: pmuldoon, swagiaal
Priority: P1    
Version: unspecified   
Target Milestone: ---   
Host: Target:
Build: Last reconfirmed:
Bug Depends on:    
Bug Blocks: 1516, 1586, 1654    

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.