Bug 449116 - Eclipse Luna randomly fails to launch
Summary: Eclipse Luna randomly fails to launch
Status: RESOLVED WORKSFORME
Alias: None
Product: Equinox
Classification: Eclipse Project
Component: Framework (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows 7
: P3 critical (vote)
Target Milestone: ---   Edit
Assignee: equinox.framework-inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: needinfo
Depends on:
Blocks:
 
Reported: 2014-10-28 19:16 EDT by Quantum Projects CLA
Modified: 2018-01-08 10:22 EST (History)
4 users (show)

See Also:


Attachments
Eclipse Log File (46.47 KB, application/octet-stream)
2014-10-28 19:16 EDT, Quantum Projects CLA
no flags Details
JVisualVM Thread Dump (6.29 KB, text/plain)
2014-12-24 15:38 EST, Quantum Projects CLA
no flags Details
Eclipse Log File - 2014.12.24 (46.46 KB, text/plain)
2014-12-24 15:41 EST, Quantum Projects CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Quantum Projects CLA 2014-10-28 19:16:22 EDT
Created attachment 248235 [details]
Eclipse Log File

OS: Windows 7 x64.
JVM: 1.8.0_25 x64.
eclipse.buildId=4.4.1.M20140925-0400

Installed Plugins:
- Papyrus (latest version): http://www.eclipse.org/papyrus


1. Overview

   Eclipse Luna randomly fails to launch after a regular computer boot.

2. Steps to reproduce

   2.1. Install Eclipse Luna Modeling Package (http://www.eclipse.org/downloads
   /packages/eclipse-modeling-tools/lunasr1) for 64bits.

   2.2. Launch Eclipse.

   2.3. Update all components and install Papyrus.

   2.4. Restart Eclipse.

   2.5. Import an existing Project, do some work, save several times, exit the application.

   2.6. Shut the PC down.

   2.7. After a couple of days of successful operations, suddenly Eclipse fails to launch after a regular computer boot, producing a log in eclipse\configuration, but no log in the .metadata folder.

3. Unsuccessful Attempts to fix the issue

   3.1. append the -clear and -clearPersistentState to eclipse.exe.
   3.2. Delete the .metadata folder.

4. Successful attempt to fix the issue

   4.1. Reinstall Eclipse.

5. Unusual settings

   5.1. The project I was working on isn't stored in my regular workbench directory. However, I've tried to use -data to point to the directory where this project is stored, but the bug still happens.
Comment 1 Quantum Projects CLA 2014-10-28 20:00:25 EDT
Just to make it clear, once it fails once, it will never launch successfully again.
Comment 2 Dani Megert CLA 2014-10-31 10:02:11 EDT
Tom, does this ring a bell:

Caused by: java.lang.NullPointerException
	at org.eclipse.osgi.internal.framework.BundleContextImpl.close(BundleContextImpl.java:92)
Comment 3 Thomas Watson CLA 2014-10-31 10:42:16 EDT
(In reply to Dani Megert from comment #2)
> Tom, does this ring a bell:
> 
> Caused by: java.lang.NullPointerException
> 	at
> org.eclipse.osgi.internal.framework.BundleContextImpl.
> close(BundleContextImpl.java:92)

That happens if the framework has shutdown and there are still active threads trying to do something.  It appears there is a deadlock that we have broken out of:

<log>

!SESSION 2014-10-28 14:20:32.665 -----------------------------------------------
eclipse.buildId=4.4.1.M20140925-0400
java.version=1.8.0_25
java.vendor=Oracle Corporation
BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US
Framework arguments:  -product org.eclipse.epp.package.modeling.product
Command-line arguments:  -os win32 -ws win32 -arch x86_64 -product org.eclipse.epp.package.modeling.product

!ENTRY org.eclipse.equinox.ds 2 0 2014-10-28 14:21:04.801
!MESSAGE [SCR - WorkThread] Timeout occurred! Thread was blocked on processing [QueuedJob] WorkPerformer: org.eclipse.equinox.internal.ds.SCRManager@69c26ad1; actionType 1

!ENTRY org.eclipse.equinox.ds 2 0 2014-10-28 14:21:05.191
!MESSAGE [SCR] Enabling components of bundle org.eclipse.ui.trace did not complete in 30000 ms 

</log>

The framework continues to try and launch the application, but then fails:


<log>

!ENTRY org.eclipse.osgi 4 0 2014-10-28 14:21:10.401
!MESSAGE Application error
!STACK 1
java.lang.IllegalStateException: Unable to acquire application service. Ensure that the org.eclipse.core.runtime bundle is resolved and started (see config.ini).
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:78)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1465)
</log>

