Bug 404873 - [History View] Sporadic StackOverflowError
Summary: [History View] Sporadic StackOverflowError
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Team (show other bugs)
Version: 4.2.2   Edit
Hardware: All All
: P3 major with 5 votes (vote)
Target Milestone: 4.2.2+   Edit
Assignee: Dani Megert CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 357669 392494 407989 408099 410898 412266 412583 (view as bug list)
Depends on:
Blocks:
 
Reported: 2013-04-04 04:20 EDT by Sascha Vogt CLA
Modified: 2015-02-27 10:48 EST (History)
23 users (show)

See Also:
malgorzata.tomczyk: review+


Attachments
StackOverflowError in CVS history view (97.98 KB, application/octet-stream)
2013-04-04 04:20 EDT, Sascha Vogt CLA
no flags Details
stackoverflow (200.85 KB, text/plain)
2013-04-04 05:55 EDT, Johannes Utzig CLA
no flags Details
Workbench Log (209.88 KB, application/octet-stream)
2013-06-08 15:40 EDT, Joseph Carroll CLA
no flags Details
Workbench Log (209.88 KB, text/plain)
2013-06-08 15:41 EDT, Joseph Carroll CLA
no flags Details
GenericHistoryView source (27.06 KB, application/octet-stream)
2013-06-08 15:42 EDT, Joseph Carroll CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Sascha Vogt CLA 2013-04-04 04:20:35 EDT
Created attachment 229312 [details]
StackOverflowError in CVS history view

From time to time I'm getting a StackOverflowError in the CVS history view (see attached stacktrace).

I cannot reproduce, but when it happens the only way to resolve it, is to shutdown Eclipse and delete the workbench.xmi (as the stackoverflow appears again after restarting Eclipse).
Comment 1 Johannes Utzig CLA 2013-04-04 05:54:15 EDT
happened to me as well. When using the CVS history view, eclipse crashed and refused to start again until I deleted the workspace.xmi.
Comment 2 Johannes Utzig CLA 2013-04-04 05:55:48 EDT
Created attachment 229321 [details]
stackoverflow
Comment 3 Sascha Vogt CLA 2013-04-16 04:25:32 EDT
As several colleagues now also get this on a quite regular basis and it prevents Eclipse from being started again, unless you delete your workspace or know what you have to delete I think this is a major bug. Increase importance
Comment 4 Ullrich Pollähne CLA 2013-04-19 05:18:08 EDT
For me it happens every time a pom.xml is currently open in the m2e POM editor and I try to open a CVS history view which is linked with editor and selection.

If the history of the currently edited POM is requested the stackoverflow happens and the history view that finally opens is empty.
This can be seen in attachment #229321 [details] where finally an SWTError happens.
At the time the SWTError happens it can happen that eclipse tells me to close it due to an error and at this time the workspace.xmi will be corrupted.

If the history of another file is requested while the POM editor is open the stackoverflow happens but there is no SWTError and the history view is displayed with content.

In both cases it takes a lot of time to get the history view shown.


If the history view is not linked with editor and selection the issue does not happen.
Comment 5 Stephan Krull CLA 2013-04-23 08:09:31 EDT
I can reassure this is a critical issue in v4.2.2.

Several colleagues are working with a fresh v4.2.2 install, open (mostly a pom.xml) file and while switching to the history view eclipse crashes with the same log entry as attachment "stackoverflow".

Because of this bug we are using v3.7 now, I would call it critical for our environment.
Comment 6 benoit lefevre CLA 2013-04-26 06:05:05 EDT
Same problem for me here.

Small hint to recover the xmi file :

Even if it's producing a stack overflow when opening a SR2, it's not when i open a SR1.

Thus once i have my workbench opened in SR1, i get ride of all history tabs in all my views and exit SR1.

Then SR2 start with the modified xmi file.
Comment 7 Joseph Carroll CLA 2013-06-08 15:38:48 EDT
I can confirm that all of these are valid.

When the the o.e.t.internal.ui.history.GenericHistoryView receives a selection changed event, where there is an available resource, it enters into an infinite recursive re-entrant loop.  In the attached log I put line breaks at every call to:
org.eclipse.team.internal.ui.history.GenericHistoryView$2.selectionChanged(GenericHistoryView.java:364)

When the stack overflow happens, this causes the workbench part (PageBookView) to become corrupted.  Which will then cause EMF exceptions in the o.e.e4.u.internal.workbench.ResourceHandler.  These exceptions prevent the loading of the previous workbench state.

In addition, @Dani when you updated the GenericHistoryView in August, the changes where not picked up by the 4.2.2 release even though the build identifier is:
org.eclipse.team.ui_3.6.201.v20130125-135424.  

