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 236842 - Find Usages functionality causes IDE to freeze
Summary: Find Usages functionality causes IDE to freeze
Status: RESOLVED DUPLICATE of bug 236101
Alias: None
Product: platform
Classification: Unclassified
Component: JDK Problems (show other bugs)
Version: 7.4
Hardware: PC Mac OS X
: P1 normal with 3 votes (vote)
Assignee: Antonin Nebuzelsky
URL:
Keywords:
: 237950 (view as bug list)
Depends on:
Blocks:
 
Reported: 2013-10-07 14:57 UTC by MikeLind
Modified: 2013-12-12 12:35 UTC (History)
7 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Thread Dump (29.77 KB, application/octet-stream)
2013-10-07 14:57 UTC, MikeLind
Details
Sample Project (48.60 KB, application/zip)
2013-10-09 17:32 UTC, MikeLind
Details
proof of stalling usage search (1.03 KB, image/png)
2013-10-21 10:11 UTC, ymajoros
Details
proof of stalling usage search bis (1.95 KB, image/png)
2013-10-21 10:11 UTC, ymajoros
Details
thread dump (31.94 KB, text/plain)
2013-10-28 14:18 UTC, ymajoros
Details
second thread dump (usage search in "progress") (34.82 KB, text/plain)
2013-10-28 14:20 UTC, ymajoros
Details
Thread Dump for Find Usages, jdk7u45 (22.26 KB, text/plain)
2013-11-11 14:51 UTC, MikeLind
Details
Thread dump for analysis (13.23 KB, text/plain)
2013-12-05 17:24 UTC, mooch443
Details
Thread dump while a refactoring process is running (and IDE is hung) (19.65 KB, text/plain)
2013-12-12 03:20 UTC, toddfast
Details
Thread dump after refactoring has completed and the IDE is still hung (13.25 KB, text/plain)
2013-12-12 03:21 UTC, toddfast
Details

Note You need to log in before you can comment on or make changes to this bug.
Description MikeLind 2013-10-07 14:57:45 UTC
Created attachment 140861 [details]
Thread Dump

Selecting an interface and performing "Find Usages" causes IDE to freeze. This is a multiple-project Java EE/Maven app. I can reproduce this in 7.3.1 and 7.4rc2 by simply performing "Find Usages" on any interface in my project.
Comment 1 Ralph Ruijs 2013-10-09 08:41:04 UTC
I can't see anything wrong with the attached thread dumps. The described problem looks similar to the jdk7u40 or jdk8 problems there were recently on Mac. Can you please attach the information from the help->about menu? (NetBeans -> About Netbeans, on Mac)

Thanks!
Comment 2 MikeLind 2013-10-09 13:31:37 UTC
Product Version: NetBeans IDE 7.3.1 (Build 201306052037)
Java: 1.7.0_40; Java HotSpot(TM) 64-Bit Server VM 24.0-b56
Runtime: Java(TM) SE Runtime Environment 1.7.0_40-b43
System: Mac OS X version 10.8.5 running on x86_64; US-ASCII; en_US (nb)
User directory: /Users/Mike/Library/Application Support/NetBeans/7.3.1
Cache directory: /Users/Mike/Library/Caches/NetBeans/7.3.1
Comment 3 Ralph Ruijs 2013-10-09 15:10:17 UTC
I'm still not able to reproduce. If the problem still occurs, please attach steps to reproduce and preferably with a small test-project.

Thanks!
Comment 4 MikeLind 2013-10-09 17:31:24 UTC
I have attached a fresh sample project. I can reproduce the freeze every time with the following steps:

1. In EnterpriseApplication1-war in the Projects tab, navigate to src/java and open NewClass.java.
2. In the editor window, double click NewClass (class name), and then right-click and navigate to Find Usages on the context menu.
3. In the Find Usages results menu, no usages will be found, but shortly after the results come back, the IDE freezes and I kill to manually kill the process.
Comment 5 MikeLind 2013-10-09 17:32:19 UTC
Created attachment 140958 [details]
Sample Project

Sample project for reproducing bug.
Comment 6 Jiri Prox 2013-10-10 09:25:21 UTC
I would also recommend to use different JDK, there were reported several strange  deadlocks with jdk 1.7.0_40 on Mac
Comment 7 Ralph Ruijs 2013-10-10 09:54:05 UTC
Tested on:
Product Version: NetBeans IDE 7.3.1 (Build 201306052037)
Java: 1.7.0_40; Java HotSpot(TM) 64-Bit Server VM 24.0-b56
Runtime: Java(TM) SE Runtime Environment 1.7.0_40-b43
System: Mac OS X version 10.8.5 running on x86_64; UTF-8; en_US (nb)

still not able to reproduce. Please try to use a different jdk as Jirka Prox advised.
Comment 8 ymajoros 2013-10-21 09:58:31 UTC
I have the same problem. I've had it for 2 different projects, 2 different JDK's (1.7.0_17 32 bit here, had it in 64 bit more recent jdk, in my previous project too).

This is a maven project with about 20 modules.

