Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 322840

Summary: Deadlock stopping Rhino debugger
Product: [WebTools] JSDT Reporter: Michael Rennie <Michael_Rennie>
Component: DebugAssignee: Michael Rennie <Michael_Rennie>
Status: RESOLVED FIXED QA Contact: Simon Kaegi <simon_kaegi>
Severity: major    
Priority: P3 CC: thatnitind
Version: 3.2   
Target Milestone: 3.3 M2   
Hardware: PC   
OS: Linux   
Whiteboard:
Attachments:
Description Flags
fix none

Description Michael Rennie CLA 2010-08-16 16:30:28 EDT
code from HEAD


org.eclipse.equinox.launcher.Main at localhost:50676	
	Daemon System Thread [Signal Dispatcher] (Running)	
	Daemon System Thread [Finalizer] (Running)	
	Daemon System Thread [Reference Handler] (Running)	
	Thread [main] (Running)	
	Thread [Framework Active Thread] (Running)	
	Daemon Thread [State Data Manager] (Running)	
	Daemon Thread [Start Level Event Dispatcher] (Running)	
	Daemon Thread [Framework Event Dispatcher] (Running)	
	Daemon Thread [[Timer] - Main Queue Handler] (Running)	
	Thread [Worker-JM] (Running)	
	Daemon Thread [Bundle File Closer] (Running)	
	Daemon Thread [JavaScript indexing] (Running)	
	Daemon Thread [Java indexing] (Running)	
	Thread [Worker-4] (Suspended)	
		owns: org.eclipse.wst.jsdt.debug.internal.core.model.JavaScriptDebugTarget  (id=420)	
		waiting for: org.eclipse.wst.jsdt.debug.internal.core.model.JavaScriptThread  (id=421)	
		org.eclipse.wst.jsdt.debug.internal.core.model.JavaScriptThread.markTerminated() line: 674	
		org.eclipse.wst.jsdt.debug.internal.core.model.JavaScriptThread.terminated() line: 816	
		org.eclipse.wst.jsdt.debug.internal.core.model.JavaScriptDebugTarget.removeAllThreads() line: 344	
		org.eclipse.wst.jsdt.debug.internal.core.model.JavaScriptDebugTarget.cleanup() line: 176	
		org.eclipse.wst.jsdt.debug.internal.core.model.JavaScriptDebugTarget.shutdown() line: 163	
		org.eclipse.wst.jsdt.debug.internal.core.model.JavaScriptDebugTarget.handleDebugEvents(org.eclipse.debug.core.DebugEvent[]) line: 856	
		org.eclipse.debug.core.DebugPlugin$EventNotifier.run() line: 1098	
		org.eclipse.core.runtime.SafeRunner.run(org.eclipse.core.runtime.ISafeRunnable) line: 42	
		org.eclipse.debug.core.DebugPlugin$EventNotifier.dispatch(org.eclipse.debug.core.DebugEvent[]) line: 1132	
		org.eclipse.debug.core.DebugPlugin$EventDispatchJob.run(org.eclipse.core.runtime.IProgressMonitor) line: 399	
		org.eclipse.core.internal.jobs.Worker.run() line: 54	
	Daemon Thread [[ThreadPool Manager] - Idle Thread] (Running)	
	Thread [Worker-8] (Running)	
	Thread [Worker-10] (Running)	
	Daemon Thread [Timer-11] (Running)	
	Daemon Thread [Timer-12] (Running)	
	Thread [Worker-11] (Suspended)	
		owns: org.eclipse.wst.jsdt.debug.internal.core.model.JavaScriptThread  (id=421)	
		waiting for: org.eclipse.wst.jsdt.debug.internal.core.model.JavaScriptDebugTarget  (id=420)	
		org.eclipse.wst.jsdt.debug.internal.core.model.JavaScriptDebugTarget.removeAllThreads() line: 341	
		org.eclipse.wst.jsdt.debug.internal.core.model.JavaScriptDebugTarget.cleanup() line: 176	
		org.eclipse.wst.jsdt.debug.internal.core.model.JavaScriptDebugTarget.terminate() line: 619	
		org.eclipse.wst.jsdt.debug.internal.core.model.JavaScriptThread.terminate() line: 809	
		org.eclipse.wst.jsdt.debug.internal.core.model.JavaScriptStackFrame.terminate() line: 318	
		org.eclipse.debug.internal.core.commands.TerminateCommand.execute(java.lang.Object) line: 30	
		org.eclipse.debug.internal.core.commands.TerminateCommand(org.eclipse.debug.internal.core.commands.ForEachCommand).doExecute(java.lang.Object[], org.eclipse.core.runtime.IProgressMonitor, org.eclipse.debug.core.IRequest) line: 31	
		org.eclipse.debug.core.commands.AbstractDebugCommand$1.run(org.eclipse.core.runtime.IProgressMonitor) line: 213	
		org.eclipse.core.internal.jobs.Worker.run() line: 54	
	Daemon Thread [Timer-14] (Running)	
	Thread [Worker-12] (Suspended)	
		waiting for: org.eclipse.wst.jsdt.debug.internal.core.model.JavaScriptDebugTarget  (id=420)	
		org.eclipse.wst.jsdt.debug.internal.core.model.JavaScriptDebugTarget.getThreads() line: 357	
		org.eclipse.wst.jsdt.debug.internal.ui.adapters.JavaScriptAsyncContentProvider.getChildCount(java.lang.Object, org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext, org.eclipse.debug.internal.ui.viewers.model.provisional.IViewerUpdate) line: 57	
		org.eclipse.wst.jsdt.debug.internal.ui.adapters.JavaScriptAsyncContentProvider(org.eclipse.debug.internal.ui.model.elements.ElementContentProvider).hasChildren(java.lang.Object, org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext, org.eclipse.debug.internal.ui.viewers.model.provisional.IViewerUpdate) line: 248	
		org.eclipse.wst.jsdt.debug.internal.ui.adapters.JavaScriptAsyncContentProvider(org.eclipse.debug.internal.ui.model.elements.ElementContentProvider).updateHasChildren(org.eclipse.debug.internal.ui.viewers.model.provisional.IHasChildrenUpdate) line: 223	
		org.eclipse.debug.internal.ui.model.elements.ElementContentProvider$3.run(org.eclipse.core.runtime.IProgressMonitor) line: 200	
		org.eclipse.core.internal.jobs.Worker.run() line: 54	
	Thread [Worker-13] (Running)	
	Thread [Worker-14] (Running)	
	Daemon Thread [Timer-15] (Running)	
	Daemon Thread [Timer-16] (Running)
Comment 1 Michael Rennie CLA 2010-08-16 16:46:53 EDT
Created attachment 176731 [details]
fix

Steps:

1. debug a script and suspend to have a suspended thread or stackframe selected
2. press terminate in the debug view

these steps would deadlock for me 80% of the time.

For some reason we had thread.terminate synchronized, when all it does is delegate to the debug target and call back to set the correct state. We do not need to sync this method.
Comment 2 Michael Rennie CLA 2010-08-16 16:47:42 EDT
applied to HEAD