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 41833

Summary: NB36 RC3 freezes while editing ant scripts
Product: platform Reporter: aldobrucale <aldobrucale>
Component: ExplorerAssignee: _ tboudreau <tboudreau>
Status: VERIFIED FIXED    
Severity: blocker CC: issues, jchalupa, lhasik, mgrummich, mmirilovic, pnejedly, pzajac, ttran
Priority: P1 Keywords: THREAD
Version: 3.x   
Hardware: All   
OS: All   
Issue Type: DEFECT Exception Reporter:
Attachments: My ide.log
Stacktrace
Patch to fix the problem
Replacement build of openide.jar for 3.6
Use this jar, not the previous attachment

Description aldobrucale 2004-04-08 11:04:36 UTC
It seems that clicking the icon of an ant target 
in the explorer immediately after editing the 
file (while the tree is being updated?) results 
in a deadlock. The same happens sometimes using 
the properties window, in particular setting the 
targer dependencies and using the combo boxes for 
refid.
Comment 1 aldobrucale 2004-04-08 11:06:05 UTC
Created attachment 14327 [details]
My ide.log
Comment 2 Marek Grummich 2004-04-08 12:35:56 UTC
Bad, I am able to reproduce this issue (deadlock) on my Linux Netbeans
3.6 RC3, j2sdk1.4.2_04. I am attaching stacktrace.
Comment 3 Marek Grummich 2004-04-08 12:36:35 UTC
Created attachment 14328 [details]
Stacktrace
Comment 4 Lukas Hasik 2004-04-08 13:38:16 UTC
reassignig -> Tim
Comment 5 _ tboudreau 2004-04-08 14:03:34 UTC
It's an artifact of a workaround I put in for a rare but potential 
problem when changing projects in the new projects system - to 
aggressively clear the node displayed by the property sheet only in 
the case that it has been destroyed.

The workaround is already removed in the trunk;  I'll attach a patch 
that makes this safe.
Comment 6 _ tboudreau 2004-04-08 14:33:46 UTC
Created attachment 14331 [details]
Patch to fix the problem
Comment 7 _ tboudreau 2004-04-08 14:41:00 UTC
Patch attached for this issue; it ensures PropertySetModelImpl is 
always accessed from the AWT thread.

There is a very very small risk with this patch that an ITE can 
occur after switching projects under the following conditions:
 - The property sheet is docked
 - An Ant node is selected
 - The project is changed

It is extremely rare (IMO rarer than this bug), and can only happen 
if the following sequence happens:
 - The project is changed
 - The NodeDestroyed event generated by changing projects is enqueued
 - The project change is keeping the AWT thread occupied, so the 
NodeDestroyed runs *afterward*
 - A single paint of the property sheet happens after the property 
change, but before the enqueued, AWT-ized NodeDestroyed event runs

Given that this is a pretty difficult to recreate scenario, it seems 
preferable to put this patch into 3.6 - the situation described 
above just throws an exception, it is not a deadlock.
Comment 8 Jan Chalupa 2004-04-13 10:45:30 UTC
Fix for 3.6 is available, but hasn't been integrated. Changing target
milestone to 'TBD'. Tim, please change to whatever is appropriate. I
don't think it's 3.6 though.
Comment 9 _ tboudreau 2004-04-15 18:24:31 UTC
The code in question is already deleted in the trunk, so marking as fixed.
Comment 10 _ tboudreau 2004-04-28 10:17:04 UTC
*** Issue 42482 has been marked as a duplicate of this issue. ***
Comment 11 _ tboudreau 2004-05-05 23:50:16 UTC
*** Issue 42830 has been marked as a duplicate of this issue. ***
Comment 12 _ tboudreau 2004-05-05 23:52:30 UTC
Folks, this is getting reported a bit against 3.6.  Not a lot, but a bit.  I can easily supply a 
3.6 openide.jar with this issue fixed; any possibility of autoupdating openide?
Comment 13 Jesse Glick 2004-05-06 01:48:54 UTC
*** Issue 42463 has been marked as a duplicate of this issue. ***
Comment 14 Jesse Glick 2004-05-06 02:07:29 UTC
This would certainly be a good candidate for an update.

I think the proposed patch is not quite complete; according to
comments in your own sources, PS.setCurrentNode has to be called from
EQ (quite reasonably), which PS.SPCL.PCL.pC in the attached stack
trace is not doing. Suggest that both PS.SPCL.pC (line 1001) and
PS.SPCL.PCL.pC (line 1046) should wrap their bodies in M.E.rA since
they cannot be sure what thread is calling them. Your patch does
replan to EQ inside the scope of the latter method, which would fix
the reported deadlock, but does not prevent other possible bugs from
occurring.

As usual, issue #35833 would have automatically rendered this bug
obsolete, since that jumbo patch replans all node event firing to EQ
automatically, which would allow you to remove a lot of verbose thread
safety code in propertysheet as well.
Comment 15 _ ttran 2004-05-07 08:42:17 UTC
Unfortunately work on issue #35833 is stalled.  Not in D
Comment 16 Jesse Glick 2004-05-11 17:14:50 UTC
*** Issue 43110 has been marked as a duplicate of this issue. ***
Comment 17 ehucka 2004-05-20 07:22:33 UTC
I've seen it about 5 times in a week. Sometimes the IDE started
directly to the deadlock. It needs a patch promptly.

I have RH9 linux GNOME2, JDK 1.4.2_04.
Comment 18 _ tboudreau 2004-06-17 19:17:10 UTC
*** Issue 42508 has been marked as a duplicate of this issue. ***
Comment 19 _ tboudreau 2004-08-18 01:29:36 UTC
*** Issue 47339 has been marked as a duplicate of this issue. ***
Comment 20 _ tboudreau 2004-08-26 15:27:07 UTC
Created attachment 17164 [details]
Replacement build of openide.jar for 3.6
Comment 21 _ tboudreau 2004-08-26 15:29:54 UTC
For folks having problems with this issue, I just attached a 
replacement build of openide.jar which includes the fix for this and 
a couple other issues involved in issue 47857.

To use it:
Shut down NetBeans
Make a backup of $NB_HOME/lib/openide.jar
Unzip openide36.jar.zip
Copy it over $NB_HOME/lib/openide.jar
Comment 22 _ tboudreau 2004-08-26 15:45:49 UTC
Created attachment 17165 [details]
Use this jar, not the previous attachment
Comment 23 Tomas Danek 2005-07-18 09:43:31 UTC
Tried this on 4.2 20050706. No deadlock occured (that would be VERY sad if so:))
Verified.