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 234671 - Deadlock when closing project properties
Summary: Deadlock when closing project properties
Status: VERIFIED FIXED
Alias: None
Product: editor
Classification: Unclassified
Component: Formatting & Indentation (show other bugs)
Version: 7.4
Hardware: PC Windows 7
: P2 normal (vote)
Assignee: Dusan Balek
URL:
Keywords: 7.4_HR_FIX, RANDOM
: 234668 235188 (view as bug list)
Depends on:
Blocks:
 
Reported: 2013-08-20 19:57 UTC by markiewb
Modified: 2013-09-10 08:38 UTC (History)
4 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Application snapshot incl. threaddump (JVisualVM file) (12.15 KB, application/octet-stream)
2013-08-20 19:57 UTC, markiewb
Details
Sample project - created via NB wizards (3.76 KB, application/octet-stream)
2013-08-20 19:58 UTC, markiewb
Details
Screenshot of the IDE when trying to save (60.97 KB, image/png)
2013-08-20 19:59 UTC, markiewb
Details
Thread dump - Ant Web project (36.28 KB, application/octet-stream)
2013-08-23 15:12 UTC, Martin Janicek
Details
Thread dump - Maven J2SE project (45.95 KB, application/octet-stream)
2013-08-23 15:12 UTC, Martin Janicek
Details
new threaddump (38.47 KB, application/octet-stream)
2013-09-04 12:23 UTC, markiewb
Details
TD 1 changing from Glassfish to Tomcat (43.19 KB, application/octet-stream)
2013-09-05 23:51 UTC, mdeggersbeans
Details
TD 2 changing from Glassfish to Tomcat (44.50 KB, application/octet-stream)
2013-09-05 23:52 UTC, mdeggersbeans
Details
TD 3 changing from Glassfish to Tomcat (45.10 KB, application/octet-stream)
2013-09-05 23:53 UTC, mdeggersbeans
Details

Note You need to log in before you can comment on or make changes to this bug.
Description markiewb 2013-08-20 19:57:24 UTC
Created attachment 138947 [details]
Application snapshot incl. threaddump (JVisualVM file)

* New Project...|Maven|Web Application and continue through the wizard pages
* Choose Tomcat and Java EE6 Web on the last page
* "Clean and Build"
* Right click on project node and choose "Properties" -> dialog opens
* Click at every the category in left tree in sequential order: General, then Sources, then Configuration ... then Hints (in a fast manner [sic!] that is important)
* Click OK to close the dialog -> dialog closes and dialog "Saving project data" is opened

ACTUAL: dialog "Saving project data" does not finish its task. Canceling is not possible. IDE has to be killed via task manager and restarted. See the thread dump and application snapshot (taken via JVisualVM)

EXPECTED: project properties can be saved. No deadlock

---
Product Version: NetBeans IDE Dev (Build 201308192300) - Java EE Edition
Java: 1.7.0_25; Java HotSpot(TM) 64-Bit Server VM 23.25-b01
Runtime: Java(TM) SE Runtime Environment 1.7.0_25-b16
System: Windows 7 version 6.1 running on amd64; Cp1252; en_US (nb)
Comment 1 markiewb 2013-08-20 19:58:29 UTC
Created attachment 138948 [details]
Sample project - created via NB wizards
Comment 2 markiewb 2013-08-20 19:59:18 UTC
Created attachment 138949 [details]
Screenshot of the IDE when trying to save
Comment 3 markiewb 2013-08-20 22:11:15 UTC
Similar to https://netbeans.org/bugzilla/show_bug.cgi?id=234668 ?
Comment 4 Milos Kleint 2013-08-21 05:57:03 UTC
"Default RequestProcessor" thread holds project write mutex and appears to be waiting on some other thread however that one is likely waiting for the project write mutex to be released. reassigning to javaee/maven for evaluation
Comment 5 Martin Janicek 2013-08-21 08:11:09 UTC
*** Bug 234668 has been marked as a duplicate of this bug. ***
Comment 6 Martin Janicek 2013-08-21 08:27:25 UTC
At first I thought this might be a recent issue, but the log from issue 234668 shows up it has been in the code for a while (used build is from 9.7.2013)

