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

Bug 289909

Summary: deadlock caused by ContentTypeCatalog
Product: [Eclipse Project] Platform Reporter: Darryl Miles <darryl>
Component: ResourcesAssignee: Platform-Resources-Inbox <platform-resources-inbox>
Status: CLOSED DUPLICATE QA Contact:
Severity: critical    
Priority: P3 CC: daniel_megert, remy.suen
Version: 3.5   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Whiteboard:
Attachments:
Description Flags
Thread Dump with Deadlock detection none

Description Darryl Miles CLA 2009-09-18 16:49:38 EDT
User-Agent:       Mozilla/5.0 (X11; U; Linux i686 (x86_64); en-GB; rv:1.8.1.23) Gecko/20090823 SeaMonkey/1.1.18
Build Identifier: 3.5 Galileo

After doing nothing in particular my Eclipse 3.5+WTP installation started to exhibit a failure in that it was unable to bootup at all.  The splash screen is displayed and it hangs about 30% on the splash progress bar.

Eclipse was able to bootup using a clean workspace, so the problem confirmed as being an issue with the workspace (its configuration or the project data).

After issuing the JVM (Sun 1.6u16) a SIGQUIT I have a thread dump.

After examining the thread dump I can clearly see a dead-lock between "main" and "JavaReconciler" thread.  Which I shall post in a followup comment.


I gather this processing has something to do with the restoration of editors from my saved workspace.  This is by no means the first time I've had problems like this in the history of Eclipse 3.1 through to 3.5.


It would also be easy for Eclipse to detect a "startup failure" by laying down some kind of configuration setting at the start of the bootup process and removing it when the workspace was ready for user interaction.  Then the 2nd time I attempted to bootup eclipse it offered me a dialog very early on explaining that Eclipse experienced a startup failure and providing me with some kind of option to skip/defer all non-critical features in order to get back to a working UI.  Such things might include restoration of editors, restoration of workspace perspective, layout and views, etc...  ANYTHING just to long as I get a UI I can do something with.


As a workaround I have been advised to delete my workspace.xml for a fix, which I shall do once I have the stack trace information up in this bug report.

I consider this a critical bug as the eclipse installation (and/or workspace) is unusable when the splash screen hangs on you.

Reproducible: Always
Comment 1 Darryl Miles CLA 2009-09-18 16:53:47 EDT
Created attachment 147609 [details]
Thread Dump with Deadlock detection

end of -consoleLog output (with OSGi debug output) before then the JDK6 thread dump and Stack Trace (JDK6 even stops the deadlock itself).
Comment 2 Darryl Miles CLA 2009-09-18 17:03:54 EDT
Highlights...


