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 19487 - Infinite loop in NbErrorManager
Summary: Infinite loop in NbErrorManager
Status: CLOSED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: -- Other -- (show other bugs)
Version: 3.x
Hardware: PC Windows ME/2000
: P1 blocker (vote)
Assignee: Jesse Glick
URL:
Keywords:
Depends on:
Blocks: 19523
  Show dependency tree
 
Reported: 2002-01-16 15:40 UTC by Jan Becicka
Modified: 2008-12-22 20:04 UTC (History)
5 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Thread dump (32.84 KB, text/plain)
2002-01-16 16:52 UTC, Jan Becicka
Details
Proposed patch (5.80 KB, patch)
2002-01-17 11:43 UTC, Jesse Glick
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jan Becicka 2002-01-16 15:40:16 UTC
[NB 3.3.1 RC1]
Select any field in gurded block. (E.g. examples.advanced.MemoryView.jPanel1)
Invoke Property Sheet. Go to modifiers, click [...] -> Property Editor:
Modifiers is opened. Set static and Push OK.
Comment 1 Jan Zajicek 2002-01-16 16:15:18 UTC
Passing to Jesse.

Stacktrace will be attached later - IZ is tooooo slooow.
Comment 2 Jan Becicka 2002-01-16 16:52:10 UTC
Created attachment 4210 [details]
Thread dump
Comment 3 Jesse Glick 2002-01-16 17:07:40 UTC
Looks like NbErrorManager does not check for exceptions which include
themselves. Probably it should, though that in itself is not P1; only
the actual behavior.

My guess is that something the Java module does is causing this, but I
have to investigate to see. I don't like the way rethrowException is
written - the first call to copyAnnotation is gratuitous since
SourceException.IO already includes the nested trace, and the second
should be changed to annotate - but I don't see anything there which
would cause this bug. Could also be propertysheet code, etc.
Comment 4 _ ttran 2002-01-16 17:20:08 UTC
> Probably it should, though that in itself is not P1; only
> the actual behavior.

this is bad actual behavior.  We should guard ourselves from faulty
module code.  NbErrorManager is meant to be used in erroneous
situations.  If all is nice and good there would be much less reasons
to use the error manager.
Comment 5 Jesse Glick 2002-01-17 11:37:07 UTC
I have a patch.

1. Improves NbErrorManager to detect cyclic or redundant stack trace
annotations and print a message to log file and break the cycle.

2. There was a serious bug in Java Hierarchy code. It tried to use
ErrorManager to annotate an InvocationTargetException. Not only is
this useless - the exception itself includes a nested throwable, no
need to add an annotation - but the code was written backwards and
actually wound up throwing a ClassCastException, which managed to
trigger the cyclic case somehow.

3. There was a minor bug in property sheet code - again no need to
annotate ITE's, that will just cause redundant info to be printed to
the log file.

The patch solves all three problems. I will also file a separate patch
for the java module (SourceText) which is probably not required for
this bug and can go in for 3.4.
Comment 6 Jesse Glick 2002-01-17 11:43:16 UTC
Created attachment 4232 [details]
Proposed patch
Comment 7 _ ttran 2002-01-17 12:05:23 UTC
Jesse, the diff look fine to me, please commit it to trunk, mark this
one as fixed, set the 3.3.1_CANDIDATE keyword and wait for approvals
to commit it to release33.  [You have my approval.]

Thanks a lot.
Comment 8 Jesse Glick 2002-01-17 12:47:54 UTC
Fixed in the trunk. I would still appreciate some comment from Svata
re. ElementNode, and from one of the prop sheet guys re. PropertyPanel
(all three worked on the patched method at one time or another
according to cvs annotate).

committed   * Up-To-Date  1.30       
core/src/org/netbeans/core/NbErrorManager.java
committed   * Up-To-Date  1.91       
openide/src/org/openide/explorer/propertysheet/PropertyPanel.java
committed   * Up-To-Date  1.44       
openide/src/org/openide/src/nodes/ElementNode.java

Note that I have tested the fix only against trunk code, I have not
specifically tried it against release33 branch code yet in case there
is any significant divergence already (though of course I would do so
before committing to that branch).

The bug is easy to reproduce as described; without the patch, the IDE
freezes with 100% CPU and fills up the log file; with it, a nice
Information dialog "Attempt to insert into guarded block..." is shown,
the OK on the property editor dialog is cancelled (dialog stays open),
some stuff is put into ide.log with details, and that is all.
Comment 9 David Strupl 2002-01-17 13:43:47 UTC
PropertyPanel change seems fine from my point of view.
Comment 10 Jan Zajicek 2002-01-17 15:46:05 UTC
Checked and tested in the trunk continuous build # 20020117-1417. No
problems found - Verified in the trunk.
Comment 11 eadams 2002-01-17 15:57:23 UTC
Approved.
Comment 12 Jan Chalupa 2002-01-17 15:58:17 UTC
Approved by QA for 3.3.1.
Comment 13 iformanek 2002-01-17 16:02:47 UTC
Approved
Comment 14 Jesse Glick 2002-01-17 16:11:52 UTC
In for 3.3.1, thanks everyone.

committed   * Up-To-Date  1.27.2.2   
core/src/org/netbeans/core/NbErrorManager.java
committed   * Up-To-Date  1.89.2.4   
openide/src/org/openide/explorer/propertysheet/PropertyPanel.java
committed   * Up-To-Date  1.42.12.2  
openide/src/org/openide/src/nodes/ElementNode.java
Comment 15 Jan Zajicek 2002-01-18 11:53:04 UTC
Verified in build #200201180727.
Comment 16 Quality Engineering 2003-07-01 16:47:46 UTC
Resolved for 3.4.x or earlier, no new info since then -> closing.