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.
Steps to reproduce: 1. Create new Web Application with JSF 2. In welcomeJSF file just hit enter and insert some easy tag, ex. <span></span> 3. Invoke pop-up and hit Format. Found in: Product Version: NetBeans IDE Dev (Build 200809100201) Java: 1.6.0_10-beta; Java HotSpot(TM) Client VM 11.0-b11 System: Windows XP version 5.1 running on x86; Cp1250; cs_CZ (nb) NB log and thread dump is attached.
Created attachment 69515 [details] Thread dump
Created attachment 69516 [details] Thread dump
Created attachment 69518 [details] NB messages log
Caused by recent changes in SimplifiedJSPServlet - now it requests *not cached* parser data from EDT so the calling thread waits for the jsp background parsing thread to finish and provide fresh parse data. The problem is that the SimplifiedJSPServlet is called under document atomic lock and the background parsing thread needs to get the editor content. So the editor kit is requested to save its content to a stream which required document readlock => EDT - JSP Background Parsing deadlock. The solution would be not to call the TaglibParseSupport.getCachedParseResult(xx, yy, true(force parser)) under document atomic/writelock. This however doesn't look so easy to do so I'll create a new method in JspSyntaxSupport which will return the same data as the currently used one but will not require the fresh parse data.
fixed the particular case by the proposed way. I'll keep the issue opened so we can track it - one may still access the parser under document writelock and cause the lockup. I would at least recommed to add a notice into the api methods and possibly some assert for the document not being atomiclocked if the 'force parse' and 'use editor' options are used. Technically it is not jspparser issue, but changing the component to it since it is the IMO the most fitting subcomponent. I tmysik thinks this is not his issue, reassign back to me (jsp/core). Thanks. changeset: 101170:83c15cc6fe47 tag: tip user: Marek Fukala <mfukala@netbeans.org> date: Wed Sep 10 14:39:15 2008 +0200 summary: #146762 - Deadlock after reformat jsp file
Reproducible deadlock with data lost (http://wiki.netbeans.org/BugPriorityGuidelines).
It is fixed for you josin, have you read the comment? :-). Revision 83c15cc6fe47. I kept it opened (even there is no deadlock anymore) to track the remaining API issues.
I'm very sorry, it's my fault :(
Do not worry, I am glad you reported the problem!
The fix wasn't complete. There deadlock can still occur in theory if the SimplifiedJSPServlet asks for the parse data before the file was parsed at least once. I'll try to figure out how to avoid this... changeset: 101430:5be790669a1e tag: tip user: Marek Fukala <mfukala@netbeans.org> date: Thu Sep 11 12:52:58 2008 +0200 summary: additional fix to issue #146762 - Deadlock after reformat jsp file
According to Dusan Balek, there has been a change in the java source parsing recently. Now the parsing is not done in the reformat lock, but directly inside the atomic lock. Dusan promised to create a jsp specific patch which will use the previous logic. Proper fix should be done in next netbeans version my migrating the jsp parser to the parsing api.
Created attachment 69655 [details] Patch - temporary solution
Integrated into 'main-golden', will be available in build *200809111401* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main/rev/83c15cc6fe47 User: Marek Fukala <mfukala@netbeans.org> Log: #146762 - Deadlock after reformat jsp file
*** Issue 146990 has been marked as a duplicate of this issue. ***
I'm sorry but deadlock is still reproducible in 200809120201. P1 till next fix. I'll attach a new thread dump.
Created attachment 69734 [details] Thread dump
I tried the patch Dusane but the reformatting of java code inside JSP doesn't work then. Can you please look at it?
As for the additional fix to issue #146762 - Deadlock after reformat jsp file, I am affraid it wasn't pushed :-(. Can you please verify in a build with this change? Thanks. http://hg.netbeans.org/main/rev/5be790669a1e
Integrated into 'main-golden', will be available in build *200809130201* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main/rev/5be790669a1e User: Marek Fukala <mfukala@netbeans.org> Log: additional fix to issue #146762 - Deadlock after reformat jsp file
Works fine. P1 verified. I keep it open as P3 for tracking remaining API issues. Product Version: NetBeans IDE Dev (Build 200809150201) Java: 1.6.0_10-beta; Java HotSpot(TM) Client VM 11.0-b11 System: Windows XP version 5.1 running on x86; Cp1250; cs_CZ (nb)
*** Issue 147039 has been marked as a duplicate of this issue. ***
*** Issue 138941 has been marked as a duplicate of this issue. ***
*** Issue 140361 has been marked as a duplicate of this issue. ***
Report from old NetBeans version. Due to code changes since it was reported likely not reproducible now. Feel free to reopen if happens in 8.0.2 or 8.1.