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 20155 - Deadlock while editing.
Summary: Deadlock while editing.
Status: CLOSED FIXED
Alias: None
Product: editor
Classification: Unclassified
Component: -- Other -- (show other bugs)
Version: 3.x
Hardware: Sun Solaris
: P2 blocker (vote)
Assignee: issues@editor
URL:
Keywords: RANDOM, THREAD
Depends on: 20467
Blocks:
  Show dependency tree
 
Reported: 2002-02-05 13:18 UTC by Martin Entlicher
Modified: 2007-11-05 13:44 UTC (History)
4 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
The thread dump. (15.84 KB, text/plain)
2002-02-05 13:24 UTC, Martin Entlicher
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Entlicher 2002-02-05 13:18:38 UTC
Thread dump in attachment. Don't know how to reproduce, it happend just for the
first time. However, I can not save my changes.
NetBeans 3.3.1 RC3
Comment 1 Martin Entlicher 2002-02-05 13:24:20 UTC
Created attachment 4569 [details]
The thread dump.
Comment 2 Martin Roskanin 2002-02-05 14:01:06 UTC
Reassigning to openide.
It is very similar deadlock as in the issue #10826, but I am not sure 
whether it is duplicate.
Please, reassign back if I am wrong.
Comment 3 Jan Zajicek 2002-02-06 13:17:16 UTC
If it is a duplicate then this is regression!
Comment 4 Peter Zavadsky 2002-02-12 08:58:03 UTC
The #10826 is not a duplicate its different and that prob is solved.

To this prob. From the thread dump it's posible to see there is a
waiting for finish of task (in AWT) which was scheduled to internal
UndoRedo RequestProcessor. But there is not possible detect which one
is the UndoRedo RP. There are just 2 candidates, OpenIDE RP 1 or 3.
But both are waiting for tasks. There is also a possibility the thread
has finished, e.g the task has thrown Error instead of exception. I
believe this was the case.

In the rev 1.53 Jesse removed the catching errors of RP tasks, in
editor module there are throwing of errors used in many places. 
Jessie I haven't find the thread dealing about, but some agreement
needs to be taken. Either catch Throwable in RP or request strongly no
task can throw Errors instead of Exceptions. or both.

CC Jessie and editor, please tell something to this.
Comment 5 Peter Zavadsky 2002-02-12 09:45:25 UTC
I'm sorry the Jessie's change came later then the prob occured so what
I said above is not fully true.
Comment 6 Peter Zavadsky 2002-02-12 10:25:40 UTC
Up to now I just named the UndoRedo internal RP.
change:
openide/../awt/UndoRedo.java [1.22]


Will probably also add more robust check to RP in case of ErrorManager
failure.
Comment 7 Peter Zavadsky 2002-02-12 10:43:34 UTC
I still guess the RP thread finished somehow. I find just one another
possibility it could happen. I.e. when was catched some exception from
the task and then some another one thrown from ErrorManager in the
exception handler. 
So I just added the more robust check to avoid this failure.

possible fix:
openide/../util/RequestProcessor.java [1.54]

Additional:
Jesse, please reconsidere if it wouldn't be better in RP to catch also
 Errors like before. It seems to me too error-prone unless we are sure
no module do throw errors instead of exceptions, from possible tasks.

Assigning to editor which can throw many errors in their code. Remove
it sinve the errors are not handled now, and close the bug then.

Comment 8 Jesse Glick 2002-02-12 12:31:07 UTC
Re. RequestProcessor.java 1.54: I think that rather than catching
Exception here, ErrorManager.getDefault and NbErrorManager.notify
should internally catch RuntimeException just to be as robust as
possible. More generally than catching in RP.

