Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 361541 - Critical code in Graph.dispose() may lead to deadlock and frozen eclipse
Summary: Critical code in Graph.dispose() may lead to deadlock and frozen eclipse
Status: RESOLVED FIXED
Alias: None
Product: GEF
Classification: Tools
Component: GEF-Legacy Zest (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 critical (vote)
Target Milestone: ---   Edit
Assignee: gef-inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-10-20 09:30 EDT by Jan Mauersberger CLA
Modified: 2015-03-18 16:51 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jan Mauersberger CLA 2011-10-20 09:30:25 EDT
Build Identifier: 

The code in Graph.dispose() starts with:

while (nodes.size() > 0) {
  GraphNode node = (GraphNode) nodes.get(0);
  if (node != null && !node.isDisposed()) {
    node.dispose();
  }
}

Disposed nodes are not removed in the code but only implicitly by a call to node.dispose(). Hence in case a node is in the graph that is already disposed for some reason an infinite loop is entered.

Don't ask me how I managed to get a disposed node in there but I did and the whole eclipse did freeze. It might be that the disposed node crept in due to another bug (with exception) and essential code did not get executed. Anyway, I think we could make this code more robust since there is no reason why we should check for disposed nodes because any disposed one causes an inifite loop

Reproducible: Always
Comment 1 Fabian Steeg CLA 2011-10-21 17:16:35 EDT
Thanks, that's a nasty freeze indeed - fixed in 1.x head and 2.x master, see GraphTests#testDisposeGraphWithDisposedNode and ...WithDisposedConnection.

http://git.eclipse.org/c/gef/org.eclipse.zest.git/commit/?id=e071b4d85594311