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 50704

Summary: Deadlock when close Freeform project customizer
Product: projects Reporter: Jiri Rechtacek <jrechtacek>
Component: AntAssignee: Jesse Glick <jglick>
Status: RESOLVED FIXED    
Severity: blocker CC: dkonecny
Priority: P2 Keywords: THREAD
Version: 4.x   
Hardware: PC   
OS: Linux   
Issue Type: DEFECT Exception Reporter:
Attachments: thread dump
new thread dump from jrechtacek

Description Jiri Rechtacek 2004-10-21 14:55:23 UTC
[dev 041019]
1. create freeform project (<nb_root>/monitor)
2. open customizer
3. set the 'Build and Run' property to 'netbeans'
4. close the customizer -> deadlock appears (2
times in a row, 3rd attempt passed)
Comment 1 Jiri Rechtacek 2004-10-21 14:56:15 UTC
Created attachment 18432 [details]
thread dump
Comment 2 Jesse Glick 2004-10-21 16:39:31 UTC
This bug was already fixed (by David) six days ago. Perhaps you forgot
to update your sources? The stack trace refers to lines in the old
version of View.java.

*** This issue has been marked as a duplicate of 50328 ***
Comment 3 Jiri Rechtacek 2004-10-21 16:43:33 UTC
Ok, I'm going to verify it on a new build.
Comment 4 David Konecny 2004-10-25 15:57:49 UTC
Created attachment 18493 [details]
new thread dump from jrechtacek
Comment 5 David Konecny 2004-10-25 16:03:32 UTC
Jirka was able to reproduce it with latest build and there is valid
problem. It is what I mentioned in issue 50328:

"The problem is in FreeformSources.initSources() and its
ProjectManager.mutex().postWriteRequest() call. There are two threads:
EQ and RP. The FreeformSources.initSources() is called in RP, but EQ
already is in ProjectManager.mutex().readAccess(). That means that
ProjectManager.mutex().postWriteRequest() call in
FreeformSources.initSources() is blocking."

Perhaps the solution could be to move
ProjectManager.mutex().postWriteRequest() out of the FreeformSources's
synchronized block?
Comment 6 Jesse Glick 2004-10-25 18:33:18 UTC
I would rather change FreeformSources to use PM.mutex rather than
ad-hoc synchronization. I think that should solve it.
Comment 7 Jesse Glick 2004-10-25 22:11:50 UTC
Think I fixed. Cannot reproduce a deadlock using your instructions,
anyway. Would be nice if you could verify.

committed     Up-To-Date  1.5        
ant/freeform/src/org/netbeans/modules/ant/freeform/FreeformSources.java