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
- 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
- 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]
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:
new revision: 1.27; previous revision: 1.26
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:
new revision: 18.104.22.168.22.214.171.124; previous revision: 126.96.36.199.188.8.131.52
new revision: 184.108.40.206.220.127.116.11; previous revision: 18.104.22.168.22.214.171.124
Verified in NB5.5.1 20070314-1939.