I wasn't able to simply reproduce the problem so I believe it's a random issue (changing to P2). Anyway I'll finish the unfinished work I have here and take a look at it.
Comment 7 grafviktor 2013-08-23 09:20:14 UTC
I can confirm this issue. To 100% reproduce it you can make the following steps
1. New project -> Maven -> Web Application, press Next
2. Name & Location window - set project name, leave other fields by default, press Next
3. Settings window - all by default(I use Apache Tomcat server, i didn't check if there is the same bug on another application server), press finish.
4. Add any java class to your newly created project
5. Go to project settings and choose "Run" category, do not change anything, just press OK button. Here you go.
Comment 8 Martin Janicek 2013-08-23 12:29:44 UTC
Unfortunately these steps works fine for me (hard to say why). If you are able to reproduce the problem reliably, would it be possible to test whether the same problem occurs also with different application server (e.g. Glassfish)? Thanks!
Comment 9 Petr Jiricka 2013-08-23 14:08:48 UTC
This happened to me now as well (with JBoss).
Comment 10 Martin Janicek 2013-08-23 15:09:28 UTC
Neither related to application server nor to build system. I'm finally able to reliably reproduce the problem here at home (Windows 7) using modified steps from the description (yesterday at work it was pretty random - using Ubuntu).

It's reproducible with Maven Web application, Maven J2SE application and also with Ant web project. Only project where I'm not able to reproduce is J2SE Ant, weird..

So my steps:
1/ Create new project (Ant/Maven Web or Maven J2SE)
2/ Go to project properties
3/ In the tree hold the down arrow on the keyboard (this will be taking some time so you shouldn't be able to go at the last item really fast)
4/ Wait like a sec and spam OK button to confirm customizer
--> Saving dialog appear but won't disappear :)

I'm going to attach thread dumps from other projects then Maven Web.
Comment 11 Martin Janicek 2013-08-23 15:12:12 UTC
Created attachment 139141 [details]
Thread dump - Ant Web project
Comment 12 Martin Janicek 2013-08-23 15:12:36 UTC
Created attachment 139142 [details]
Thread dump - Maven J2SE project
Comment 13 Martin Janicek 2013-08-23 15:14:54 UTC
Reassigning to general projects for further evaluation
Comment 14 grafviktor 2013-08-23 17:56:04 UTC
(In reply to Martin Janicek from comment #10)
> 
> So my steps:
> 1/ Create new project (Ant/Maven Web or Maven J2SE)
> 2/ Go to project properties
> 3/ In the tree hold the down arrow on the keyboard (this will be taking some
> time so you shouldn't be able to go at the last item really fast)
> 4/ Wait like a sec and spam OK button to confirm customizer
> --> Saving dialog appear but won't disappear :)
> 
> I'm going to attach thread dumps from other projects then Maven Web.

Hello Martin.
I've just tested and unfortunately neither your recipe nor my own one works on my home Linux machine. It looks like it's a thread problem and maybe the bug is OS dependent. I will try with Glassfish and win7, will let you know a bit later.
Comment 15 markiewb 2013-08-25 17:29:13 UTC
(In reply to Martin Janicek from comment #10)
> It's reproducible with Maven Web application, Maven J2SE application and
> also with Ant web project. Only project where I'm not able to reproduce is
> J2SE Ant, weird..
> 
> So my steps:
> 1/ Create new project (Ant/Maven Web or Maven J2SE)
> 2/ Go to project properties
> 3/ In the tree hold the down arrow on the keyboard (this will be taking some
> time so you shouldn't be able to go at the last item really fast)
> 4/ Wait like a sec and spam OK button to confirm customizer
> --> Saving dialog appear but won't disappear :)
> 
> I'm going to attach thread dumps from other projects then Maven Web.

It is easier to reproduce it the following way
1/ Create new maven-based web application using the wizard (BTW: I left the default selection "Apache Tomcat" and "Java EE 6 Web" at the last wizard page)
2/ Restart the IDE
2/ Go to project properties of the newly created project
3/ Click the category Run
4/ Click OK to close the dialog -> never ending dialog...

Product Version: NetBeans IDE Dev (Build 201308240953)
Java: 1.7.0_25; Java HotSpot(TM) 64-Bit Server VM 23.25-b01
Runtime: Java(TM) SE Runtime Environment 1.7.0_25-b16
System: Windows 7 version 6.1 running on amd64; Cp1252; en_US (nb)
Comment 16 Milos Kleint 2013-08-26 05:59:29 UTC
it appears that in both cases (as attached) the problem is related to the editor formatting options panel.
1. the customizer panel stores it's setting off-AWT under project mutex write lock.
2. the FormattingCustomizerPanel attempts to call org.netbeans.modules.editor.settings.storage.preferences.ProxyPreferencesImpl.get(ProxyPreferencesImpl.java:114) but that's currently locked by other threads.
3. in AWT this code attempts to aquire project read mutex (blocked by 1.) while holding lock on ProxyPreferencesImpl
	- locked <0x00000000f11b7bf8> (a org.openide.util.Mutex$QueueCell)
	at org.openide.util.Mutex.enterImpl(Mutex.java:734)
	at org.openide.util.Mutex.enter(Mutex.java:641)
	at org.openide.util.Mutex.readEnter(Mutex.java:624)
	at org.openide.util.Mutex.readAccess(Mutex.java:292)
	at org.netbeans.modules.projectapi.AuxiliaryConfigBasedPreferencesProvider$AuxiliaryConfigBasedPreferences.get(AuxiliaryConfigBasedPreferencesProvider.java:655)
	at org.netbeans.modules.editor.settings.storage.preferences.ProxyPreferencesImpl.get(ProxyPreferencesImpl.java:136)
	- locked <0x00000000d4aef458> (a org.netbeans.modules.editor.settings.storage.preferences.ProxyPreferencesImpl$Tree)
	at org.netbeans.modules.options.indentation.ProxyPreferences.get(ProxyPreferences.java:93)


reassigning to editor, as I believe item 1. is correct
Comment 17 Martin Janicek 2013-08-29 07:05:58 UTC
*** Bug 235188 has been marked as a duplicate of this bug. ***
Comment 18 markiewb 2013-08-30 08:10:08 UTC
It still happens every time after I opened the Run-category in project properties. See steps https://netbeans.org/bugzilla/show_bug.cgi?id=234671#c15 s

Product Version: NetBeans IDE Dev (Build 201308290001)
Java: 1.7.0_25; Java HotSpot(TM) 64-Bit Server VM 23.25-b01
Runtime: Java(TM) SE Runtime Environment 1.7.0_25-b17
System: Windows 7 version 6.1 running on amd64; Cp1252; de_DE (nb)
Comment 19 Dusan Balek 2013-09-02 16:09:41 UTC
Fixed in jet-main.

http://hg.netbeans.org/jet-main/rev/0698e75970e7
Comment 20 Quality Engineering 2013-09-04 01:44:35 UTC
Integrated into 'main-silver', will be available in build *201309040001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/0698e75970e7
User: Dusan Balek <dbalek@netbeans.org>
Log: Issue #234671: Deadlock when closing project properties - fixed.
Comment 21 markiewb 2013-09-04 09:21:10 UTC
(In reply to Dusan Balek from comment #19)
> Fixed in jet-main.
> 
> http://hg.netbeans.org/jet-main/rev/0698e75970e7

Sorry. Reopen. Issue still reproducible. Every time.

It still happens every time after I opened the Run-category in project properties. See steps https://netbeans.org/bugzilla/show_bug.cgi?id=234671#c15

Product Version: NetBeans IDE Dev (Build 201309040001)
Java: 1.7.0_25; Java HotSpot(TM) 64-Bit Server VM 23.25-b01
Runtime: Java(TM) SE Runtime Environment 1.7.0_25-b17
System: Windows 7 version 6.1 running on amd64; Cp1252; de_DE (nb)
Comment 22 Dusan Balek 2013-09-04 12:09:18 UTC
Unfortunately, I'm no more able (nor one of my colleagues) to reproduce the problem in the current dev build using the provided steps. Could you please attach the updated thread dump? Thanks.
Comment 23 markiewb 2013-09-04 12:23:27 UTC
Created attachment 139657 [details]
new threaddump

(In reply to Dusan Balek from comment #22)
> Unfortunately, I'm no more able (nor one of my colleagues) to reproduce the
> problem in the current dev build using the provided steps. Could you please
> attach the updated thread dump? Thanks.

Attached.

The following one is interesting I guess...
"Default RequestProcessor" daemon prio=2 tid=0x00000000175c1800 nid=0x934 in Object.wait() [0x00000000185fe000]
   java.lang.Thread.State: WAITING (on object monitor)
	at java.lang.Object.wait(Native Method)
	- waiting on <0x00000007d3535760> (a org.openide.util.RequestProcessor$Task)
	at java.lang.Object.wait(Object.java:503)
	at org.openide.util.Task.waitFinished(Task.java:135)
	- locked <0x00000007d3535760> (a org.openide.util.RequestProcessor$Task)
	at org.openide.util.RequestProcessor$Task.waitFinished(RequestProcessor.java:1686)
	at org.openide.text.DocumentOpenClose.open(DocumentOpenClose.java:256)
	at org.openide.text.CloneableEditorSupport.openDocument(CloneableEditorSupport.java:573)
	at org.openide.text.DataEditorSupport.openDocument(DataEditorSupport.java:587)
	at org.netbeans.modules.tomcat5.config.TomcatModuleConfiguration.modifyContext(TomcatModuleConfiguration.java:429)
	at org.netbeans.modules.tomcat5.config.TomcatModuleConfiguration.setContextRoot(TomcatModuleConfiguration.java:341)
	at org.netbeans.modules.j2ee.deployment.config.ConfigSupportImpl.setWebContextRoot(ConfigSupportImpl.java:292)
	at org.netbeans.modules.maven.j2ee.web.WebModuleImpl.setContextPath(WebModuleImpl.java:376)
	at org.netbeans.modules.maven.j2ee.ui.customizer.impl.CustomizerRunWeb.changeContextPath(CustomizerRunWeb.java:244)
	at org.netbeans.modules.maven.j2ee.ui.customizer.impl.CustomizerRunWeb.applyChanges(CustomizerRunWeb.java:135)
	at org.netbeans.modules.maven.j2ee.ui.customizer.MavenCompositePanelProvider$3.actionPerformed(MavenCompositePanelProvider.java:225)
	at org.netbeans.modules.project.uiapi.CustomizerDialog$OptionListener.storePerformed(CustomizerDialog.java:357)
	at org.netbeans.modules.project.uiapi.CustomizerDialog$OptionListener.access$400(CustomizerDialog.java:253)
	at org.netbeans.modules.project.uiapi.CustomizerDialog$OptionListener$2$1$1.run(CustomizerDialog.java:316)
	at org.openide.filesystems.FileUtil$2.run(FileUtil.java:435)
	at org.openide.filesystems.EventControl.runAtomicAction(EventControl.java:127)
	at org.openide.filesystems.FileSystem.runAtomicAction(FileSystem.java:609)
	at org.openide.filesystems.FileUtil.runAtomicAction(FileUtil.java:419)
	at org.openide.filesystems.FileUtil.runAtomicAction(FileUtil.java:439)
	at org.netbeans.modules.project.uiapi.CustomizerDialog$OptionListener$2$1.run(CustomizerDialog.java:309)
	at org.openide.util.Mutex.writeAccess(Mutex.java:404)
	at org.netbeans.modules.project.uiapi.CustomizerDialog$OptionListener$2.run(CustomizerDialog.java:306)
	at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1432)
	at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:2042)
Comment 24 Dusan Balek 2013-09-04 14:11:18 UTC
I see - there are two different deadlocks covered this bug report. My fix (http://hg.netbeans.org/jet-main/rev/0698e75970e7) fixed the deadlock reported by Martin Janicek in comments #11 and #12.

Fixed in jet-main.

http://hg.netbeans.org/jet-main/rev/f62664e48e84
Comment 25 markiewb 2013-09-04 20:28:27 UTC
(In reply to Dusan Balek from comment #24)
> I see - there are two different deadlocks covered this bug report. My fix
> (http://hg.netbeans.org/jet-main/rev/0698e75970e7) fixed the deadlock
> reported by Martin Janicek in comments #11 and #12.
> 
> Fixed in jet-main.
> 
> http://hg.netbeans.org/jet-main/rev/f62664e48e84

I will test it ASAP when it is integrated.
Comment 26 Jiri Prox 2013-09-05 11:16:54 UTC
Verified in trunk on custom build:


Product Version: NetBeans IDE Dev (Build 20130905-bba83179662f)
Java: 1.8.0-ea; Java HotSpot(TM) 64-Bit Server VM 25.0-b40
Runtime: Java(TM) SE Runtime Environment 1.8.0-ea-b98
System: Windows 7 version 6.1 running on amd64; Cp1250; en_US (nb)
User directory: C:\Users\jprox\AppData\Roaming\NetBeans\dev
Cache directory: C:\Users\jprox\AppData\Local\NetBeans\Cache\dev
Comment 27 Tomas Zezula 2013-09-05 13:25:16 UTC
THe fix seems good to me.
Comment 28 markiewb 2013-09-05 18:21:19 UTC
I like to verify the fix too. But I guess the current nightly builds are not build from the release74-branch. So where can I download the build from the release74-branch?
Comment 29 alied 2013-09-05 22:52:55 UTC
I'm also having this behaviour with Build 201309050001.
To me it only happens with Tomcat; not with GlassFish...
I'm also interested on verifying it.
Comment 30 mdeggersbeans 2013-09-05 23:51:55 UTC
Created attachment 139729 [details]
TD 1 changing from Glassfish to Tomcat

This is a small Maven J2EE5 application. I am attempting to change from Glassfish 3+ to Tomcat 7.0.42.

OS: Windows 7 Home Premium 64 bit
JDK: 1.7.0_25
IDE: 201309050001
Maven: 3.10 (external)
Comment 31 mdeggersbeans 2013-09-05 23:52:57 UTC
Created attachment 139730 [details]
TD 2 changing from Glassfish to Tomcat

Second thread dump.

This is a small Maven J2EE5 application. I am attempting to change from Glassfish 3+ to Tomcat 7.0.42.

OS: Windows 7 Home Premium 64 bit
JDK: 1.7.0_25
IDE: 201309050001
Maven: 3.10 (external)
Comment 32 mdeggersbeans 2013-09-05 23:53:49 UTC
Created attachment 139731 [details]
TD 3 changing from Glassfish to Tomcat

Third thread dump

This is a small Maven J2EE5 application. I am attempting to change from Glassfish 3+ to Tomcat 7.0.42.

OS: Windows 7 Home Premium 64 bit
JDK: 1.7.0_25
IDE: 201309050001
Maven: 3.10 (external)
Comment 33 Quality Engineering 2013-09-06 01:36:50 UTC
Integrated into 'main-silver', will be available in build *201309060001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/f62664e48e84
User: Dusan Balek <dbalek@netbeans.org>
Log: Issue #234671: Deadlock when closing project properties - fixed.
Comment 34 Dusan Balek 2013-09-06 07:21:49 UTC
The fix is not in release74 branch yet. For verification, please, use the build *201309060001* from http://bits.netbeans.org/dev/nightly/
Comment 35 markiewb 2013-09-06 09:47:40 UTC
(In reply to Dusan Balek from comment #34)
> The fix is not in release74 branch yet. For verification, please, use the
> build *201309060001* from http://bits.netbeans.org/dev/nightly/

Verified. My steps at https://netbeans.org/bugzilla/show_bug.cgi?id=234671#c15 don't lead to a deadlock anymore. Thanks!

Product Version: NetBeans IDE Dev (Build 201309060001)
Java: 1.7.0_25; Java HotSpot(TM) 64-Bit Server VM 23.25-b01
Runtime: Java(TM) SE Runtime Environment 1.7.0_25-b17
System: Windows 7 version 6.1 running on amd64; Cp1252; de_DE (nb)
Comment 36 Dusan Balek 2013-09-06 11:51:32 UTC
Integrated into release74.

http://hg.netbeans.org/releases/rev/332ff135c13f
Comment 37 mdeggersbeans 2013-09-06 15:39:35 UTC
Confirmed:

OS: Windows 7 Home Premium 64 bit
JDK: 1.7.0_25 64 bit
Build: 201309060001

Sadly now when updating the plugins from 201309050001 I get into the endless restart mode (cannot exit NetBeans).
Comment 38 Jiri Prox 2013-09-10 08:38:44 UTC
verified in 7.4


Product Version: NetBeans IDE 7.4 RC1 (Build 201309092300)
Java: 1.7.0_40; Java HotSpot(TM) 64-Bit Server VM 24.0-b55
Runtime: Java(TM) SE Runtime Environment 1.7.0_40-b39
System: Windows 7 version 6.1 running on amd64; Cp1250; en_US (nb)
User directory: C:\Users\jprox\AppData\Roaming\NetBeans\7.4rc1
Cache directory: C:\Users\jprox\AppData\Local\NetBeans\Cache\7.4rc1