Bug 841313

Summary: Eclipse fails to start with closed worspace
Product: [Fedora] Fedora Reporter: Severin Gehwolf <sgehwolf>
Component: eclipseAssignee: Krzysztof Daniel <kdaniel>
Status: CLOSED NOTABUG QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 17CC: akurtako, andjrobins, jerboaa, kdaniel, mbenitez, overholt, rgrunber, swagiaal
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-08-08 09:04:04 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
my .metadata/.log
none
Error message (which doesn't say anything really)
none
Today's workspace log
none
short eclipse crash log caused by HGE and non cleanly shut down ws none

Description Severin Gehwolf 2012-07-18 16:24:30 UTC
Created attachment 598931 [details]
my .metadata/.log

Description of problem:
I'm not sure what causes this (likely HGEclipse?). Sometimes when I try to start eclipse it fails to start with nothing more than to have a look at the worspace log.

Version-Release number of selected component (if applicable):
$rpm -q eclipse-platform:
eclipse-platform-4.2.0-2.fc17.x86_64

How reproducible:
Not sure, but have seen it happening 3+ times the last 2 weeks.

Steps to Reproduce:
I don't know for sure (attaching log)
  
Actual results:
Error message pops up with advice to look at .metadata/.log (attached).

Expected results:
Eclipse starts.

Additional info:
mv ~/.eclipse{,-broken}
eclipse -data sameworspace

works.

Thoughts?

Comment 1 Krzysztof Daniel 2012-07-18 16:53:49 UTC
assigning for investigation

Comment 2 Krzysztof Daniel 2012-07-18 17:04:01 UTC
Severin,
Eclipse creates a new .log every time it reaches certain size. The attached one is the 4th one ;-).

I need a detailed description, error message or a screenshot of the eclipse that has crashed. There must be something. The .log seems to indicate there is a problem with HG cache (like you'd closed hg project, closed eclipse, and the cache remained untouched). But that's my guess. 

Things that you do just before you shutdown Eclipse are important. Try to remember them (if possible).

Comment 3 Severin Gehwolf 2012-07-19 08:04:01 UTC
(In reply to comment #2)
> Severin,
> Eclipse creates a new .log every time it reaches certain size. The attached
> one is the 4th one ;-).

Do you want me to post the other logs? There are quite a few of them:
$ ls ../.metadata/.bak*
../.metadata/.bak_0.log  ../.metadata/.bak_4.log  ../.metadata/.bak_8.log
../.metadata/.bak_1.log  ../.metadata/.bak_5.log  ../.metadata/.bak_9.log
../.metadata/.bak_2.log  ../.metadata/.bak_6.log
../.metadata/.bak_3.log  ../.metadata/.bak_7.log

> I need a detailed description, error message or a screenshot of the eclipse
> that has crashed. There must be something. The .log seems to indicate there
> is a problem with HG cache (like you'd closed hg project, closed eclipse,
> and the cache remained untouched). But that's my guess. 

I'd love to give you that, but I'm a bit puzzled myself what's happening...

Now that's interesting: I've backed up my broken ~/.eclipse yesterday and moved the broken version (well yesterday anyways) back into place today and today eclipse seems to be able to start with yesterday's broken ~/.eclipse again. This I've done in order to get you a screenshot of the error message.

I guess all I can do is to follow up on this once I have it happening again. Will let you know by commenting on this bug if that happens. Feel free to ignore for now. Thanks for your thoughts, Chris!

> Things that you do just before you shutdown Eclipse are important. Try to
> remember them (if possible).

I don't think I've done anything unusual. Just clicked the [X] to close eclipse.

More info (hopefully) in an undetermined amount of time :)

Comment 4 Severin Gehwolf 2012-07-19 12:31:39 UTC
Created attachment 599128 [details]
Error message (which doesn't say anything really)

It just happened again, attaching screenshot of error message. What have I done? File => Restart :)

Comment 5 Krzysztof Daniel 2012-07-19 12:56:23 UTC
Why have you had to restart Eclipse?
I need full log, as none of the errors in the previous log could prevent Eclipse from starting.

So, this dialog appeared, you clicked ok, and Eclipse died without further messages/dialogs?

Comment 6 Severin Gehwolf 2012-07-19 13:22:58 UTC
(In reply to comment #5)
> Why have you had to restart Eclipse?

Because I was testing a few system installed jar changes (different exported packages, etc). I've got a target platform defined which has those jars added. In order for eclipse to pick up the changed metadata I had to restart. I don't think this is relevant.

> I need full log, as none of the errors in the previous log could prevent
> Eclipse from starting.

This is weird. I had ~/.eclipse copied away again, then started eclipse with a missing ~/.eclipse dir (which worked). No I've tried to copy it back to reproduce again and it's gone again...

Attaching today's log anyway.
 
> So, this dialog appeared, you clicked ok, and Eclipse died without further
> messages/dialogs?

The splash screen disappeears (no progress is shown since it doesn't get that far) and this error message pops up. All I can do is click on close and that's it. At the terminal where I've started eclipse from unblocked and waits for more input on the shell.

Comment 7 Severin Gehwolf 2012-07-19 13:24:12 UTC
Created attachment 599147 [details]
Today's workspace log

Comment 8 Krzysztof Daniel 2012-07-25 14:17:35 UTC
I believe this is the direct reason of the crash:

!ENTRY org.eclipse.jdt.core 4 4 2012-07-19 14:44:07.498
!MESSAGE Unable to read variable and containers file
!STACK 0
java.io.EOFException
	at java.io.DataInputStream.readInt(DataInputStream.java:392)
	at org.eclipse.jdt.internal.core.JavaModelManager$VariablesAndContainersLoadHelper.loadInt(JavaModelManager.java:3499)
	at org.eclipse.jdt.internal.core.JavaModelManager$VariablesAndContainersLoadHelper.loadVariables(JavaModelManager.java:3565)
	at org.eclipse.jdt.internal.core.JavaModelManager$VariablesAndContainersLoadHelper.load(JavaModelManager.java:3368)
	at org.eclipse.jdt.internal.core.JavaModelManager.loadVariablesAndContainers(JavaModelManager.java:3204)
	at org.eclipse.jdt.internal.core.JavaModelManager.startup(JavaModelManager.java:4909)
	at org.eclipse.jdt.core.JavaCore.start(JavaCore.java:5475)

it looks like:
(a) file system is corrupt
(b) hg owns much more than it should and it changes (commits/restore) the jdt internal file when it should not.
JDT fails to read the file, so it fails to start, so Eclipse fails to start.

Could you check if you have any file matching classpathVariable or classpathContainer under hg control?

Comment 9 Severin Gehwolf 2012-07-25 15:42:49 UTC
(In reply to comment #8)
> I believe this is the direct reason of the crash:
> 
> !ENTRY org.eclipse.jdt.core 4 4 2012-07-19 14:44:07.498
> !MESSAGE Unable to read variable and containers file
> !STACK 0
> java.io.EOFException
> 	at java.io.DataInputStream.readInt(DataInputStream.java:392)
> 	at
> org.eclipse.jdt.internal.core.
> JavaModelManager$VariablesAndContainersLoadHelper.loadInt(JavaModelManager.
> java:3499)
> 	at
> org.eclipse.jdt.internal.core.
> JavaModelManager$VariablesAndContainersLoadHelper.
> loadVariables(JavaModelManager.java:3565)
> 	at
> org.eclipse.jdt.internal.core.
> JavaModelManager$VariablesAndContainersLoadHelper.load(JavaModelManager.java:
> 3368)
> 	at
> org.eclipse.jdt.internal.core.JavaModelManager.
> loadVariablesAndContainers(JavaModelManager.java:3204)
> 	at
> org.eclipse.jdt.internal.core.JavaModelManager.startup(JavaModelManager.java:
> 4909)
> 	at org.eclipse.jdt.core.JavaCore.start(JavaCore.java:5475)
> 
> it looks like:
> (a) file system is corrupt

Doubt it.

> (b) hg owns much more than it should and it changes (commits/restore) the
> jdt internal file when it should not.
> JDT fails to read the file, so it fails to start, so Eclipse fails to start.

If JDT fails to start, why would that prevent the platform from starting?

> Could you check if you have any file matching classpathVariable or
> classpathContainer under hg control?

There is no such files by the name of classpathVariable or classpathContainer. Since they don't exist, they're not under hg control. Am I missing something?

Thanks for looking into this!

Comment 10 Krzysztof Daniel 2012-07-26 07:41:05 UTC
About logs - remove them all - you have there to many sessions and it is really hard to figure out what is happening. Once the issue happens again, upload them all. You may clean up logs from time to time after Eclipse successfully starts.

Regarding the jdt file - ignore it. JDT fails to write it first. It looks like that on Eclipse start up some change is triggered (and there are multiple threading issues - ui access from non-ui thread, which surely breaks some hg operations).


I need to think about this to find out possible causes.

Comment 11 Severin Gehwolf 2012-07-26 09:59:30 UTC
(In reply to comment #10)
> About logs - remove them all - you have there to many sessions and it is
> really hard to figure out what is happening. Once the issue happens again,
> upload them all. You may clean up logs from time to time after Eclipse
> successfully starts.

Ok. I'm not using HGE heavily anymore. So might take some time for it to happen again.

> Regarding the jdt file - ignore it. JDT fails to write it first. It looks
> like that on Eclipse start up some change is triggered (and there are
> multiple threading issues - ui access from non-ui thread, which surely
> breaks some hg operations).
> I need to think about this to find out possible causes.

Ok, cool. I'd really like to hear about it if you have theories.

Comment 12 Severin Gehwolf 2012-08-08 09:02:11 UTC
Created attachment 602971 [details]
short eclipse crash log caused by HGE and non cleanly shut down ws

Comment 13 Severin Gehwolf 2012-08-08 09:04:04 UTC
I've attached a short log about this again. It looks like HGE together with a not cleanly shut-down eclipse workspace causes this. Steps to reproduce are something along the lines of:

1. Edit Mercurial Java project in workspace
2. Kill eclipse (e.g. eclipse was started from terminal && press ctrl+c on that
   terminal)
3. Attempt to use the same workspace (note the "workspace exited with unsaved 
   changes in the previous session" message)

My current workaround is as follows (yum installed eclipse and p2 installed HGE):

$ mv ~/.eclipse{,-2012-08-08}
$ eclipse -data path/to/offending/workspace
(this should work fine and gives eclipse a chance to clean up workspace; close eclipse after)
$ rm -rf ~/.eclipse
$ mv ~/.eclipse{-2012-08-08,}
$ eclipse -data path/to/offending/workspace
(this should work)

I'm closing this one as not-a-bug (it's an HGE issue).