Bug 393379 - Eclipses crashes after using git and losing window focus
Summary: Eclipses crashes after using git and losing window focus
Status: RESOLVED WORKSFORME
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 4.2.1   Edit
Hardware: PC Linux
: P3 normal with 3 votes (vote)
Target Milestone: ---   Edit
Assignee: Platform-SWT-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: needinfo, triaged
: 424523 (view as bug list)
Depends on:
Blocks:
 
Reported: 2012-11-01 17:10 EDT by Alexander Karatarakis CLA
Modified: 2018-05-16 13:21 EDT (History)
13 users (show)

See Also:


Attachments
Error log (246.88 KB, text/plain)
2012-11-15 09:26 EST, Alexander Karatarakis CLA
no flags Details
Before the crash (1.22 KB, text/plain)
2012-11-15 23:22 EST, Alexander Karatarakis CLA
no flags Details
After the crash (1.68 KB, text/plain)
2012-11-15 23:23 EST, Alexander Karatarakis CLA
no flags Details
Error log 2 (20.32 KB, text/plain)
2012-11-16 08:25 EST, Alexander Karatarakis CLA
no flags Details
Log when reproducing the crash (11.41 KB, text/plain)
2013-05-14 07:04 EDT, Alexander Karatarakis CLA
no flags Details
Cleip crash PID (140.44 KB, text/x-log)
2013-06-09 11:38 EDT, Florian HENRY CLA
no flags Details
Another eclipse crash (142.18 KB, text/x-log)
2013-06-09 11:38 EDT, Florian HENRY CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Alexander Karatarakis CLA 2012-11-01 17:10:45 EDT
System details:
Ubuntu 12.10 64-bit
openjdk-7 (7u9-2.3.3-0ubuntu1~12.10.1)
Eclipse 4.2 SR1 [Version: Juno Service Release 1 Build id: 20120920-0800]

Steps to reproduce:
1) Start any project 

2) Do some basic operation from git (from inside eclipse). This may be changing a file and commiting, changing a file and restoring it ("Replace with file in git index" etc.

3) From this moment, if eclipse loses focus it will "crash". I put this in quotation marks because there is no hs_err_pid*log, the window just disappears.

Things I have tried:
- Using a freshly downloaded version of Eclipse 4.2 SR1
- Using a previous version (4.2)
- Using a new workspace
- Starting eclipse from the console, but there were no errors when the crash occurred

The bug started occurring for me after I installed Ubuntu 12.10 (clean install). I was using Eclipse 4.2 SR1 with openjdk-7 in Ubuntu 12.04 without a problem, but the same configuration causes a problem in 12.10. It is possible that there is something borked in 12.10. I will probably downgrade to verify. 

