Please use the Apache issue tracking system for new NetBeans issues (https://issues.apache.org/jira/projects/NETBEANS0/issues) !!
Bug 92943 - Deadlock when starting/stopping debugger
Deadlock when starting/stopping debugger
Status: VERIFIED FIXED
Product: debugger
Classification: Unclassified
Component: Java
5.x
PC Windows XP
: P2 (vote)
: 5.x
Assigned To: Martin Entlicher
issues@debugger
5.5.1_candidate
:
Depends on:
Blocks: 92999
  Show dependency treegraph
 
Reported: 2007-01-22 10:45 UTC by Jiri Skrivanek
Modified: 2007-03-20 11:26 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT
:


Attachments
Thread dump. (29.90 KB, text/plain)
2007-01-22 10:47 UTC, Jiri Skrivanek
Details
Thread dump in NB 5.5.1. (59.08 KB, text/plain)
2007-02-01 09:13 UTC, Jiri Skrivanek
Details
The diff of the fix. (8.52 KB, patch)
2007-02-19 11:20 UTC, Martin Entlicher
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jiri Skrivanek 2007-01-22 10:45:37 UTC
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.
Comment 1 Jiri Skrivanek 2007-01-22 10:47:04 UTC
Created attachment 37562 [details]
Thread dump.
Comment 2 Libor Kotouc 2007-01-22 12:38:48 UTC
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.
Comment 3 Martin Entlicher 2007-01-22 17:10:32 UTC
O.K. we'll look at it.
Comment 4 Jiri Skrivanek 2007-02-01 09:11:36 UTC
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.
Comment 5 Jiri Skrivanek 2007-02-01 09:13:05 UTC
Created attachment 37908 [details]
Thread dump in NB 5.5.1.
Comment 6 Petr Blaha 2007-02-01 10:03:54 UTC
Marking as 5.5.1_candidate
Comment 7 Martin Entlicher 2007-02-01 11:30:53 UTC
We'll look at it during the M7 stabilization week. Scheduling for 6.0 for now.
Comment 8 Martin Entlicher 2007-02-14 17:27:57 UTC
Firing under the lock is bad.
Comment 9 Martin Entlicher 2007-02-16 15:05:54 UTC
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
Comment 10 Martin Entlicher 2007-02-16 15:06:50 UTC
Please verify the fix in trunk and I'll integrate it into 5.5.1 then. Thanks.
Comment 11 Jiri Skrivanek 2007-02-19 11:08:31 UTC
It seems to be fixed. I cannot reproduce it anymore.
Comment 12 Martin Entlicher 2007-02-19 11:20:33 UTC
Created attachment 38657 [details]
The diff of the fix.
Comment 13 Roman Ondruska 2007-02-19 12:49:14 UTC
Review: The fix is safe enough for integration into NB 5.5.1.
Comment 14 Martin Entlicher 2007-02-22 12:36:48 UTC
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
Comment 15 Jiri Skrivanek 2007-03-20 11:26:35 UTC
Verified in NB5.5.1 20070314-1939.


By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo