Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 347236 - Eclipse becomes non-responsive on startup
Summary: Eclipse becomes non-responsive on startup
Status: CLOSED WONTFIX
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Runtime (show other bugs)
Version: 3.6   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: platform-runtime-inbox CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords:
Depends on:
Blocks:
 
Reported: 2011-05-25 20:45 EDT by Ali K CLA
Modified: 2019-11-14 03:40 EST (History)
10 users (show)

See Also:


Attachments
error message after force-quitting eclipse (91.89 KB, image/jpeg)
2011-05-25 20:46 EDT, Ali K CLA
no flags Details
Thread Dump (34.00 KB, text/plain)
2011-05-26 20:05 EDT, Ali K CLA
no flags Details
Thread Dump 2 (34.01 KB, text/plain)
2011-05-29 19:56 EDT, Ali K CLA
no flags Details
Deadlock between JavaReconciler thread running BreakpointManager and 'main' thread running ProblemsLabelDecorator (51.42 KB, text/plain)
2012-05-23 14:30 EDT, Brian Brooks CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ali K CLA 2011-05-25 20:45:37 EDT
Build Identifier: 

"building workspace" task hangs on 3% on eclipse startup. eclipse becomes "not responding" afterwards.

Reproducible: Always

Steps to Reproduce:
Happened abruptly this morning. eclipse was working fine until last night that I left work. happens on startup before I do anything.
Comment 1 Ali K CLA 2011-05-25 20:46:59 EDT
Created attachment 196615 [details]
error message after force-quitting eclipse
Comment 2 Ali K CLA 2011-05-25 20:48:42 EDT
After a few attempts it magically disappeared!
Comment 3 Dani Megert CLA 2011-05-26 01:09:28 EDT
Next time when it happens please take a stack trace and attach it here. For details see http://wiki.eclipse.org/index.php/How_to_report_a_deadlock.
Comment 4 Ali K CLA 2011-05-26 20:05:58 EDT
Created attachment 196714 [details]
Thread Dump

Thread Dump taken from VisualVm
Comment 5 Ali K CLA 2011-05-26 20:06:12 EDT
Thread Dump attached.
Comment 6 Ali K CLA 2011-05-26 20:09:07 EDT
It is happening again this morning!
For the second day Eclipse becomes non-responsive when I start up in the morning to start work. Yesterday, after a few attempts, the problem disappeared.
Will report if it is the case today too.
Comment 7 Dani Megert CLA 2011-05-27 02:34:42 EDT
This looks like the infamous class loader deadlock.
Comment 8 Ali K CLA 2011-05-27 02:37:23 EDT
The problem was very persistent, so I switched to 64bit version of JVM and eclipse, and so far so good!
Comment 9 Thomas Watson CLA 2011-05-27 09:05:13 EDT
It is unclear to me who is holding the classloader lock which the "main" thread is blocked on.  I don't see any other suspect threads that look to be holding the class loader lock.  It is possible the native VM could be holding the lock, but that can usually be detected by a call to ClassLoader.loadClassInternal.  

Perhaps the following portion of the stack on thread "org.eclipse.jdt.internal.ui.text.JavaReconciler" is caused by the VM loading the class and the class loader is locked there.

at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
at org.hibernate.eclipse.jdt.ui.internal.HQLExpressionCompilerParticipant.isActive(HQLExpressionCompilerParticipant.java:56)

If that is the case then this would be the infamous class loader lock that we can only truly fix by using Java 7.