Since there were no error logs I have not been able to provide something more concrete for the bug resolution. If there is some other log I can look that pinpoints the problem please let me know.
Comment 1 Dani Megert CLA 2012-11-02 06:28:43 EDT
(In reply to comment #0)
> Things I have tried:
> - Using a freshly downloaded version of Eclipse 4.2 SR1
> - Using a previous version (4.2)
> - Using a new workspace
> - Starting eclipse from the console, but there were no errors when the crash
> occurred
> 

Please try this:
1. get the latest Kepler build (this is our 4.3 M3 candidate)
http://download.eclipse.org/eclipse/downloads/drops4/I20121031-2000/

2. start the workbench and install the latest EGit via
Help > Install New Software...
use this update site: http://download.eclipse.org/egit/updates-nightly
Comment 2 Alexander Karatarakis CLA 2012-11-02 12:12:32 EDT
Tested and it keeps happening. I am able to consistently reproduce this when changing branches after a commit. This time, after I restart eclipse after a branch change, all files changed due to the branch change are marked on the Unstaged Changes list and there are project errors all over the place. I cannot refresh or Project->Clean them and the only way to restore is to change branches and back again [it seems that without having made a commit first it does not crash].

Furthermore, I tried downgrading to Ubuntu 12.04 and the bug was NOT present [Tested on 4.2 SR1]. I am back at 12.10 with a fresh install and the bug is back again.
Comment 3 Alexander Karatarakis CLA 2012-11-02 12:14:50 EDT
Correction: It does not seem to crash if i do not make a commit or some other change before changing branches. And sometimes it seems that some change might cause this without even changing branches, but I have not been able to pinpoint which changes yet.
Comment 4 Dani Megert CLA 2012-11-07 07:10:30 EST
Reading the whole bug again and seeing other bugs pass by, I pretty sure you're seeing bug 392967.
Comment 5 Alexander Karatarakis CLA 2012-11-07 08:11:22 EST
^Perhaps, but its not very clear.
I have some more info though:
- When using console git instead of Egit, eclipse does not crash.
- When using Ubuntu 12.04 eclipse does not crash, but with 12.10 it does. This is both with the Unity DE.
- When using Ubuntu 12.10 with LXDE instead of Unity it does not crash either. 

Seems pretty weird..
Comment 6 Dani Megert CLA 2012-11-07 08:15:29 EST
(In reply to comment #5)
> ^Perhaps, but its not very clear.
> I have some more info though:
> - When using console git instead of Egit, eclipse does not crash.
> - When using Ubuntu 12.04 eclipse does not crash, but with 12.10 it does.
> This is both with the Unity DE.
> - When using Ubuntu 12.10 with LXDE instead of Unity it does not crash
> either. 
> 
> Seems pretty weird..

I suspect that the point when it crashes, is when it tries to display something in the internal browser (widget).
Comment 7 Alexander Karatarakis CLA 2012-11-07 10:20:43 EST
Is there some way to turn it off to check?

Under General-> Web browser I have "Use external browser" selected. The Internal browser radio button is shaded, so I can't select it. Is this relevant, or are you referring to something else?
Comment 8 Dani Megert CLA 2012-11-07 10:55:15 EST
(In reply to comment #7)
> Is there some way to turn it off to check?
> 
No, but you could install the correct browser as mentioned in bug 392967 comment 8.
Comment 9 Alexander Karatarakis CLA 2012-11-07 11:09:01 EST
^That was it! :)

sudo apt-get install libwebkitgtk-1.0-0

fixes the problem! So its bug 392967. 

Thank you very much :). 
[Marking as duplicate, hope its the correct action]

*** This bug has been marked as a duplicate of bug 392967 ***
Comment 10 Alexander Karatarakis CLA 2012-11-13 19:15:48 EST
The workaround did not work after all :(, the bug is still present. It seemed alright at first, but then it re-appeared.

I tried with the packages in bug 392967, both the ones in the default repos and the ones mentioned in bug 392967 comment 8 but the bug persists. I also tried the latest Kepler build but no luck.
Comment 11 Dani Megert CLA 2012-11-14 03:36:46 EST
(In reply to comment #10)
> The workaround did not work after all :(, the bug is still present. It
> seemed alright at first, but then it re-appeared.
> 
> I tried with the packages in bug 392967, both the ones in the default repos
> and the ones mentioned in bug 392967 comment 8 but the bug persists. I also
> tried the latest Kepler build but no luck.

OK, in that case please try to provide more details, e.g. exact steps, so that we can try to reproduce it or give you hints on how to debug it further.
Comment 12 Alexander Karatarakis CLA 2012-11-14 15:02:51 EST
In the simplest form:
1) Open a project which is under git.
2) Make changes on branch a and commit them from inside eclipse (EGit).
3) Switch to branch b.

At this point, eclipse will crash when its window loses focus. No crash if you do not switch to another window. 

No error messages when starting eclipse from console, no hs_err_pid*log to give a pointer about where the problem lies.
Comment 13 Dani Megert CLA 2012-11-15 08:04:42 EST
(In reply to comment #12)
> In the simplest form:
> 1) Open a project which is under git.
> 2) Make changes on branch a and commit them from inside eclipse (EGit).
> 3) Switch to branch b.
> 
> At this point, eclipse will crash when its window loses focus. No crash if
> you do not switch to another window. 
> 
> No error messages when starting eclipse from console, no hs_err_pid*log to
> give a pointer about where the problem lies.

