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 30907 - DEADLOCK: When click on any node in Runtime TAB
Summary: DEADLOCK: When click on any node in Runtime TAB
Status: VERIFIED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: Nodes (show other bugs)
Version: 3.x
Hardware: PC Linux
: P1 blocker (vote)
Assignee: Petr Hrebejk
URL:
Keywords: T9Y, THREAD
: 25725 30792 30927 31897 34152 (view as bug list)
Depends on:
Blocks:
 
Reported: 2003-02-10 14:30 UTC by dmladek
Modified: 2008-12-23 14:27 UTC (History)
9 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
FTD (13.59 KB, text/plain)
2003-02-10 14:31 UTC, dmladek
Details
here is another FTD caused by selecting SystemProperties node (13.84 KB, text/plain)
2003-02-10 15:28 UTC, dmladek
Details
similar FTD to previous but now the ide freezed after a while of work in RunTime TAB (14.68 KB, text/plain)
2003-02-11 14:33 UTC, dmladek
Details
2 stacktraces separated by ------, a Deadlock when opening the project node in the project build. (21.12 KB, text/plain)
2003-02-11 15:05 UTC, Tomas Zezula
Details
a workaround (disables wait cursor) (1.67 KB, patch)
2003-02-12 14:16 UTC, Jiri Rechtacek
Details | Diff
I guess that this is a fix, can anyone try it? (9.08 KB, patch)
2003-02-17 16:03 UTC, Jaroslav Tulach
Details | Diff
Runtime tab nodes, Bundle nodes work fine, please give it a try (13.40 KB, patch)
2003-02-17 17:33 UTC, Jaroslav Tulach
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description dmladek 2003-02-10 14:30:51 UTC
Product Version       = NetBeans IDE Dev (Build
200302100100)
  IDE Versioning        = IDE/1 spec=3.36
impl=200302100100
  Operating System      = Linux version 2.4.18
running on i386
  Java; VM; Vendor      = 1.4.1_01; Java
HotSpot(TM) Client VM 1.4.1_01-b01; Sun
Microsystems Inc.
  Java Home             =
/usr/java/j2sdk1.4/sun/jdk1.4.1_01/jre
  System Locale; Encod. = cs_CZ; ISO-8859-2
  Home Dir; Current Dir = /home.local/danielm;
/DISKS/storage3/forte/NBdev-last/netbeans/bin
  IDE Install; User Dir =
/home.local/danielm/NBdev-last;
/home.local/danielm/.netbeans/dev
-------------------------------------------------------------------------------


Nothing to add...please see the FullThreadDump
Comment 1 dmladek 2003-02-10 14:31:14 UTC
Created attachment 8872 [details]
FTD
Comment 2 dmladek 2003-02-10 15:20:16 UTC
The latest TestResult also reflect this issue, but the strange thing
about when tests are performed automaticaly is...
that ide doesn't hang up....it's just currious...:-/

