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 114378

Summary: Deadlock between FindInFilesAction and SearchScopeMainProject
Product: utilities Reporter: Martin Krauskopf <mkrauskopf>
Component: SearchAssignee: Marian Petras <mpetras>
Status: RESOLVED FIXED    
Severity: blocker CC: mmirilovic
Priority: P2 Keywords: RANDOM, THREAD
Version: 6.x   
Hardware: All   
OS: All   
Issue Type: DEFECT Exception Reporter:
Attachments: deadlock.txt
suggested patch (removed modifier 'synchronized')
binary patch (removed modifier 'synchronized')

Description Martin Krauskopf 2007-08-31 14:28:25 UTC
Random. See attachment.
Comment 1 Martin Krauskopf 2007-08-31 14:29:21 UTC
Created attachment 47885 [details]
deadlock.txt
Comment 2 Martin Krauskopf 2007-08-31 14:31:09 UTC
Product Version: NetBeans IDE Dev (Build 070830)
Java: 1.6.0_02-ea; Java HotSpot(TM) Client VM 1.6.0_02-ea-b02
System: Linux version 2.6.20-16-generic running on i386;
Comment 3 Martin Krauskopf 2007-08-31 14:34:26 UTC
Mariane you are the owner of utilities? Not sure?
Comment 4 Marian Petras 2007-08-31 14:42:36 UTC
Yes, I am the owner.
Comment 5 Marian Petras 2007-09-03 11:31:25 UTC
According to the reporter, this deadlock has occurred once. According to bug priority guidelines, random, hardly
reproducible deadlocks should be qualified as P2 ("happens fairly often") or P3. So I lower priority of this bug to P2.
Comment 6 Marian Petras 2007-09-03 14:41:55 UTC
I think I found the cause and solution. Method
org.netbeans.modules.search.project.AbstractProjectSearchScope.propertyChange(...) is synchronized but it seems there is
no need for the synchronization. It is the only synchronized method among all the methods in the class and its
subclasses. So the solution is to remove the 'synchronized' modifier from the method's declaration.
Comment 7 Marian Petras 2007-09-03 14:42:58 UTC
Created attachment 47984 [details]
suggested patch (removed modifier 'synchronized')
Comment 8 Marian Petras 2007-09-03 14:48:47 UTC
Created attachment 47986 [details]
binary patch (removed modifier 'synchronized')
Comment 9 Marian Petras 2007-09-03 14:50:31 UTC
I have attached both source code patch and a binary patch.

To apply the binary patch, put it to subdirectory 'ide8/modules/patches/org-netbeans-modules-utilities-project' of your
NetBeans installation directory.
Comment 10 Martin Krauskopf 2007-09-03 14:57:13 UTC
Do not have problem with applying source patches. But do not know why. I was not able to reproduce second time this
deadlock in a week. So if I apply a patch and does not get the deadlock it proves nothing. So probably either be sure
that it works ;) or just commit?
Comment 11 Marian Petras 2007-09-05 16:01:24 UTC
Fixed - committed to the trunk.

Modified file:
   utilities/project/src/org/netbeans/modules/search/project/AbstractProjectSearchScope.java   (1.3)

Diff:
http://utilities.netbeans.org/source/browse/utilities/project/src/org/netbeans/modules/search/project/AbstractProjectSearchScope.java?r1=1.2&r2=1.3&diff_format=u