I can't reproduce this. I assume you do use a 64-bit JRE?
Comment 14 Alexander Karatarakis CLA 2012-11-15 09:26:41 EST
Created attachment 223605 [details]
Error log
Comment 15 Alexander Karatarakis CLA 2012-11-15 09:27:22 EST
Yes. I have openjdk-7 (7u9-2.3.3-0ubuntu1~12.10.1)
[/usr/lib/jvm/java-7-openjdk-amd64]

But I think I may have found a useful log, which I attach. 

What I found interesting from inspecting the log is at line 1616 and after. There are a lot of FileNotFoundExceptions like this one:

org.eclipse.core.runtime.CoreException: File not found: /media/640GB/Code/EclipseWorkspace/Solverize/Solverize/src/com/solverize/meshless/entities/GaussPointEFG.java.

All files mentioned in such FileNotFoundExceptions exist on branch A but not on branch B. Can it be that when changing branches from A to B and the files disappear that something can't handle this correctly causing the crash?
Comment 16 Dani Megert CLA 2012-11-15 09:52:12 EST
There are a lot of errors in that .log. This looks like something is wrong with your install and/or workspace. I suggest you download the latest build towards 4.2.2:
http://granite.eclipse.org/eclipse/downloads/drops4/M20121107-1200/
and start with a new workspace.

If the crash happens again, check the .log, so that we know the entries are related to the crash.
Comment 17 Alexander Karatarakis CLA 2012-11-15 23:21:54 EST
Ok, used the version you mentioned (the link has "granite" in it, but I swapped it for "download") in a new workspace. I attach the log before the crash and right after the crash.
Comment 18 Alexander Karatarakis CLA 2012-11-15 23:22:47 EST
Created attachment 223639 [details]
Before the crash
Comment 19 Alexander Karatarakis CLA 2012-11-15 23:23:07 EST
Created attachment 223640 [details]
After the crash
Comment 20 Thomas Schindl CLA 2012-11-16 03:29:58 EST
when the JVM crashes you normally get an core dump next to the eclipse.exe. Is there one?
Comment 21 Alexander Karatarakis CLA 2012-11-16 08:18:07 EST
There isn't :/
Comment 22 Alexander Karatarakis CLA 2012-11-16 08:25:34 EST
Created attachment 223655 [details]
Error log 2

Another crash just happened. The error log contains something that looks more useful that the previous one.
Comment 23 Dani Megert CLA 2012-11-19 06:13:32 EST
(In reply to comment #17)
> Ok, used the version you mentioned (the link has "granite" in it, but I
> swapped it for "download") in a new workspace. I attach the log before the
> crash and right after the crash.

There were some problems with the Eclipse.org infrastructure when I copied the link from their website.


(In reply to comment #22)
> Created attachment 223655 [details]
> Error log 2
> 
> Another crash just happened. The error log contains something that looks
> more useful that the previous one.

This is bug 394499 and happens on shutdown.


Without the crash log we can't do much. Since you can reproduce it quite often, the best chances are if you remote debug your IDE and step through the code which causes the crash.
Comment 24 Alexander Karatarakis CLA 2012-11-19 17:03:57 EST
Ok, I will look into it.
Comment 25 Dani Megert CLA 2012-11-20 02:53:53 EST
(In reply to comment #24)
> Ok, I will look into it.

In case yo don't know how to do it see:
http://help.eclipse.org/indigo/index.jsp?topic=%2Forg.eclipse.jdt.doc.user%2Fconcepts%2Fcremdbug.htm
Comment 26 Alexander Karatarakis CLA 2012-12-10 13:42:49 EST
Sorry for the delay, I have not abandoned the bug, but I had to meet some deadlines and installed Ubuntu 12.04 which doesn't have the bug. I will get back to 12.10 as soon as possible.
Comment 27 Alexander Karatarakis CLA 2013-01-04 21:31:59 EST
I tried remote debugging like this:
1) Add these to eclipse.ini
-Xdebug
-Xrunjdwp:transport=dt_socket,address=1044,server=y,suspend=n

2) From the console,
jdb -attach 1044

Output was:
Set uncaught java.lang.Throwable
Set deferred uncaught java.lang.Throwable
Initializing jdb ...
> 

Then, I made eclipse crash. Output was only:

The application has been disconnected


I figured a way that crashes eclipse 100% of the time:
1) Have a project with branchA and branchB. Have File1 in branchA but not branchB.
2) Checkout branchA and make a change in File1. 
3) In Git Staging of Git Repository exploring, right click File1 and choose Replace with File in git index. 
4) Checkout branchB
5) Open the home folder OR switch workspace OR generally do anything that changes the active window to something other than eclipse. Eclipse now crashes.

