This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 46818 - Deadlock between CES and UndoRedoManager
Summary: Deadlock between CES and UndoRedoManager
Status: CLOSED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: Text (show other bugs)
Version: 4.x
Hardware: PC Linux
: P1 blocker (vote)
Assignee: Jaroslav Tulach
URL:
Keywords: THREAD
Depends on:
Blocks:
 
Reported: 2004-08-02 09:12 UTC by Jaroslav Tulach
Modified: 2008-12-22 20:06 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Threaddump (11.46 KB, text/plain)
2004-08-02 09:12 UTC, Jaroslav Tulach
Details
Patch for canUndo and canRedo (1.77 KB, patch)
2004-08-02 10:41 UTC, Jaroslav Tulach
Details | Diff
Test to check whether all UndoManager methods can be called from a document lock, test to verify that (15.66 KB, patch)
2004-08-02 13:16 UTC, Jaroslav Tulach
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jaroslav Tulach 2004-08-02 09:12:34 UTC
After recent changes in synchronization of
CES.getUndoRedo() I was able to get a deadlock
during UndoRedo.canUndo. If the canUndo method
then decided to access the document, it could
deadlock.
Comment 1 Jaroslav Tulach 2004-08-02 09:12:56 UTC
Created attachment 16595 [details]
Threaddump
Comment 2 Jaroslav Tulach 2004-08-02 09:13:56 UTC
The solution is in my opinion similar to changes made to undo() and
redo(), lock the document before the super method is being called. 
Comment 3 Miloslav Metelka 2004-08-02 10:11:15 UTC
Yes, agreed. Maybe we should do it mechanically like
1. search for 'synchronized' keyword in UndoManager.
2. verify that the particular method is present in the UndoRedo.
3. wrap it by document lock.
Comment 4 Jaroslav Tulach 2004-08-02 10:41:43 UTC
Created attachment 16599 [details]
Patch for canUndo and canRedo
Comment 5 Jaroslav Tulach 2004-08-02 13:16:57 UTC
Created attachment 16605 [details]
Test to check whether all UndoManager methods can be called from a document lock, test to verify that
Comment 6 Jaroslav Tulach 2004-08-02 13:42:18 UTC
Checking in src/org/openide/text/CloneableEditorSupport.java;
/cvs/openide/src/org/openide/text/CloneableEditorSupport.java,v  <-- 
CloneableEditorSupport.java
new revision: 1.128; previous revision: 1.127
done
Processing log script arguments...
More commits to come...
Checking in test/unit/src/org/openide/text/UndoRedoTest.java;
/cvs/openide/test/unit/src/org/openide/text/UndoRedoTest.java,v  <-- 
UndoRedoTest.java
new revision: 1.2; previous revision: 1.1
Comment 7 Marian Mirilovic 2004-08-10 09:20:14 UTC
verified in [nb_dev](200408091800)