"org.eclipse.jdt.internal.ui.text.JavaReconciler" daemon prio=10 tid=0xf3904c00 nid=0x3c01 waiting for monitor entry [0xf336d000]
   java.lang.Thread.State: BLOCKED (on object monitor)
        at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLocalClass_LockClassLoader(ClasspathManager.java:464)
        - waiting to lock <0x41770e98> (a org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader) <<-- HERE LOCK#1
        at     org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLocalClass(ClasspathManager.java:445)
        at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.findLocalClass(DefaultClassLoader.java:211)
        at org.eclipse.osgi.internal.loader.BundleLoader.findLocalClass(BundleLoader.java:376)
        at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:452)
        at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:405)
        at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:393)
        at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:105)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
        at org.eclipse.osgi.internal.loader.BundleLoader.loadClass(BundleLoader.java:321)
        at org.eclipse.osgi.framework.internal.core.BundleHost.loadClass(BundleHost.java:231)
        at org.eclipse.osgi.framework.internal.core.AbstractBundle.loadClass(AbstractBundle.java:1193)
        at org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.createExecutableExtension(RegistryStrategyOSGI.java:160)
        at org.eclipse.core.internal.registry.ExtensionRegistry.createExecutableExtension(ExtensionRegistry.java:874)
        at org.eclipse.core.internal.registry.ConfigurationElement.createExecutableExtension(ConfigurationElement.java:243)
        at org.eclipse.core.internal.registry.ConfigurationElementHandle.createExecutableExtension(ConfigurationElementHandle.java:51)
        at org.eclipse.core.internal.content.ContentType.getDescriber(ContentType.java:271)
        at org.eclipse.core.internal.content.ContentTypeCatalog.collectMatchingByContents(ContentTypeCatalog.java:183)
        at org.eclipse.core.internal.content.ContentTypeCatalog.internalFindContentTypesFor(ContentTypeCatalog.java:357)
        at org.eclipse.core.internal.content.ContentTypeCatalog.internalFindContentTypesFor(ContentTypeCatalog.java:406)
        - locked <0x41379de8> (a org.eclipse.core.internal.content.ContentTypeCatalog) <<-- HERE LOCK#2
        at org.eclipse.core.internal.content.ContentTypeCatalog.getDescriptionFor(ContentTypeCatalog.java:303)
        at org.eclipse.core.internal.content.ContentTypeCatalog.getDescriptionFor(ContentTypeCatalog.java:317)
        at org.eclipse.core.internal.content.ContentTypeMatcher.getDescriptionFor(ContentTypeMatcher.java:86)
        at org.eclipse.emf.ecore.resource.impl.PlatformContentHandlerImpl.contentDescription(PlatformContentHandlerImpl.java:92)
        at org.eclipse.emf.ecore.resource.impl.URIHandlerImpl.contentDescription(URIHandlerImpl.java:267)
        at org.eclipse.emf.ecore.resource.impl.ExtensibleURIConverterImpl.contentDescription(ExtensibleURIConverterImpl.java:313)
        at org.eclipse.emf.ecore.resource.impl.ResourceFactoryRegistryImpl.getContentTypeIdentifier(ResourceFactoryRegistryImpl.java:164)
        at org.eclipse.emf.ecore.resource.impl.ResourceFactoryRegistryImpl.getFactory(ResourceFactoryRegistryImpl.java:130)
        at org.eclipse.emf.ecore.resource.impl.ResourceFactoryRegistryImpl.getFactory(ResourceFactoryRegistryImpl.java:75)
        at org.eclipse.wst.common.internal.emf.utilities.DefaultOverridableResourceFactoryRegistry.delegatedGetFactory(DefaultOverridableResourceFactoryRegistry.java:73)
        at org.eclipse.jst.j2ee.common.internal.impl.J2EEResourceFactoryRegistry.delegatedGetFactory(J2EEResourceFactoryRegistry.java:27)
        at org.eclipse.wst.common.internal.emf.utilities.DefaultOverridableResourceFactoryRegistry.getFactory(DefaultOverridableResourceFactoryRegistry.java:53)
        at org.eclipse.wst.common.internal.emf.resource.FileNameResourceFactoryRegistry.getFactory(FileNameResourceFactoryRegistry.java:64)
        at org.eclipse.wst.common.internal.emf.resource.FileNameResourceFactoryRegistry.getFactory(FileNameResourceFactoryRegistry.java:50)
        - locked <0x33a95da0> (a org.eclipse.jst.j2ee.common.internal.impl.J2EEResourceFactoryRegistry)
        at org.eclipse.jst.j2ee.internal.J2EEInit.initResourceFactories(J2EEInit.java:247)
        at org.eclipse.jst.j2ee.internal.J2EEInit.init(J2EEInit.java:101)
        at org.eclipse.jst.j2ee.commonarchivecore.internal.helpers.ArchiveInit.invokePrereqInits(ArchiveInit.java:65)
        at org.eclipse.jst.j2ee.commonarchivecore.internal.helpers.ArchiveInit.init(ArchiveInit.java:38)
        at org.eclipse.jst.j2ee.internal.plugin.J2EEPlugin.start(J2EEPlugin.java:508)
        at org.eclipse.osgi.framework.internal.core.BundleContextImpl$1.run(BundleContextImpl.java:782)
        at java.security.AccessController.doPrivileged(Native Method)
        at org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:773)
        at org.eclipse.osgi.framework.internal.core.BundleContextImpl.start(BundleContextImpl.java:754)
        at org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:352)
        at org.eclipse.osgi.framework.internal.core.AbstractBundle.start(AbstractBundle.java:280)
...SNIP...