I have attached the source for GHV from the 4.2.2 distro.  The attached source is equivalent to this git commit[1].

Thus there are multiple issues at work here.

Where we need to go from here:
1) Determine if the issue persists with the changes from Dani. I have not tested to see if I am able to recreate the SOE with the latest code (the code that should have been in 4.2.2).  I will try to do that later this coming week, but I am in the middle of a release.

2) Figure out why Dani's changes (and many others) were not picked up by the 4.2.2 build

3) Look at the ResourceHandler and determine if some kind of prevalidation should happen to circumvent/delete corrupted application elements in the workbench.e4xmi. This will allow the workbench to restore all "valid" persisted states. It might actually be better to look at our save handler to prevent corrupted application elements from being persisted in the first place.

JD

[1] http://git.eclipse.org/c/platform/eclipse.platform.team.git/tree/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/history/GenericHistoryView.java?id=8bd7229015f8e34a5c3e23ca9b86504023141b51
Comment 8 Joseph Carroll CLA 2013-06-08 15:40:32 EDT
Created attachment 232133 [details]
Workbench Log
Comment 9 Joseph Carroll CLA 2013-06-08 15:41:51 EDT
Created attachment 232134 [details]
Workbench Log
Comment 10 Joseph Carroll CLA 2013-06-08 15:42:50 EDT
Created attachment 232135 [details]
GenericHistoryView source
Comment 11 Joseph Carroll CLA 2013-06-08 16:33:31 EDT
For reference:

Item #2
bug 410272

Item #3
bug 410273
Comment 12 Dani Megert CLA 2013-06-10 05:03:12 EDT
(In reply to comment #7)
> I can confirm that all of these are valid.

Can you reproduce it with 4.3 RC4? Do you have steps?
Comment 13 Dani Megert CLA 2013-06-10 05:04:46 EDT
*** Bug 408099 has been marked as a duplicate of this bug. ***
Comment 14 Dani Megert CLA 2013-06-11 08:44:00 EDT
(In reply to comment #7)
> In addition, @Dani when you updated the GenericHistoryView in August, the
> changes where not picked up by the 4.2.2 release even though the build
> identifier is:
> org.eclipse.team.ui_3.6.201.v20130125-135424.  

Those changes were made in 'master' for Kepler (4.3). They did not fix a critical bug and hence it is expected that they neither appear in 4.2.1 nor 4.2.2. The identifier is 3.6.201 due to other changes made in team.ui for 4.2.2.
Comment 15 Paul Webster CLA 2013-06-17 11:10:45 EDT
*** Bug 410898 has been marked as a duplicate of this bug. ***
Comment 16 Dani Megert CLA 2013-06-18 10:15:53 EDT
I tried hard to reproduce this using our Kepler release candidate:
http://download.eclipse.org/eclipse/downloads/drops4/S-4.3RC4-201306052000/
but no "luck".

Please reopen, if you can provide more detailed steps using 4.3 RC4 or newer. The problem with the broken workbench.xmi is still tracked by bug 410273.

As you probably know, the source for the "no more handled" can also be caused by some completely different area, and at some point you just run out of handles, e.g. in the History view.
Comment 17 Dani Megert CLA 2013-06-18 10:20:28 EDT
(In reply to comment #16)
> As you probably know, the source for the "no more handled" can also be
> caused by some completely different area, and at some point you just run out
> of handles, e.g. in the History view.

Please ignore that part - it was meant for a different bug report.
Comment 18 Noopur Gupta CLA 2013-07-04 04:22:15 EDT
*** Bug 412266 has been marked as a duplicate of this bug. ***
Comment 19 Aurélien Drouard CLA 2013-07-04 11:06:03 EDT
Please reopen this bug.

Problem reproduced everytime with Eclipse Kepler Release.
1) Create a new Workspace
2) Create a new "Dynamic Web project"
3) Add a new CVS repository
4) Create a new web.xml file in WEB-INF folder
5) Team Share Project...
6) Open "History" view and enable "Link with Editor and Selection"
7) Open web.xml

-> Unhandled event loop exception java.lang.StackOverflowError
I can't restart Eclipse until workbench.xmi is deleted.