[I repeat that this only applies to Ubuntu 12.10 with jdk 7. Ubuntu 12.04 with jdk 7 works fine]
Comment 28 Alexander Karatarakis CLA 2013-01-04 21:41:50 EST
Also tried with latest eclipse nightly (eclipse-SDK-N20130103-2000-linux-gtk-x86_64) and latest EGit from http://download.eclipse.org/egit/updates-nightly
and got the same results.
Comment 29 jie fan CLA 2013-01-05 20:58:30 EST
i meet the same thing, just after install a pure 12.10 with a APT installed eclipse.
Comment 30 Dani Megert CLA 2013-01-07 05:09:55 EST
(In reply to comment #27)
> I tried remote debugging like this:
> 1) Add these to eclipse.ini
> -Xdebug
> -Xrunjdwp:transport=dt_socket,address=1044,server=y,suspend=n
> 
> 2) From the console,
> jdb -attach 1044
> 
> Output was:
> Set uncaught java.lang.Throwable
> Set deferred uncaught java.lang.Throwable
> Initializing jdb ...
> > 
> 
> Then, I made eclipse crash. Output was only:
> 
> The application has been disconnected
> 
> 
> I figured a way that crashes eclipse 100% of the time:
> 1) Have a project with branchA and branchB. Have File1 in branchA but not
> branchB.
> 2) Checkout branchA and make a change in File1. 
> 3) In Git Staging of Git Repository exploring, right click File1 and choose
> Replace with File in git index. 
> 4) Checkout branchB
> 5) Open the home folder OR switch workspace OR generally do anything that
> changes the active window to something other than eclipse. Eclipse now
> crashes.
> 
> [I repeat that this only applies to Ubuntu 12.10 with jdk 7. Ubuntu 12.04
> with jdk 7 works fine]

This indicates an SWT problem. Moving to SWT hoping they have Ubuntu 12.10 and can reproduce with above steps.
Comment 31 Alexander Karatarakis CLA 2013-04-24 14:16:08 EDT
Also occurs in Ubuntu 13.04.
Comment 32 Alexander Karatarakis CLA 2013-05-14 07:04:50 EDT
Created attachment 230932 [details]
Log when reproducing the crash

Found a simpler way to reproduce the crash:
1) Have a project with branchA and branchB. Have File1 in branchA but not branchB.
2) Checkout branchA and open File1 in eclipse as you normally would if you wanted to make an edit. No need to do anything, just open it.  
4) Checkout branchB.
5) Open the home folder OR switch workspace OR generally do anything that changes the active window to something other than eclipse. Eclipse now crashes.

So it seems that just having a file open that does not exist in the branch you are changing to causes the crash. The previous reproduction required a random change in said file. 

I cleared the .log file and caused the crash. I attach the errors shown in the .log after the crash. Note that the file EFGSearcher.java mentioned in the log is the one that exists in branchA but not in branchB as in the example. 