After this happens EclipseStarter shutsdown the framework.  I imagine at this point the deadlocked threads continue on, but the framework is shutdown and we see the NPEs start to happen.  It would be good to get a thread dump during the initial 30 second hang while launching.  The hang is the real cause of the trouble here I think.
Comment 4 Quantum Projects CLA 2014-10-31 12:58:43 EDT
So far, this bug IS NOT reproducible using Eclipse 32bits.

I remembered two things:

1. While I was using Eclipse x64, when I tried to install Papyrus through Help>Install Modeling Components, it said that the package was unavailable. So, I used Help>Install New Software, providing the Papyrus update link available on their website.

2. However, in Eclipse x32, The Help>Install Modeling Components procedure worked as expected.

It seems to me that there is a problem with the Papyrus component when used with Eclipse x64.

How can I create this dump file you've mentioned, Thomas?
Comment 5 Thomas Watson CLA 2014-10-31 14:31:54 EDT
(In reply to Quantum Projects from comment #4)
> How can I create this dump file you've mentioned, Thomas?

See https://wiki.eclipse.org/How_to_report_a_deadlock

Thanks.
Comment 6 Quantum Projects CLA 2014-10-31 14:39:29 EDT
Ok, I'll try that in the weekend and post the thread dump here.
Comment 7 Thomas Watson CLA 2014-11-11 11:14:52 EST
(In reply to Quantum Projects from comment #6)
> Ok, I'll try that in the weekend and post the thread dump here.

Any luck getting a thread dump?  Closing as worksforme for now.  Please reopen once you have a dump we can look at.  Thanks.
Comment 8 Quantum Projects CLA 2014-11-12 13:29:29 EST
Thomas,

So far, I've failed to reproduce the bug.

I'll keep trying, keep you posted.
Comment 9 Quantum Projects CLA 2014-12-24 15:38:24 EST
Created attachment 249621 [details]
JVisualVM Thread Dump
Comment 10 Quantum Projects CLA 2014-12-24 15:40:11 EST
The bug has finally happened again.

I'm using the Windows 7 Home Premium 64x, Java VM 8.25 x32 and Eclipse Luna x32, plus the Papyrus addon to Eclipse.

From October till today, the application was running just fine.

Today, as I tried to run it, the bug happened again. The application won't start anymore.
Comment 11 Quantum Projects CLA 2014-12-24 15:41:05 EST
Created attachment 249622 [details]
Eclipse Log File - 2014.12.24
Comment 12 Thomas Watson CLA 2015-01-05 11:39:48 EST
(In reply to Quantum Projects from comment #9)
> Created attachment 249621 [details]
> JVisualVM Thread Dump

When was this dump taken?  It seems to be after eclipse code has exited but the VM is still up.  I don't see anything that indicates a hang in eclipse code.
Comment 13 Quantum Projects CLA 2015-01-09 13:35:34 EST
It was taken as Eclipse was launched. As soon as it appears in the thread list of the jvisualvm, I link it and request a thread dump.

I also found it strange that there were so few lines of log.
Comment 14 Thomas Watson CLA 2018-01-08 10:22:54 EST
Closing this old bug out as worksforme.  Please re-open or open a new bug if similar issues are still reproducible with the latest release.