Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 510537 - java.lang.StackOverflowError when opening three projects that reference each other
Summary: java.lang.StackOverflowError when opening three projects that reference each ...
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: IDE (show other bugs)
Version: 4.6   Edit
Hardware: PC Windows 7
: P3 major (vote)
Target Milestone: 4.6.3   Edit
Assignee: Lars Vogel CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 506594 (view as bug list)
Depends on: 475785
Blocks:
  Show dependency tree
 
Reported: 2017-01-16 16:50 EST by Michael Harrington CLA
Modified: 2017-01-19 04:48 EST (History)
4 users (show)

See Also:
daniel_megert: review+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Harrington CLA 2017-01-16 16:50:15 EST
Eclipse produces a java.lang.StackOverflowError when trying to open three projects that all reference each other. I reproduced the issue with CDT C projects but the call stack doesn't appear to be CDT specific.

To produce:

1) Create three projects, "projectA", "projectB", and "projectC"
2) For each project, add project references to each of the other projects in the project properties. "projectA" should reference "projectB" and "projectC", "projectB" should reference "projectA" and "projectC", and "projectC" should reference "projectA" and "projectB"
3) Close all three projects
4) Open all three projects at the same time and note the exception

!MESSAGE An internal error occurred during: "Open Project".
!STACK 0
java.lang.StackOverflowError
	at org.eclipse.core.internal.jobs.DeadlockDetector.reduceGraph(DeadlockDetector.java:516)
	at org.eclipse.core.internal.jobs.DeadlockDetector.lockReleased(DeadlockDetector.java:353)
	at org.eclipse.core.internal.jobs.LockManager.removeLockThread(LockManager.java:282)
	at org.eclipse.core.internal.jobs.OrderedLock.setCurrentOperationThread(OrderedLock.java:254)
	at org.eclipse.core.internal.jobs.OrderedLock.doRelease(OrderedLock.java:189)
	at org.eclipse.core.internal.jobs.OrderedLock.release(OrderedLock.java:234)
	at org.eclipse.core.internal.resources.WorkManager.checkOut(WorkManager.java:164)
	at org.eclipse.core.internal.resources.Workspace.endOperation(Workspace.java:1481)
	at org.eclipse.core.internal.resources.Project.open(Project.java:1078)
	at org.eclipse.core.internal.resources.Project.open(Project.java:1087)
	at org.eclipse.ui.actions.OpenResourceAction$1.doOpenWithReferences(OpenResourceAction.java:228)
	at org.eclipse.ui.actions.OpenResourceAction$1.doOpenWithReferences(OpenResourceAction.java:255)
	at org.eclipse.ui.actions.OpenResourceAction$1.doOpenWithReferences(OpenResourceAction.java:255)
	at org.eclipse.ui.actions.OpenResourceAction$1.doOpenWithReferences(OpenResourceAction.java:255)
	at org.eclipse.ui.actions.OpenResourceAction$1.doOpenWithReferences(OpenResourceAction.java:255)
Comment 1 Dani Megert CLA 2017-01-17 05:40:02 EST
*** Bug 506594 has been marked as a duplicate of this bug. ***
Comment 2 Dani Megert CLA 2017-01-17 05:49:39 EST
This worked until 4.5.2 and got broken during 4.6.
Comment 3 Dani Megert CLA 2017-01-17 06:09:15 EST
This got introduced when the code was changed to use SubMonitor.
Comment 4 Dani Megert CLA 2017-01-17 06:10:19 EST
Stefan, please fix for M5 and 4.6.3.
Comment 5 Lars Vogel CLA 2017-01-17 06:32:26 EST
Looks like the following the check if the project is already open was unintentially removed. 

I have a fix.
Comment 6 Eclipse Genie CLA 2017-01-17 06:33:21 EST
New Gerrit change created: https://git.eclipse.org/r/88849
Comment 8 Lars Vogel CLA 2017-01-17 08:29:41 EST
Thanks for the bug report Michael. Could you test the fix in tomorrows I-Build from http://download.eclipse.org/eclipse/downloads/?
Comment 9 Michael Harrington CLA 2017-01-17 08:40:23 EST
(In reply to Lars Vogel from comment #8)
> Thanks for the bug report Michael. Could you test the fix in tomorrows
> I-Build from http://download.eclipse.org/eclipse/downloads/?

Thanks for the quick turnaround! Certainly, I'll test it out tomorrow.
Comment 10 Michael Harrington CLA 2017-01-18 10:38:07 EST
(In reply to Lars Vogel from comment #8)
> Thanks for the bug report Michael. Could you test the fix in tomorrows
> I-Build from http://download.eclipse.org/eclipse/downloads/?

Confirmed that I20170117-2000 solves the problem. Thanks!
Comment 11 Eclipse Genie CLA 2017-01-19 03:21:56 EST
New Gerrit change created: https://git.eclipse.org/r/89075
Comment 12 Eclipse Genie CLA 2017-01-19 03:43:08 EST
New Gerrit change created: https://git.eclipse.org/r/89078
Comment 15 Lars Vogel CLA 2017-01-19 04:48:13 EST
Downport completed. Thanks Michael for the bug report and the testing.