It looks like jobs may be involved also in this deadlock, but I could not tell what condition it is waiting on.
Comment 10 Oleg Besedin CLA 2011-05-27 11:23:00 EDT
(In reply to comment #9)
> If that is the case then this would be the infamous class loader lock that we
> can only truly fix by using Java 7.

Looks that way:

"main" prio=6 tid=0x00369c00 nid=0xd88 waiting for monitor entry [0x003fe000]
   java.lang.Thread.State: BLOCKED (on object monitor)
	at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLocalClass_LockClassLoader(ClasspathManager.java:468)
	- waiting to lock <0x112e4aa0> (a org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader)

By the way, is there a central Wiki page or bug describing symptoms and what to do? I vaguely remember that there were few VM options that worked in some cases.
Comment 11 Thomas Schindl CLA 2011-05-27 11:25:13 EDT
See my blog http://tomsondev.bestsolution.at/2011/03/17/equinox-hibernate-and-concurrency/ pointing to bug 212262
Comment 12 Thomas Watson CLA 2011-05-27 11:46:51 EDT
I'm moving this to Platform->Runtime because I still think there is something strange going on with the jobs here.  Also, I know main is blocked on the class loader lock, but I still do not know who is locking it.  I assume it is the native VM, but I cannot tell for sure here.
Comment 13 Ali K CLA 2011-05-29 19:56:02 EDT
Happpening again in 64bit (latest Eclipse DL'd on Friday May 27) and 64bit JDK! Dump attached!
Comment 14 Ali K CLA 2011-05-29 19:56:41 EDT
Created attachment 196861 [details]
Thread Dump 2
Comment 15 Ali K CLA 2011-05-29 20:59:03 EDT
Adding the following line to eclipse.ini seems to have fixed the problem for now:

-vm C:/dev/tools/java/jdk1.6.0/bin/javaw
Comment 16 Ali K CLA 2011-05-30 19:22:48 EDT
CORRECTION: please ignore my last comment, opened Eclipse this morning and the problem persists.
Comment 17 Ali K CLA 2011-06-02 03:55:51 EDT
I believe I have identified the problem root:

.../eclipse/plugins/org.hibernate.eclipse.jdt.ui_3.4.0.v20110215-1252-H31-GA.jar

when I deleted this jar and restarted eclipse (eclipse -clean &), the deadlock did not happen again!

Not sure if this is a random thing or this jar has always been the root of this evil...
Comment 18 Brian Brooks CLA 2012-05-23 14:06:20 EDT
I just encountered the same failure on

java version "1.6.0_27"
Java(TM) SE Runtime Environment (build 1.6.0_27-b07)
Java HotSpot(TM) Client VM (build 20.2-b06, mixed mode, sharing)

Windows XP SP 3.
Comment 19 Brian Brooks CLA 2012-05-23 14:07:18 EDT
This occurred on Eclipse 3.7 Indigo Service Release 2.
Comment 20 Brian Brooks CLA 2012-05-23 14:30:51 EDT
Created attachment 216149 [details]
Deadlock between JavaReconciler thread running  BreakpointManager and 'main' thread running ProblemsLabelDecorator

Deadlock encountered with Eclipse 3.7 Indigo service release 2
Comment 21 Dani Megert CLA 2012-05-24 02:16:39 EDT
(In reply to comment #20)
> Created attachment 216149 [details]
> Deadlock between JavaReconciler thread running  BreakpointManager and 'main'
> thread running ProblemsLabelDecorator
> 
> Deadlock encountered with Eclipse 3.7 Indigo service release 2

This is the infamous class loader deadlock and not a bug in Eclipse. This should not longer happen if you use JRE 7.
Comment 22 Thomas Schindl CLA 2012-05-24 02:39:02 EDT
Couldn't we adjust our launch settings avoid this locking?
Comment 23 Dani Megert CLA 2012-05-24 02:42:07 EDT
(In reply to comment #22)
> Couldn't we adjust our launch settings avoid this locking?

Not sure what you mean with that.
Comment 24 Thomas Schindl CLA 2012-05-24 02:44:33 EDT
Passing "-XX:+UnsyncloadClass" to your vmargs avoids the deadlock - we are launching all our RCP-Applications with this switch
Comment 25 Thomas Schindl CLA 2012-05-24 02:49:11 EDT
just looked once more and it is:

-XX:+UnlockDiagnosticVMOptions
-XX:+UnsyncloadClass

assuming you are talking about deadlock described in bug 212262
Comment 26 Dani Megert CLA 2012-05-24 02:56:54 EDT
(In reply to comment #24)
> Passing "-XX:+UnsyncloadClass" to your vmargs avoids the deadlock - we are
> launching all our RCP-Applications with this switch

This does not fix all cases (see e.g. bug 212262 comment 37) and it is a non-standard VM option.
Comment 27 Thomas Schindl CLA 2012-05-24 03:22:46 EDT
It fixes not all of them but not unlikely this one - the eclipse.exe already checks for the VM-Type and e.g. sets the permgenspace so I don't see a reason it couldn't set those options if it detects hotspot as the vm, not?
Comment 28 Lars Vogel CLA 2019-11-14 03:40:34 EST
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

If the bug is still relevant, please remove the "stalebug" whiteboard tag.