CVS History view allways crash if the first opened file is an XML.
If another file was opened before to init the History view, then the XML History is OK. But if I close Eclipse with an XML file opened in the editor, then Eclipse can not restart until deleting workbench.xmi
Comment 20 Dani Megert CLA 2013-07-10 07:45:35 EDT
(In reply to comment #19)

Thanks a lot for the steps! I can now reproduce the problem. It only surfaces with WTP editors which have a structured selection.
Comment 21 Dani Megert CLA 2013-07-10 07:56:42 EDT
*** Bug 407989 has been marked as a duplicate of this bug. ***
Comment 22 Dani Megert CLA 2013-07-10 08:14:52 EDT
Fixed in 'master' with http://git.eclipse.org/c/platform/eclipse.platform.team.git/commit/?id=f743d2de7592e078b2fd7b49dc80a884c6106536


Gosia, please review the fix for inclusion in 4.3.1.
Comment 23 Jörg Thönnes CLA 2013-07-10 08:28:00 EDT
This code:

+					if (!isLinkingEnabled() || !checkIfPageIsVisible()) {
+						return;
+					}
+	
+					showLastSelectedElement();

could be improved to:

if ( isLinkingEnabled() && checkIfPageIsVisible() ) {
    showLastSelectedElement();
}

IHMO, this is more readable by avoiding negation.
Comment 24 Dani Megert CLA 2013-07-10 08:31:22 EDT
(In reply to comment #23)
> This code:
> 
> +					if (!isLinkingEnabled() || !checkIfPageIsVisible()) {
> +						return;
> +					}
> +	
> +					showLastSelectedElement();
> 
> could be improved to:
> 
> if ( isLinkingEnabled() && checkIfPageIsVisible() ) {
>     showLastSelectedElement();
> }
> 
> IHMO, this is more readable by avoiding negation.

Sure. Feel free to file a separate bug report for this, as it is unrelated to this one.
Comment 25 Jörg Thönnes CLA 2013-07-10 08:38:51 EDT
As you touched this part of code about 20 minutes ago it would be a simple change for you. I do not see any need to file an extra bug for this simple refactoring.

I was just curious and looked at the git diff link you provided and it caught my eye. Maybe the refactoring is not correct for some reason...
Comment 26 Dani Megert CLA 2013-07-11 07:28:27 EDT
*** Bug 412583 has been marked as a duplicate of this bug. ***
Comment 27 Dani Megert CLA 2013-07-11 07:46:16 EDT
*** Bug 357669 has been marked as a duplicate of this bug. ***
Comment 28 Dani Megert CLA 2013-07-15 04:00:18 EDT
*** Bug 392494 has been marked as a duplicate of this bug. ***
Comment 29 Dani Megert CLA 2013-07-22 09:00:39 EDT
*** Bug 405262 has been marked as a duplicate of this bug. ***
Comment 30 Malgorzata Janczarska CLA 2013-07-25 12:39:53 EDT
(In reply to comment #22)
> Fixed in 'master' with
> http://git.eclipse.org/c/platform/eclipse.platform.team.git/commit/
> ?id=f743d2de7592e078b2fd7b49dc80a884c6106536
> 
> 
> Gosia, please review the fix for inclusion in 4.3.1.
I'm OK with including this fix in 4.3.1, but shouldn't isUpdatingSelection be volatile?
Comment 31 Dani Megert CLA 2013-07-29 07:05:36 EDT
(In reply to comment #30)
> I'm OK with including this fix in 4.3.1, but shouldn't isUpdatingSelection
> be volatile?

No, this is not needed in this case because the selection change event is always sent by the same thread.

Fixed with http://git.eclipse.org/c/platform/eclipse.platform.team.git/commit/?id=f8de70ec6154b04986c8249dea13c573a722c669
Comment 32 Miroslav Zaťko CLA 2013-08-01 04:59:44 EDT
still here in 
Eclipse Java EE IDE for Web Developers.
Version: Kepler Release
Build id: 20130614-0229
Comment 33 David I CLA 2013-10-03 11:49:38 EDT
I also confirm that this is still present in 

Eclipse Java EE IDE for Web Developers.
Version: Kepler Release
Build id: 20130614-0229
Comment 34 Aurélien Drouard CLA 2013-10-03 12:01:04 EDT
Resolved in Kepler Service Release 1
Build id: 20130919-0819
Comment 35 Dani Megert CLA 2013-10-04 02:41:16 EDT
(In reply to Miroslav Zaťko from comment #32)
> still here in 
> Eclipse Java EE IDE for Web Developers.
> Version: Kepler Release
> Build id: 20130614-0229

(In reply to David I from comment #33)
> I also confirm that this is still present in 
> 
> Eclipse Java EE IDE for Web Developers.
> Version: Kepler Release
> Build id: 20130614-0229

You can take a look at the target milestone (in this case 4.3.1 aka Kepler SR1) to see when a bug got fixed. If that is newer than your build, then it is obvious that your build does not contain the fix.
Comment 36 David I CLA 2013-10-04 09:28:34 EDT
It looks like SR1 fixed the issue.