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.
I found a deadlock when I was verifying another one (issue 92771). It appeared when I was starting and stopping debugger (web application). Maybe previous debugger session was not finished yet but a new one wanted to start. Two threads are waiting for <0x198d73e8> (a java.util.ArrayList) which is hold by other thread. I am not sure whether it belong to web/jspdebug or jpdadebugger. To reproduce: - add Glassfish server to IDE - set Swing HTML Browser as default web browser (Tools|Options) - create a web application from template - toggle breakpoint in index.jsp - start debugger F5 and wait until it stops at breakpoint - finish debugger - go to Runtime view and expand nodes under server node to see deployed web application - start debugger again and wait for breakpoint - finish debugger - repeat start/stop debugger and sooner or later your IDE will freeze (see attached thread dump). Build 20070122-0455, JDK1.5.0_10, WindowsXP.
Created attachment 37562 [details] Thread dump.
Debugger operator thread tries to set the stopped state while the current session is being finished on another thread. Both threads use the same locks - DebuggerManager.sessions and JPDADebuggerImpl.LOCK - in the opposite order which results in deadlock.
O.K. we'll look at it.
We found the same deadlock in NB 5.5.1. I think it should be fixed in 5.5.1 as well. I will attach thread dump generated during automated tests.
Created attachment 37908 [details] Thread dump in NB 5.5.1.
Marking as 5.5.1_candidate
We'll look at it during the M7 stabilization week. Scheduling for 6.0 for now.
Firing under the lock is bad.
It's fixed in trunk now: /shared/data/ccvs/repository/debuggercore/api/src/org/netbeans/api/debugger/DebuggerManager.java,v <-- DebuggerManager.java new revision: 1.27; previous revision: 1.26 /shared/data/ccvs/repository/debuggerjpda/src/org/netbeans/modules/debugger/jpda/JPDADebuggerImpl.java,v <-- JPDADebuggerImpl.java new revision: 1.113; previous revision: 1.112
Please verify the fix in trunk and I'll integrate it into 5.5.1 then. Thanks.
It seems to be fixed. I cannot reproduce it anymore.
Created attachment 38657 [details] The diff of the fix.
Review: The fix is safe enough for integration into NB 5.5.1.
Thanks for the review and verification, the fix is merged into release551 branch: /shared/data/ccvs/repository/debuggercore/api/src/org/netbeans/api/debugger/DebuggerManager.java,v <-- DebuggerManager.java new revision: 1.21.4.1.2.1.22.2; previous revision: 1.21.4.1.2.1.22.1 /shared/data/ccvs/repository/debuggerjpda/src/org/netbeans/modules/debugger/jpda/JPDADebuggerImpl.java,v <-- JPDADebuggerImpl.java new revision: 1.81.4.3.2.4.14.2; previous revision: 1.81.4.3.2.4.14.1
Verified in NB5.5.1 20070314-1939.