Bug 3083 - Deadlock starting workspace in debug mode on Sun 1.3 (1GH2UOQ)
Summary: Deadlock starting workspace in debug mode on Sun 1.3 (1GH2UOQ)
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Resources (show other bugs)
Version: 2.0   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: John Arthorne CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 3113 (view as bug list)
Depends on:
Blocks:
 
Reported: 2001-10-10 22:49 EDT by Darin Swanson CLA
Modified: 2001-11-01 09:43 EST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Darin Swanson CLA 2001-10-10 22:49:09 EDT
DS (7/18/01 3:48:33 PM)
	Attempting to self host and launch target, in debug mode (attempting to reproduce1GGNI8M: ITPDUI:ALL - Performance problem under Sun's JDK1.3 )
	on Sun 1.3.
	The target workspace is a copy of the host workspace.  Workspace used for host and target is available on walleye.  
		directory: INCOMING\forDarins
		file: workspace0.125.zip
	Launch is the target is slow.  I have reproduced twice in a row.  Takes ~10 mins to reach deadlock.

	Thread [main] (Suspended)
		PluginClassLoader.findClassParentsSelf(String, boolean, DelegatingURLClassLoader, boolean) line: 85    >>>>Waiting for PluginClassLoader monitor
		PluginClassLoader(DelegatingURLClassLoader).loadClass(String, boolean, DelegatingURLClassLoader, Vector, boolean) line: 615
		PluginClassLoader(DelegatingURLClassLoader).loadClass(String, boolean) line: 595
		PluginClassLoader(ClassLoader).loadClass(String) line: 253
		ResourceBundle.loadBundle(ClassLoader, String) line: 905
		ResourceBundle.findBundle(ClassLoader, String, String, Object, Object) line: 786
		ResourceBundle.getBundleImpl(String, Locale, ClassLoader) line: 637
		ResourceBundle.getBundle(String, Locale) line: 559
		Util.relocalize() line: 892
		Util.<clinit>() line: 55
		JavaCore.setClasspathVariable(String, IPath, IProgressMonitor) line: 858
		JavaModelManager.readVariables(String) line: 901
		JavaModelManager.loadVariables() line: 756
		JavaCore.startup() line: 939
		PluginDescriptor$1.run() line: 637
		InternalPlatform.run(ISafeRunnable) line: 758
		PluginDescriptor.internalDoPluginActivation() line: 649
		PluginDescriptor.doPluginActivation() line: 204																									>>>>PluginDescriptor Monitor acquired
		PluginClassLoader.activatePlugin(String) line: 52
		PluginClassLoader.findClassParentsSelf(String, boolean, DelegatingURLClassLoader, boolean) line: 128
		PluginClassLoader(DelegatingURLClassLoader).loadClass(String, boolean, DelegatingURLClassLoader, Vector, boolean) line: 615
		DelegatingURLClassLoader.access$0(DelegatingURLClassLoader, String, boolean, DelegatingURLClassLoader, Vector, boolean) line: 609
		DelegatingURLClassLoader$DelegateLoader.loadClass(String, DelegatingURLClassLoader, DelegatingURLClassLoader, Vector) line: 60
		PluginClassLoader(DelegatingURLClassLoader).findClassPrerequisites(String, DelegatingURLClassLoader, Vector) line: 352
		PluginClassLoader(DelegatingURLClassLoader).loadClass(String, boolean, DelegatingURLClassLoader, Vector, boolean) line: 623
		PluginClassLoader(DelegatingURLClassLoader).loadClass(String, boolean) line: 595
		PluginClassLoader(ClassLoader).loadClass(String) line: 253
		PluginClassLoader(ClassLoader).loadClassInternal(String) line: 313
		JavaPlugin.startup() line: 216
		PluginDescriptor$1.run() line: 637
		InternalPlatform.run(ISafeRunnable) line: 758
		PluginDescriptor.internalDoPluginActivation() line: 649
		PluginDescriptor.doPluginActivation() line: 204
		PluginClassLoader.activatePlugin(String) line: 52
		PluginClassLoader.findClassParentsSelf(String, boolean, DelegatingURLClassLoader, boolean) line: 128
		PluginClassLoader(DelegatingURLClassLoader).loadClass(String, boolean, DelegatingURLClassLoader, Vector, boolean) line: 615
		PluginClassLoader(DelegatingURLClassLoader).loadClass(String, boolean) line: 595
		PluginClassLoader(ClassLoader).loadClass(String) line: 253
		PluginDescriptor.createExecutableExtension(String, Object, IConfigurationElement, String) line: 148
		PluginDescriptor.createExecutableExtension(String, String, Object, IConfigurationElement, String) line: 185
		ConfigurationElement.createExecutableExtension(String) line: 97
		WorkbenchPlugin$1.run() line: 102
		BusyIndicator.showWhile(Display, Runnable) line: 98
		WorkbenchPlugin.createExtension(IConfigurationElement, String) line: 99
		ViewDescriptor.createView() line: 43
		ViewFactory.createView(IViewDescriptor, IMemento) line: 113
		ViewFactory.createView(String, IMemento) line: 93
		Perspective$4.run() line: 661
		InternalPlatform.run(ISafeRunnable) line: 758
		Platform.run(ISafeRunnable) line: 393
		Perspective.restoreView(IMemento, String) line: 654
		Perspective.restoreState(IMemento) line: 572
		WorkbenchPage.restoreState(IMemento) line: 1126
		WorkbenchPage.<init>(WorkbenchWindow, IMemento, IAdaptable) line: 76
		WorkbenchWindow.restoreState(IMemento) line: 743
		Workbench.restoreState(IMemento) line: 598
		Workbench$5.run() line: 477
		InternalPlatform.run(ISafeRunnable) line: 758
		Platform.run(ISafeRunnable) line: 393
		Workbench.openPreviousWorkbenchState() line: 461
		Workbench.openWindows() line: 518
		Workbench.init(String[]) line: 393
		Workbench.run(Object) line: 618
		InternalBootLoader.run(String, URL, String, String[]) line: 815
		BootLoader.run(String, URL, String, String[]) line: 285
		Method.invoke(Object, Object[])
		UIMain(Main).basicRun(String[]) line: 119
		UIMain(Main).run(String[]) line: 401
		UIMain.main(String[]) line: 52

Thread [Java indexing: org.eclipse.jdt.internal.core.search.indexing.IndexManager] (Suspended)
	PluginDescriptor.isPluginActivated() line: 657     																							   >>>>> Waiting for PluginDescriptor Monitor
	PluginClassLoader.findClassParentsSelf(String, boolean, DelegatingURLClassLoader, boolean) line: 102  >>>>>PluginClassLoader Monitor acquired
	PluginClassLoader(DelegatingURLClassLoader).loadClass(String, boolean, DelegatingURLClassLoader, Vector, boolean) line: 615
	PluginClassLoader(DelegatingURLClassLoader).loadClass(String, boolean) line: 595
	PluginClassLoader(ClassLoader).loadClass(String) line: 253
	PluginClassLoader(ClassLoader).loadClassInternal(String) line: 313
	IndexManager.checkIndexConsistency() line: 87
	IndexManager.activateProcessing() line: 50
	IndexManager(JobManager).run() line: 220
	Thread.run() line: 484


NOTES:
Comment 1 DJ Houghton CLA 2001-10-24 06:43:42 EDT
PRODUCT VERSION:
0.9

Comment 2 John Arthorne CLA 2001-10-25 17:48:23 EDT
*** Bug 3113 has been marked as a duplicate of this bug. ***
Comment 3 John Arthorne CLA 2001-10-25 17:55:52 EDT
Fixed.  The solution was to avoid calling PluginDescriptor.isPluginActivated() 
from the sync block of the plugin class loader, in cases where activation is in 
progress.  Fix is in PluginClassLoader#findClassParentsSelf:

Old code:

if (descriptor.isPluginActivated() || pluginActivationInProgress) {

New code:

if (pluginActivationInProgress || descriptor.isPluginActivated()) {

Also added comments in Plugin constructor and startup(), strongly suggesting 
that sync blocks and other thread locking be avoided during plugin constructors 
and startup() methods.  Since there is one monitor already acquired in the 
plugin descriptor, it would only take one more monitor from client code to 
create a deadlock.  We believe this is unavoidable...
Comment 4 John Arthorne CLA 2001-10-25 17:57:07 EDT
Oops, forgot to change resolution... sorry for the email bombardment!
Comment 5 Rodrigo Peretti CLA 2001-11-01 09:43:55 EST
Fixed in v207