"main" prio=10 tid=0x080a3000 nid=0x3bd9 waiting for monitor entry [0xffdae000]
   java.lang.Thread.State: BLOCKED (on object monitor)
        at org.eclipse.core.internal.content.ContentTypeCatalog.internalGetContentType(ContentTypeCatalog.java:487)
        - waiting to lock <0x41379de8> (a org.eclipse.core.internal.content.ContentTypeCatalog) <<-- HERE LOCK#2
        at org.eclipse.core.internal.content.ContentTypeCatalog.getContentType(ContentTypeCatalog.java:298)
        at org.eclipse.core.internal.content.ContentTypeManager.getContentType(ContentTypeManager.java:135)
        at org.eclipse.wst.common.componentcore.internal.impl.WTPResourceFactoryRegistry$ConfigurationResourceFactoryDescriptor.init(WTPResourceFactoryRegistry.java:182)
        at org.eclipse.wst.common.componentcore.internal.impl.WTPResourceFactoryRegistry$ConfigurationResourceFactoryDescriptor.<init>(WTPResourceFactoryRegistry.java:163)
        at org.eclipse.wst.common.componentcore.internal.impl.WTPResourceFactoryRegistry$ResourceFactoryRegistryReader$1.run(WTPResourceFactoryRegistry.java:285)
        at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
        at org.eclipse.wst.common.componentcore.internal.impl.WTPResourceFactoryRegistry$ResourceFactoryRegistryReader.readElement(WTPResourceFactoryRegistry.java:282)
        at org.eclipse.jem.util.RegistryReader.internalReadElement(RegistryReader.java:84)
        at org.eclipse.jem.util.RegistryReader.readRegistry(RegistryReader.java:125)
        at org.eclipse.wst.common.componentcore.internal.impl.WTPResourceFactoryRegistry.<init>(WTPResourceFactoryRegistry.java:61)
        at org.eclipse.wst.common.componentcore.internal.impl.WTPResourceFactoryRegistry.<clinit>(WTPResourceFactoryRegistry.java:55)
        at org.eclipse.wst.common.componentcore.internal.impl.WTPModulesResourceFactory.registerWith(WTPModulesResourceFactory.java:71)
        at org.eclipse.wst.common.componentcore.internal.impl.WTPModulesResourceFactory.register(WTPModulesResourceFactory.java:80)
        at org.eclipse.wst.common.componentcore.internal.impl.WTPModulesInit.initResourceFactories(WTPModulesInit.java:52)
        at org.eclipse.wst.common.componentcore.internal.impl.WTPModulesInit.init(WTPModulesInit.java:42)
        at org.eclipse.wst.common.componentcore.internal.impl.WTPModulesInit.init(WTPModulesInit.java:34)
        at org.eclipse.wst.common.componentcore.internal.ModulecorePlugin.start(ModulecorePlugin.java:66)
        - locked <0x33965470> (a org.eclipse.wst.common.componentcore.internal.ModulecorePlugin)
        at org.eclipse.osgi.framework.internal.core.BundleContextImpl$1.run(BundleContextImpl.java:782)
        at java.security.AccessController.doPrivileged(Native Method)
        at org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:773)
        at org.eclipse.osgi.framework.internal.core.BundleContextImpl.start(BundleContextImpl.java:754)
        at org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:352)
        at org.eclipse.osgi.framework.internal.core.AbstractBundle.start(AbstractBundle.java:280)
        at org.eclipse.osgi.framework.util.SecureAction.start(SecureAction.java:408)
        at org.eclipse.core.runtime.internal.adaptor.EclipseLazyStarter.postFindLocalClass(EclipseLazyStarter.java:111)
        at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLocalClass(ClasspathManager.java:449)
        at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.findLocalClass(DefaultClassLoader.java:211)
        at org.eclipse.osgi.internal.loader.BundleLoader.findLocalClass(BundleLoader.java:376)
        at org.eclipse.osgi.internal.loader.SingleSourcePackage.loadClass(SingleSourcePackage.java:33)
        at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:449)
        at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:405)
        at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:393)
        at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:105)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
        at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)

        - locked <0x41770e98> (a org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader) <<-- HERE LOCK#1
        at org.eclipse.jst.jee.internal.deployables.JEEDeployableFactory.createModules(JEEDeployableFactory.java:53)
        at org.eclipse.wst.server.core.util.ProjectModuleFactoryDelegate.cacheModules(ProjectModuleFactoryDelegate.java:90)
        at org.eclipse.wst.server.core.util.ProjectModuleFactoryDelegate.getModules(ProjectModuleFactoryDelegate.java:117)
        at org.eclipse.wst.server.core.model.ModuleFactoryDelegate.findModule(ModuleFactoryDelegate.java:202)
        at org.eclipse.wst.server.core.util.ProjectModuleFactoryDelegate.findModule(ProjectModuleFactoryDelegate.java:286)
        at org.eclipse.wst.server.core.internal.ModuleFactory.findModule(ModuleFactory.java:146)
        at org.eclipse.wst.server.core.ServerUtil.getModule(ServerUtil.java:135)
        at org.eclipse.wst.server.core.internal.Server.getModules(Server.java:2139)
        at org.eclipse.wst.server.ui.internal.cnf.ServerContentProvider.hasChildren(ServerContentProvider.java:97)
        at org.eclipse.ui.internal.navigator.extensions.SafeDelegateTreeContentProvider.hasChildren(SafeDelegateTreeContentProvider.java:106)
        at org.eclipse.ui.internal.navigator.extensions.SafeDelegateTreeContentProvider.hasChildren(SafeDelegateTreeContentProvider.java:291)
        at org.eclipse.ui.internal.navigator.NavigatorContentServiceContentProvider.hasChildren(NavigatorContentServiceContentProvider.java:624)
        at org.eclipse.jface.viewers.AbstractTreeViewer.isExpandable(AbstractTreeViewer.java:2079)
        at org.eclipse.jface.viewers.TreeViewer.isExpandable(TreeViewer.java:587)
        at org.eclipse.jface.viewers.AbstractTreeViewer.isExpandable(AbstractTreeViewer.java:2109)
        at org.eclipse.jface.viewers.AbstractTreeViewer.updatePlus(AbstractTreeViewer.java:2791)
        at org.eclipse.jface.viewers.TreeViewer.updatePlus(TreeViewer.java:847)
        at org.eclipse.jface.viewers.AbstractTreeViewer.createTreeItem(AbstractTreeViewer.java:828)
        at org.eclipse.jface.viewers.AbstractTreeViewer$1.run(AbstractTreeViewer.java:802)
        at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
        at org.eclipse.jface.viewers.AbstractTreeViewer.createChildren(AbstractTreeViewer.java:776)
...SNIP....


ound one Java-level deadlock:
=============================
"org.eclipse.jdt.internal.ui.text.JavaReconciler":
  waiting to lock monitor 0xf44b7ec4 (object 0x41770e98, a org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader),
  which is held by "main"
"main":
  waiting to lock monitor 0xf44b75c8 (object 0x41379de8, a org.eclipse.core.internal.content.ContentTypeCatalog),
  which is held by "org.eclipse.jdt.internal.ui.text.JavaReconciler"
Comment 3 Darryl Miles CLA 2009-09-18 17:17:40 EDT
The suggested workaround of renaming/removing .metadata/.plugins/org.eclipse.ui.workbench/workbench.xml did work.


$ cd $HOME
$ cd workspace
$ mv .metadata/.plugins/org.eclipse.ui.workbench/workbench.xml  .metadata/.plugins/org.eclipse.ui.workbench/workbench.xml.o   

Did fix the problem and allow the workbench UI to appear.
Comment 4 Remy Suen CLA 2009-09-18 18:01:39 EDT
There seems to be several other deadlock bugs around. Bug 281968 and bug 288380 seems to be similar to this one.
Comment 5 Darryl Miles CLA 2009-09-19 01:13:04 EDT
(In reply to comment #4)
> There seems to be several other deadlock bugs around. Bug 281968 and bug 288380
> seems to be similar to this one.

The first bug does not look the same, that report talks about AFTER the UI has initialized and Java Tooling it setting itself up.  While I have observed this kind of lockup myself with 3.5, it is not the same as my report here.  Since if you just restart eclipse it probably won't happen again.


I agree that bug #288380 looks the same.  It has JavaReconciler in the stack traces and talks about splash screen lockups.
Comment 6 Dani Megert CLA 2009-09-21 09:32:01 EDT
The deadlock happens because methods in org.eclipse.core.internal.content.ContentTypeCatalog got synchronized for 3.5 in order to fix bug 269158.
Comment 7 Dani Megert CLA 2009-09-21 09:32:27 EDT

*** This bug has been marked as a duplicate of bug 283163 ***