I'm CC'ing Martin as he told me his recently done some changes in
implementation of getting childrens....
Comment 3 dmladek 2003-02-10 15:26:18 UTC
and is fully reproductable:-( (or for investigation should I smile ;-)

And IDE freez even if I try to access any of nodes under RunTime
TAB...so Martin is inocent;-)
Comment 4 dmladek 2003-02-10 15:28:41 UTC
Created attachment 8873 [details]
here is another FTD caused by selecting SystemProperties node
Comment 5 Petr Hrebejk 2003-02-10 17:26:41 UTC
CCing Jesse. According to Jardas analysis this looks like a bug in
Mutex, which I probably won't be able to fix. Jarda suggested Jesse
could know what's the problem. He wrote new test into MutextTest.java 
(testReadWriteRead method) however this test seems to pass.
Comment 6 Petr Hrebejk 2003-02-10 17:27:28 UTC
*** Issue 30792 has been marked as a duplicate of this issue. ***
Comment 7 Jesse Glick 2003-02-10 18:22:58 UTC
Sorry, I don't know anything about Mutex really. Have no idea what is
going on here.
Comment 8 dmladek 2003-02-11 09:48:21 UTC
Changing the summary to reflect the current reality...
Comment 9 dmladek 2003-02-11 09:56:54 UTC
sorry, I adding my comments in a bits :-(


This must be kinda regression since last WE (Feb-5, 03)
In this build or very close arround it had to work...

I'll check it for you (hope I find time)... otherwise give mi a note
you don't need it
Comment 10 Petr Hrebejk 2003-02-11 10:04:21 UTC
Would be nice. Thanks
Comment 11 Petr Hrebejk 2003-02-11 12:36:00 UTC
*** Issue 30927 has been marked as a duplicate of this issue. ***
Comment 12 Milan Kubec 2003-02-11 14:13:16 UTC
Increasing prio to P1, because this bug makes new projects build
running on linux completly unusable.
Comment 13 Petr Hrebejk 2003-02-11 14:13:38 UTC
Should be fixed. By replacing notify by notifyAll in Mutex. (as Petr
Nejedly) suggested. Please reopen if the problem perists.
Comment 14 dmladek 2003-02-11 14:19:36 UTC
:-/ I dind't find when the deadlock has began appearing :-(

I think that it is because I'm using modulest from autoupdate,
ecpecialu whole XtestTools and this combination leads me to deadlock
on whole available builds till last WE which I checked as the last build.

I must say thst my colleague dosen't meet this deadlock but he doesn't
use NOW those autoupdate's modules...


Anyway:
The patch which Peter provided me is working for me:-)
Thanks
Comment 15 dmladek 2003-02-11 14:22:05 UTC
I'm courrious how the bug could be only RESOLVED (and nothing more)?
Comment 16 dmladek 2003-02-11 14:23:20 UTC
Should be RESOLVE FIXED
Comment 17 dmladek 2003-02-11 14:31:37 UTC
I have to reopen :-(

The deadlock isn't immediately after I clicked into RunTime TAB area,
but occures after a while.... 
I still had opened Runtime TAB... and was writing into IZ, then I
found again deadlock:-( attaching its FTD....
Comment 18 dmladek 2003-02-11 14:33:51 UTC
Created attachment 8897 [details]
similar FTD to previous but now the ide freezed after a while of work in RunTime TAB
Comment 19 Tomas Zezula 2003-02-11 15:05:43 UTC
Created attachment 8900 [details]
2 stacktraces separated by ------, a Deadlock when opening the project node in the project build.
Comment 20 Tomas Zezula 2003-02-12 10:25:05 UTC
Changed priority to P1, blocks development of project branch.
Comment 21 dmladek 2003-02-12 11:48:04 UTC
Jirka has just enter a new DEADLOCK issue #30986

I'm not realy good at diagnosting deadlock in FTDs :-(
but with the help of Martin I'm close to idea that it might be even
duplicate... even thought thread dumps very differe to each other.

Everything ends in incriminated Mutex


(but that becasue htere mixt be also problems in VCS? :-/)
Comment 22 Jiri Rechtacek 2003-02-12 14:16:35 UTC
Created attachment 8917 [details]
a workaround (disables wait cursor)
Comment 23 Jiri Rechtacek 2003-02-12 14:22:08 UTC
I attached a workaround which disables using of the wait cursor on
expanding node. It prevents this deadlock but the defect must be
fixed. (for playing with it you can set/unset the property
"netbeans.wait.disabled"). The patch set disable as default. Should I
commit this workaround to trunk?
Comment 24 Tomas Zezula 2003-02-12 14:43:58 UTC
It seems, that the patch works fine. Please commit it to the trunk.
Comment 25 dnoyeB 2003-02-12 14:56:21 UTC
Could one comment on why notifyAll would fix a deadlock?  It
shouldn't, but it may change the timing.

Also could one post the files affected.  I enjoy looking into some of
the more interesting fixes and such.

Thanks!
Comment 26 Jiri Rechtacek 2003-02-12 15:22:25 UTC
I commited the temporary workaround (workaround30907.diff) to
maintrunk; it should be reverted ASAP.
Comment 27 Petr Hrebejk 2003-02-17 12:44:37 UTC
Jarda wants that bug.
Comment 28 Jaroslav Tulach 2003-02-17 16:03:31 UTC
Created attachment 8989 [details]
I guess that this is a fix, can anyone try it?
Comment 29 Jiri Rechtacek 2003-02-17 16:32:08 UTC
unfortunately, the livelock appeared again ;-(( the stacktraces as
same as the stacktraces attached.
Comment 30 dnoyeB 2003-02-17 16:48:49 UTC
I am detecting a few instances of double checked locking in
Children.java.  We all know this does not work in Java right?

Seems like its time for a new PMD Rule :D

And could someone give me a tip on detecting the deadlock in a thread
dump.  The ones from the applets usually say "dealock here" but I
can't find it in the dumps from this issue.

Thanks.
Comment 31 dnoyeB 2003-02-17 16:55:06 UTC
the double checked locking is on line 1192 of r1.114.

I'll take my other thread dump and how to apply the attached patches
with NB to the dev mailing list...
Comment 32 Jaroslav Tulach 2003-02-17 17:33:30 UTC
Created attachment 8993 [details]
Runtime tab nodes, Bundle nodes work fine, please give it a try
Comment 33 Jaroslav Tulach 2003-02-17 17:38:38 UTC
To double check locking. Yes, it is there. But please file another
issue, the problem is not related to those reported here.

To Hrebejk: I hope we are waiting for integration of the last patch.
So reassigning to you. We can walk thru the patch tomorrow, if nobody
reports problems.
Comment 34 Jiri Rechtacek 2003-02-17 18:38:17 UTC
Fine, it seems the last patch really fixes it, works with busy cursor
on expand node. All well known cases *doesn't* lead to any livelock on
maintrunk. Thanks. The guys on projects branch verify the fix more
deep :-) 
Comment 35 Tomas Zezula 2003-02-18 08:26:18 UTC
The last patch seems to fix the problem, thanks Jarda.
Comment 36 Petr Hrebejk 2003-02-18 13:54:39 UTC
Jarda's patch applied

Checking in src/org/openide/explorer/view/VisualizerNode.java;
/cvs/openide/src/org/openide/explorer/view/VisualizerNode.java,v  <--
 VisualizerNode.java
new revision: 1.30; previous revision: 1.29
done
Processing log script arguments...
More commits to come...
Checking in src/org/openide/nodes/Children.java;
/cvs/openide/src/org/openide/nodes/Children.java,v  <--  Children.java
new revision: 1.115; previous revision: 1.114
done
Checking in src/org/openide/nodes/ChildrenArray.java;
/cvs/openide/src/org/openide/nodes/ChildrenArray.java,v  <-- 
ChildrenArray.java
new revision: 1.10; previous revision: 1.9
done
Processing log script arguments...
More commits to come...
Checking in test/unit/src/org/openide/nodes/ChildrenKeysTest.java;
/cvs/openide/test/unit/src/org/openide/nodes/ChildrenKeysTest.java,v 
<--  ChildrenKeysTest.java
new revision: 1.4; previous revision: 1.3
Comment 37 dnoyeB 2003-02-18 15:08:43 UTC
Looking at the patch, line 473 inReadAccess should be declared as
volatile as it is accessed by seperate threads, outside of any
synchronization block.  

The fact that you are not synchronizing on inReadAccess and that its
run in a seperate thread suggests that it is not imperitive that you
catch its immediate value.  But since you are checking for that value
anyway, might as well make the check more (theoretically) reliable.
Comment 38 Jiri Rechtacek 2003-02-18 15:27:20 UTC
The temporary workaround30907.diff was removed also, so the busy
cursor on expand folder was enabled too.
Comment 39 Jaroslav Tulach 2003-02-18 15:37:31 UTC
Ad. volatile variable: No need for that as the variable is accessed by
the thread that invokes Mutex.postWriteRequest. Because in spite of
that strange name the runnable runs either immediatelly or later, but
always in the same thread. 
Comment 40 dnoyeB 2003-02-18 15:45:01 UTC
affirmative.
Comment 41 Petr Hrebejk 2003-03-17 11:22:50 UTC
*** Issue 31897 has been marked as a duplicate of this issue. ***
Comment 42 dmladek 2003-04-07 17:08:26 UTC
Comfirming as fixed on Sun ONE Studio 5, Standard Edition (Build 030406)
Comment 43 Petr Hrebejk 2003-05-06 15:25:10 UTC
*** Issue 25725 has been marked as a duplicate of this issue. ***
Comment 44 Petr Hrebejk 2003-06-04 16:16:04 UTC
*** Issue 34152 has been marked as a duplicate of this issue. ***
Comment 45 Quality Engineering 2008-12-23 14:27:28 UTC
This issue had *4 votes* before move to platform component