[This is with Ubuntu 13.04 64-bit and Eclipse 4.3 M7 with openjdk-7]
Comment 33 Alexander Karatarakis CLA 2013-05-14 07:08:21 EDT
Just to clarify, if you only have files open that also exist in the target branch, then the crash does not occur. You need one that does not exist in the target branch.
Comment 34 Florian HENRY CLA 2013-06-07 05:32:58 EDT
I'm experience the same bug with Ubuntu 13.04, Juno 4.2.2 + JDT + Egit.
In apport log I've got this :
ERROR: apport (pid 6180) Fri Jun  7 11:16:10 2013: called for pid 5983, signal 11, core limit 0
ERROR: apport (pid 6180) Fri Jun  7 11:16:10 2013: executable: /usr/lib/jvm/java-7-openjdk-amd64/jre/bin/java (command line "/usr/bin/java -Xms40m -Xmx1512m -XX:MaxPermSize=1512m -jar /opt/eclipse//plugins/org.eclipse.equinox.launcher_1.3.0.v20120522-1813.jar -os linux -ws gtk -arch x86_64 -showsplash /opt/eclipse//plugins/org.eclipse.platform_4.2.2.v201302041200/splash.bmp -launcher /opt/eclipse/eclipse -name Eclipse --launcher.library /opt/eclipse//plugins/org.eclipse.equinox.launcher.gtk.linux.x86_64_1.1.200.v20120913-144807/eclipse_1502.so -startup /opt/eclipse//plugins/org.eclipse.equinox.launcher_1.3.0.v20120522-1813.jar --launcher.overrideVmargs -exitdata ee800d -vm /usr/bin/java -vmargs -Xms40m -Xmx1512m -XX:MaxPermSize=1512m -jar /opt/eclipse//plugins/org.eclipse.equinox.launcher_1.3.0.v20120522-1813.jar")
ERROR: apport (pid 6180) Fri Jun  7 11:16:10 2013: debug: session gdbus call: (true,)

ERROR: apport (pid 6180) Fri Jun  7 11:18:38 2013: wrote report /var/crash/_usr_lib_jvm_java-7-openjdk-amd64_jre_bin_java.1000.crash

 I will attache the 231 Mo log file.
Comment 35 Florian HENRY CLA 2013-06-09 11:38:34 EDT
Created attachment 232142 [details]
Cleip crash PID
Comment 36 Florian HENRY CLA 2013-06-09 11:38:53 EDT
Created attachment 232143 [details]
Another eclipse crash
Comment 37 Grant Gayed CLA 2013-06-10 10:27:50 EDT
(In reply to comment #36)
This matches bug 400626, you should CC yourself there to be notified of its progress.

I'm not going to mark this as a duplicate of bug 400626 until it's confirmed to be the same issue.  Will follow up here soon.
Comment 38 Alexander Karatarakis CLA 2013-07-25 12:25:25 EDT
Still an issue on the release Eclipse 4.3
(Version: Kepler Release
Build id: 20130614-0229)
Comment 39 Chris Towler CLA 2013-08-06 14:38:15 EDT
I'm having the same issue running Kepler and Ubuntu 13.04.
Comment 40 Marcel Renaud CLA 2013-09-06 15:01:44 EDT
Yes, same here. Tested with Eclipse Kepler & Juno on x86_64 on Ubuntu 13.04 and this crash happens all of the time. 

I don't have to change branches, only commiting a file on git and then switching to another window using the unity launcher causes to silently crash.
Comment 41 Alexander Karatarakis CLA 2013-12-02 09:52:23 EST
Still an issue with Ubuntu 13.10 and eclipse 4.3.1.

Version: Kepler Service Release 1
Build id: 20130919-0819
Comment 42 Paul Webster CLA 2013-12-20 10:35:08 EST
*** Bug 424523 has been marked as a duplicate of this bug. ***
Comment 43 Eric Williams CLA 2018-05-16 13:21:37 EDT
I can't reproduce this with 4.8 M7 on Fedora 28/GTK3.22. Please reopen this ticket if the issue continues to happen.