Find usages task just keeps going forever. IDE itself is still usable, but some things (like another search usages) just don't work anymore.

I think just saying that some jdk has "some strange deadlocks" is not an acceptable solution. You should either point us to specific bugs, or leave this open.
Comment 9 ymajoros 2013-10-21 10:11:14 UTC
Created attachment 141340 [details]
proof of stalling usage search
Comment 10 ymajoros 2013-10-21 10:11:53 UTC
Created attachment 141341 [details]
proof of stalling usage search bis

Attached a screenshot with usage search stalled.
Comment 11 Jiri Prox 2013-10-21 11:59:24 UTC
ymajoros please attach the thread dump.

"Use another jdk" is not solution but quick workaround to keep IDE working
Comment 12 ymajoros 2013-10-21 12:18:12 UTC
Ok, but using another jdk doesn't solve the problem.
Comment 13 ymajoros 2013-10-28 14:09:07 UTC
Still doesn't work here. 

Why is this closed as incomplete without any comment?

Additional information: 

- I have a multi-module project
- In a module which is used by no other (typically, a web application in an ear project), it seems to work correctly (=usage search returns)
- In some modules where the problem always occurs, some dependent modules are not opened as projects in Netbeans (just FYI, I don't think that's the problem)
Comment 14 Ralph Ruijs 2013-10-28 14:12:48 UTC
(In reply to ymajoros from comment #13)
> Still doesn't work here. 
> 
> Why is this closed as incomplete without any comment?

I closed it as incomplete, as we are still waiting for the thread dump.

(In reply to Jiri Prox from comment #11)
> ymajoros please attach the thread dump.
Comment 15 ymajoros 2013-10-28 14:18:57 UTC
Created attachment 141606 [details]
thread dump
Comment 16 ymajoros 2013-10-28 14:20:45 UTC
Created attachment 141607 [details]
second thread dump (usage search in "progress")
Comment 17 ymajoros 2013-10-28 14:21:26 UTC
Added 2 thread dumps:

1- when problematic usage search has been triggered
2- when another usage search is tried after this
Comment 18 Ralph Ruijs 2013-10-28 14:38:42 UTC
(In reply to ymajoros from comment #15)
> Created attachment 141606 [details]
> thread dump

Thank you for the thread dump!


It seems to be stuck in the MavenRefactoringPlugin trying to find the parent file. Reassigning to Maven, please evaluate, thanks!
Comment 19 Milos Kleint 2013-11-01 10:03:05 UTC
http://hg.netbeans.org/core-main/rev/72537824f7e5

attempts only to minimize the cases when we need to go out and let maven resolve the artifact online, for some users (behind proxy I guess) it gets stuck for long time.

the issue here is likely that the artifact comes from local repository, then we set default central url as the remote repository and during resolution the connection is stuck (likely due to not allowed traffic rule within a company) and waits for timeout.

it would be interesting to experiment with what url is used in the end (if mirror and proxy settings from .m2/settings.xml are applied or not)
Comment 20 Tomas Danek 2013-11-04 15:01:51 UTC
MikeLind or ymajoros, can you please download latest daily build from
http://bits.netbeans.org/trunk/nightly/
and confirm that issue is fixed for you? Thanks in advance!
Comment 21 Ralph Ruijs 2013-11-04 18:22:55 UTC
*** Bug 237950 has been marked as a duplicate of this bug. ***
Comment 22 Tomas Danek 2013-11-11 12:37:15 UTC
one more request to verify the fix; please note, that fix cannot be part of patch release unless verified.
Comment 23 roben 2013-11-11 13:19:23 UTC
I just installed the latest nightly and it seems to work just fine! I'll continue to use this version productively for today and report back if the error reoccurs.
Comment 24 MikeLind 2013-11-11 14:09:39 UTC
I have just downloaded nightly build 201311080001, and "Find Usages" still causes the IDE to hang indefinitely. I had originally solved the issue by reverting to JDK 7u25, but then updated it to 7u45. 

This is still an issue, the behavior that I initially described still occurs.
Comment 25 Milos Kleint 2013-11-11 14:34:31 UTC
(In reply to MikeLind from comment #24)
> I have just downloaded nightly build 201311080001, and "Find Usages" still
> causes the IDE to hang indefinitely. I had originally solved the issue by
> reverting to JDK 7u25, but then updated it to 7u45. 
> 
> This is still an issue, the behavior that I initially described still occurs.

with the same stacktrace? can you perform a new thread dump for me?
Comment 26 MikeLind 2013-11-11 14:51:00 UTC
Created attachment 142055 [details]
Thread Dump for Find Usages, jdk7u45

Added attachment showing the thread dump when Find Usages is performed. 
System Info:
- Netbeans dev build 201311080001 
- JDK7u45
- Mac Book Pro Retina, OS X 10.9 (13A603)
Comment 27 Milos Kleint 2013-11-11 15:44:11 UTC
(In reply to MikeLind from comment #26)
> Created attachment 142055 [details]
> Thread Dump for Find Usages, jdk7u45
> 
> Added attachment showing the thread dump when Find Usages is performed. 
> System Info:
> - Netbeans dev build 201311080001 
> - JDK7u45
> - Mac Book Pro Retina, OS X 10.9 (13A603)

unfortunately no maven related stacktrace here, actually nothing at all appears to happen, including the find usages (refactoring modules) code.
Comment 28 MikeLind 2013-11-11 16:34:24 UTC
Well that is indeed unfortunate, because anytime I need to do anything productive, without risking a freeze, I have to switch over to eclipse. I don't feel like I should have to revert to older JDKs in order to make this product work, even on OS X.
Comment 29 roben 2013-11-11 17:14:14 UTC
Even after some hours using the nightly now the issue did not reappear for me.

Strangely, though, after switching back to 7.4 it works there now, too...
Comment 30 MikeLind 2013-11-11 17:48:36 UTC
The only thing I can do to correct my issue, is to switch back to JDK7u25. Switching to that JDK fixes the issue, but makes the IDE blurry (I have a retina display), and the only way to make the IDE support a retina display (that I've found) is to update to a newer JDK.
Comment 31 Milos Kleint 2013-11-13 15:58:46 UTC
reassigning back to refactoring, it's not clear that the latest comment are related to maven support.

There's only one case now that I can think of that the code would hang in maven code again and that's when item present in maven index (of local repository) is not present locally. Eg. if you scanned the local repo and then deleted it.

if the current solution in maven.refactoring proves still to be the problem, the only remaining choice is to perform the code that currently resides in MavenRefactoringElementImplementation.getParentFile() someplace else, like MavenRefactoringPlugin.prepare() however it I suspect it will just cause the dialog to hang in different place. However then we could probably strip the results that don't have a local mirror in a jar right away.
Comment 32 Ralph Ruijs 2013-11-13 16:30:20 UTC
(In reply to Milos Kleint from comment #31)
> reassigning back to refactoring, it's not clear that the latest comment are
> related to maven support.

There was a problem in maven support which has been fixed, I think it would have been best to keep the issue in the correct category.


MikeLind; I understand that switching to an older jdk is not an option, having a retina display, but without a ThreadDump showing something wrong there is not much we can do. Can you attach another thread dump from when the ide is completely frozen?

Thanks!
Comment 33 mooch443 2013-12-05 17:24:24 UTC
Created attachment 142876 [details]
Thread dump for analysis

This is a thread dump from my Netbeans 7.4 while hanging. Looks like there are some locks locking stuff (deadlock?).
Comment 34 toddfast 2013-12-12 02:32:46 UTC
This is also happening to me, and not only when doing Find Usages--any refactoring can cause it. By the way, the same problem occurs in NB 7.2 when running with JDK 1.7. I get the spinning beach ball and the IDE is completely hung.

Product Version: NetBeans IDE 7.4 (Build 201310111528)
Updates: NetBeans IDE is updated to version NetBeans 7.4 Patch 1
Java: 1.7.0_45; Java HotSpot(TM) 64-Bit Server VM 24.45-b08
Runtime: Java(TM) SE Runtime Environment 1.7.0_45-b18
System: Mac OS X version 10.9 running on x86_64; UTF-8; en_US (nb)

Guys, you know I love you, but this is a P0 blocker.
Comment 35 toddfast 2013-12-12 03:20:02 UTC
Created attachment 143085 [details]
Thread dump while a refactoring process is running (and IDE is hung)

Here is a thread dump while a refactoring process is running (and IDE is hung)
Comment 36 toddfast 2013-12-12 03:21:22 UTC
Created attachment 143086 [details]
Thread dump after refactoring has completed and the IDE is still hung
Comment 37 toddfast 2013-12-12 03:24:17 UTC
Guys, please see the previous two thread dumps for NetBeans 7.4 Patch 1. This is 100% reproducible on my system by doing Find Usages on any Java method.

Please note that the nightly build does NOT fix the issue.
Comment 38 toddfast 2013-12-12 03:39:04 UTC
One last bit of information.

I mentioned above that I can reliably reproduce this problem in NB 7.2 when using JDK 1.7.0_45 (and earlier). However I cannot reproduce when using NB 7.2 with any version of JDK 1.6. (Perhaps there is a JDK 7 switch that can be set to workaround this problem?)

I've also set the following command-line flags on NB 7.4 Patch 1 using JDK 1.7.0_45 and they had no effect:

    -J-Dapple.awt.graphics.UseQuartz=false
    -J-Dsun.java2d.dpiaware=false

My environment:

Product Version: NetBeans IDE 7.4 (Build 201310111528)
Updates: NetBeans IDE is updated to version NetBeans 7.4 Patch 1
Java: 1.7.0_45; Java HotSpot(TM) 64-Bit Server VM 24.45-b08
Runtime: Java(TM) SE Runtime Environment 1.7.0_45-b18
System: Mac OS X version 10.9 running on x86_64; UTF-8; en_US (nb)
Comment 39 Antonin Nebuzelsky 2013-12-12 12:35:44 UTC

*** This bug has been marked as a duplicate of bug 236101 ***