Re. catching Error in RP: I think catching Error is probably dangerous
(OutOfMemoryError?!) but LinkageError may make sense. Mutex is
essentially the same situation. Definitely if a module *does* throw a
non-Exception from a task, this should be fixed in the module ASAP.
Comment 9 Jesse Glick 2002-02-12 12:32:35 UTC
Also note that throwing of InternalError from a RP.java line 586
violates NB code conventions.
Comment 10 Peter Zavadsky 2002-02-12 14:50:11 UTC
I agree (that using errors is wrong and robust ErrorManager). Will you
take care about that? I mean fire bugs, tasks.
Comment 11 Martin Roskanin 2002-02-12 15:11:11 UTC
fixed in [maintrunk]

/cvs/editor/libsrc/org/netbeans/editor/BaseDocument.java,v  <--  
BaseDocument.java
new revision: 1.86; previous revision: 1.85

/cvs/editor/libsrc/org/netbeans/editor/EditorDebug.java,v  <--  
EditorDebug.java
new revision: 1.19; previous revision: 1.18

/cvs/editor/libsrc/org/netbeans/editor/FindSupport.java,v  <--  
FindSupport.java
new revision: 1.47; previous revision: 1.46

/cvs/editor/libsrc/org/netbeans/editor/SyntaxSeg.java,v  <--  
SyntaxSeg.java
new revision: 1.22; previous revision: 1.21

/cvs/editor/libsrc/org/netbeans/editor/ext/FileStorage.java,v  <--  
FileStorage.java
new revision: 1.21; previous revision: 1.20

/cvs/editor/libsrc/org/netbeans/editor/ext/java/JCFileProvider.java,v  
<--  JCFileProvider.java
new revision: 1.21; previous revision: 1.20
Comment 12 Jesse Glick 2002-02-12 16:17:21 UTC
Sure.
Comment 13 Jan Chalupa 2002-04-09 12:10:10 UTC
Should/could this be fixed in the next bugfix release and the Orion
release of FFJ?
Comment 14 Martin Roskanin 2002-04-10 09:49:39 UTC
Yes, I am going to prepare the fix and the integration notice.
Comment 15 Martin Roskanin 2002-04-10 10:00:40 UTC
the fix is easy, just replacing Error with RuntimeException as shown 
on the diff for BaseDocument.java between 1.85 and 1.86.

Other diffs of the modified files (see fix commit log above) are 
similar, so I didn't attach them.

diff -r1.85 -r1.86
920c920
<             throw new Error(WRITE_LOCK_MISSING);
---
>             throw new RuntimeException(WRITE_LOCK_MISSING);

Comment 16 Martin Roskanin 2002-04-12 15:43:47 UTC
integrated into [orion_fcs]

/cvs/editor/libsrc/org/netbeans/editor/BaseDocument.java,v  <--  
BaseDocument.java
new revision: 1.83.8.2.4.1; previous revision: 1.83.8.2

/cvs/editor/libsrc/org/netbeans/editor/EditorDebug.java,v  <--  
EditorDebug.java
new revision: 1.17.28.1.4.1; previous revision: 1.17.28.1

/cvs/editor/libsrc/org/netbeans/editor/FindSupport.java,v  <--  
FindSupport.java
new revision: 1.44.24.1; previous revision: 1.44

/cvs/editor/libsrc/org/netbeans/editor/SyntaxSeg.java,v  <--  
SyntaxSeg.java
new revision: 1.21.36.1; previous revision: 1.21

/cvs/editor/libsrc/org/netbeans/editor/ext/FileStorage.java,v  <--  
FileStorage.java
new revision: 1.19.24.1; previous revision: 1.19

/cvs/editor/libsrc/org/netbeans/editor/ext/java/JCFileProvider.java,v  
<--  JCFileProvider.java
new revision: 1.18.22.1; previous revision: 1.18
Comment 17 Jan Lahoda 2002-10-18 14:22:34 UTC
Hi,
   as this is not reliably reproducible bug and I have not seen it for
quite long time, I am marking it VERIFIED. Reopen if anybody disagrees.
Comment 18 Quality Engineering 2003-06-30 18:13:02 UTC
Resolved for 3.3.x or earlier, no new info since then -> closing.