Please use the Apache issue tracking system for new NetBeans issues ( !!
Bug 205859 - deadlock on projects scanning
deadlock on projects scanning
Product: java
Classification: Unclassified
Component: Project
PC Linux
: P2 (vote)
: 7.1.1
Assigned To: Tomas Zezula
Depends on:
  Show dependency treegraph
Reported: 2011-12-02 15:17 UTC by anli
Modified: 2012-02-29 12:24 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT

IDE session log file at deadlock (30.79 KB, text/plain)
2011-12-02 15:17 UTC, anli
thread dump on deadlock (71.92 KB, text/plain)
2011-12-05 12:55 UTC, anli
thread dump on deadlock, after fix, from golden (77.63 KB, text/plain)
2012-01-16 09:38 UTC, anli

Note You need to log in before you can comment on or make changes to this bug.
Description anli 2011-12-02 15:17:39 UTC
Created attachment 113766 [details]
IDE session log file at deadlock

Sorry, next deadlock here - described initially in this forum thread (with attachment):

I'm also attaching log file after IDE start and before closing the IDE.
Starting with clean userdir doesn't help also.
Comment 1 anli 2011-12-02 15:52:15 UTC
It seems like the root of problem is a set of file opened in the editor: if to close all editor tabs before closing the IDE, chances to successfully open next IDE sessions are high: I have sequentially done it few times (5-6) just now.
Comment 2 Tomas Zezula 2011-12-05 10:27:05 UTC
From the screenshot it seems that the indexing thread is not yet active it waits until the projects are opened and then it starts to do the scanning. As there is the "Opening Projects" progress it does not seem to be parsing api.

Please can you attach the thread dump when the deadlock happened.
See how to generate the thread dump.
Comment 3 anli 2011-12-05 12:55:58 UTC
Created attachment 113818 [details]
thread dump on deadlock

As requested, a dump is attached.
Comment 4 Tomas Zezula 2011-12-05 13:01:58 UTC
Comment 5 Tomas Zezula 2011-12-05 13:06:35 UTC
caused by J2SEProject$ProjectOpenedHookImpl.projectOpened
Comment 6 Tomas Zezula 2011-12-05 15:25:50 UTC
Fixed jet-main c2e8e416dc43
Comment 7 anli 2011-12-05 15:37:56 UTC
Tomas, thanks!

Are there any chances the fix will be merged into final (or next rc) 7.1?
Comment 8 Tomas Zezula 2011-12-05 17:48:56 UTC
Depends on QA.
Only issues approved by QA are integrated into 7.1.
If it's not integrated into 7.1 it will become part of patch release 7.1.1.
If you think that it should be a part of 7.1 increase the priority otherwise no chances.
Adding the boss of QA to cc list. :-)
Comment 9 anli 2011-12-05 18:07:21 UTC

As far as I have found a workaround (to close all editor tabs before closing IDE session), I'm not sure it would be honest from my side to increase the priority. OTOH the issue is too outstanding - to my taste, of course - to be ignored by QA. But it is my taste only :-)

And thanks again for quick fixing.
Comment 10 Tomas Zezula 2011-12-05 19:02:15 UTC
Increasing at least to P2.
Comment 11 Marian Mirilovic 2011-12-05 20:51:40 UTC
We have just one report so far .... 

do you think it's just recent regression ? If so we will fix it, if not I suggest to leave it open for 7.1 (we are close to FCS date) and fix it in 7.1.1(patch1).
Comment 12 Tomas Zezula 2011-12-06 09:17:31 UTC
The fixed code is there from time of NB 6.0. Maybe some thread ordering changed, but it's hard to say with lazy projects.
Comment 13 Quality Engineering 2011-12-06 12:13:41 UTC
Integrated into 'main-golden'
User: Tomas Zezula <>
Log: #205859:deadlock on projects scanning
Comment 14 Marian Mirilovic 2011-12-06 12:53:50 UTC
(In reply to comment #12)
> The fixed code is there from time of NB 6.0. Maybe some thread ordering
> changed, but it's hard to say with lazy projects.

So leaving for the patch ...
Comment 15 anli 2012-01-15 20:55:06 UTC
I have built the IDE from main-golden. Unfortunately the issue still exists with absolutely the same symptoms.
Comment 16 Jiri Prox 2012-01-16 09:03:23 UTC
Can you please capture new thread dump and attach it here? 
Comment 17 Tomas Zezula 2012-01-16 09:07:00 UTC
This deadlock cannot happen as the caller thread does not hold any lock.
If you have deadlock it's probably some other problem. Please attach a stack trace.
Comment 18 anli 2012-01-16 09:38:00 UTC
Created attachment 114927 [details]
thread dump on deadlock, after fix, from golden

The next thread dump is attached. Just the only editor tab was opened with htm-file.

As far as I'm not sure why reopened bug was closed, I don't reopen it again :-)
Comment 19 Tomas Zezula 2012-01-16 09:55:54 UTC
The bug was closed as it's fixed :-)
According to the new stack trace you have a deadlock in Scala support plugin.

The relevant stack trace where locks are taken in wrong order is:

at org.netbeans.modules.parsing.impl.TaskProcessor.runUserTask(
        at org.netbeans.modules.parsing.api.ParserManager.parse(
        at org.netbeans.modules.scala.project.MainClassUpdater.addFileChangeListener(
        at org.netbeans.modules.scala.project.MainClassUpdater.<init>(
        at org.netbeans.modules.scala.project.J2SEProject$ProjectOpenedHookImpl.projectOpened(

So I will create a new issue on Scala later today and add you on CC.
Comment 20 anli 2012-01-16 10:07:27 UTC
(In reply to comment #19)
> So I will create a new issue on Scala later today and add you on CC.

Comment 21 Tomas Zezula 2012-01-16 17:08:33 UTC
I've created a new issue for NB-Scala
Comment 22 anli 2012-01-16 17:31:04 UTC

I'm not registered at, but I have tried your patch for Scala plugin - the problem has gone, thanks!
Comment 23 Jiri Prox 2012-02-06 13:33:24 UTC
Comment 24 Tomas Zezula 2012-02-10 11:00:47 UTC
Integrated into release71_fixes: 4a2ec826d093, 6560382c51b3
Comment 25 Quality Engineering 2012-02-11 02:53:05 UTC
Integrated into 'releases', will be available in build *201202102200* or newer. Wait for official and publicly available build.
User: Tomas Zezula <>
Log: #205859:deadlock on projects scanning

By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo