Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 337278 - Deadlock reported during startup of org.eclipse.tm.tcf.cdt.ui
Summary: Deadlock reported during startup of org.eclipse.tm.tcf.cdt.ui
Status: RESOLVED FIXED
Alias: None
Product: TCF
Classification: Tools
Component: Debug (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 0.4.0   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-02-16 02:50 EST by Anton Leherbauer CLA
Modified: 2013-06-05 05:54 EDT (History)
1 user (show)

See Also:


Attachments
Proposed patch (797 bytes, patch)
2011-02-16 02:52 EST, Anton Leherbauer CLA
cdtdoug: iplog-
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Anton Leherbauer CLA 2011-02-16 02:50:27 EST
It does not happen always, but quite frequently:

While loading class
"org.eclipse.tm.internal.tcf.cdt.ui.TCFBreakpointStatusListener", thread
"Thread[TCF Event Dispatcher,5,main]" timed out waiting (5000ms) for thread
"Thread[main,6,main]" to finish starting bundle
"org.eclipse.tm.tcf.cdt.ui_0.3.0.qualifier [266]". To avoid deadlock, thread
"Thread[TCF Event Dispatcher,5,main]" is proceeding but
"org.eclipse.tm.internal.tcf.cdt.ui.TCFBreakpointStatusListener" may not be
fully initialized.

org.osgi.framework.BundleException: State change in progress for bundle
"reference:file:/C:/ws/cdt-dev-7.0.x/org.eclipse.tm.tcf.cdt.ui/" by
thread "main".
at
org.eclipse.osgi.framework.internal.core.AbstractBundle.beginStateChange(AbstractBundle.java:1077)
at
org.eclipse.osgi.framework.internal.core.AbstractBundle.start(AbstractBundle.java:282)
at org.eclipse.osgi.framework.util.SecureAction.start(SecureAction.java:417)
at
org.eclipse.osgi.internal.loader.BundleLoader.setLazyTrigger(BundleLoader.java:265)
at
org.eclipse.core.runtime.internal.adaptor.EclipseLazyStarter.postFindLocalClass(EclipseLazyStarter.java:106)
at
org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLocalClass(ClasspathManager.java:453)
at
org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.findLocalClass(DefaultClassLoader.java:216)
at
org.eclipse.osgi.internal.loader.BundleLoader.findLocalClass(BundleLoader.java:393)
at
org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:469)
at
org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:422)
at
org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:410)
at
org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)
at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
at org.eclipse.tm.internal.tcf.cdt.ui.Activator$1.run(Activator.java:37)
at org.eclipse.tm.tcf.EventQueue.run(EventQueue.java:99)
at java.lang.Thread.run(Thread.java:619)
Caused by:
org.eclipse.osgi.framework.internal.core.AbstractBundle$BundleStatusException
... 16 more
Root exception:
org.eclipse.osgi.framework.internal.core.AbstractBundle$BundleStatusException
at
org.eclipse.osgi.framework.internal.core.AbstractBundle.beginStateChange(AbstractBundle.java:1077)
at
org.eclipse.osgi.framework.internal.core.AbstractBundle.start(AbstractBundle.java:282)
at org.eclipse.osgi.framework.util.SecureAction.start(SecureAction.java:417)
at
org.eclipse.osgi.internal.loader.BundleLoader.setLazyTrigger(BundleLoader.java:265)
at
org.eclipse.core.runtime.internal.adaptor.EclipseLazyStarter.postFindLocalClass(EclipseLazyStarter.java:106)
at
org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLocalClass(ClasspathManager.java:453)
at
org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.findLocalClass(DefaultClassLoader.java:216)
at
org.eclipse.osgi.internal.loader.BundleLoader.findLocalClass(BundleLoader.java:393)
at
org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:469)
at
org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:422)
at
org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:410)
at
org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)
at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
at org.eclipse.tm.internal.tcf.cdt.ui.Activator$1.run(Activator.java:37)
at org.eclipse.tm.tcf.EventQueue.run(EventQueue.java:99)
at java.lang.Thread.run(Thread.java:619)
Comment 1 Anton Leherbauer CLA 2011-02-16 02:52:11 EST
Created attachment 189073 [details]
Proposed patch

Putting the initialization of the TCFBreakpointStatusListener last in the start
method of the activator fixes it.
The reason behind the deadlock is explained in
https://bugs.eclipse.org/bugs/show_bug.cgi?id=86713
Comment 2 Eugene Tarassov CLA 2011-02-16 14:14:12 EST
As understand, Equinox can dead lock if a thread, other then main, tries to load a class form a plugin being started. Looks like a serious platform bug to me. I wonder why the bug is closed with "Marking this bug as invalid because sufficient details were not provided".

Anyway, I have committed the patch.
Thanks!
Comment 3 Anton Leherbauer CLA 2011-02-17 02:14:24 EST
(In reply to comment #2)
> As understand, Equinox can dead lock if a thread, other then main, tries to
> load a class form a plugin being started. Looks like a serious platform bug to
> me. I wonder why the bug is closed with "Marking this bug as invalid because
> sufficient details were not provided".

It's actually considered a Sun/Oracle JVM bug http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4670071 and the last comment is probably due to an automatic update.  It was resolved as REMIND which is now an invalid state.