Community
Participate
Working Groups
Created attachment 288183 [details] Stack Trace Of Recursive Upgraded from Oxygen to 2021-12 and now the build is getting a stackoverflow exception because of an infinite recursive loop. Initially it looked looked like the loop was org.eclipse.core.runtime.ProgressMonitorWrapper.internalWorked(ProgressMonitorWrapper.java:101) org.eclipse.core.runtime.SubProgressMonitor.internalWorked(SubProgressMonitor.java:180) org.eclipse.core.runtime.ProgressMonitorWrapper.internalWorked(ProgressMonitorWrapper.java:101) org.eclipse.core.runtime.SubProgressMonitor.internalWorked(SubProgressMonitor.java:180) But a longer stack trace which is attached shows an earlier loop of org.eclipse.cdt.managedbuilder.internal.core.CommonBuilder.build(CommonBuilder.java:496) org.eclipse.cdt.managedbuilder.internal.core.CommonBuilder.buildReferencedConfigs(CommonBuilder.java:556) org.eclipse.cdt.managedbuilder.internal.core.CommonBuilder.build(CommonBuilder.java:496) org.eclipse.cdt.managedbuilder.internal.core.CommonBuilder.buildReferencedConfigs(CommonBuilder.java:556) org.eclipse.cdt.managedbuilder.internal.core.CommonBuilder.build(CommonBuilder.java:496) org.eclipse.cdt.managedbuilder.internal.core.CommonBuilder.buildReferencedConfigs(CommonBuilder.java:556) org.eclipse.cdt.managedbuilder.internal.core.CommonBuilder.build(CommonBuilder.java:496) org.eclipse.cdt.managedbuilder.internal.core.CommonBuilder.buildReferencedConfigs(CommonBuilder.java:556) org.eclipse.cdt.managedbuilder.internal.core.CommonBuilder.build(CommonBuilder.java:496) org.eclipse.cdt.managedbuilder.internal.core.CommonBuilder.buildReferencedConfigs(CommonBuilder.java:556) org.eclipse.cdt.managedbuilder.internal.core.CommonBuilder.build(CommonBuilder.java:496) org.eclipse.cdt.managedbuilder.internal.core.CommonBuilder.build(CommonBuilder.java:463) org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:853) org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:232)
So Oxygen is quite a while ago, so not sure what the particular problem may be here. The biggest contenders are a regression from one of Bug 546407 or Bug 571134. Can you provide additional information? For example Bug 546407 was fixed in CDT 9.9 aka Eclipse 2019-09. If your example fails in that version that would explain it. Bug 571134 was fixed in CDT 10.3 aka 2021-06. ---- > But a longer stack trace which is attached shows an earlier loop of Thanks for this longer analysis. The error is certainly because build is calling buildReferencedConfigs and recursing. Each of those calls makes a new SubProgressMonitor that is chained, so operations such as done need to flow through each item in the chain. The transition point is: org.eclipse.core.runtime.SubProgressMonitor.internalWorked(SubProgressMonitor.java:180) org.eclipse.core.runtime.ProgressMonitorWrapper.internalWorked(ProgressMonitorWrapper.java:101) org.eclipse.core.runtime.SubProgressMonitor.internalWorked(SubProgressMonitor.java:180) org.eclipse.core.runtime.ProgressMonitorWrapper.internalWorked(ProgressMonitorWrapper.java:101) org.eclipse.core.runtime.SubProgressMonitor.done(SubProgressMonitor.java:166) org.eclipse.cdt.managedbuilder.internal.core.CommonBuilder.buildReferencedConfigs(CommonBuilder.java:568) org.eclipse.cdt.managedbuilder.internal.core.CommonBuilder.build(CommonBuilder.java:496) org.eclipse.cdt.managedbuilder.internal.core.CommonBuilder.buildReferencedConfigs(CommonBuilder.java:556) org.eclipse.cdt.managedbuilder.internal.core.CommonBuilder.build(CommonBuilder.java:496) org.eclipse.cdt.managedbuilder.internal.core.CommonBuilder.buildReferencedConfigs(CommonBuilder.java:556)
I can reproduce the problem. The code stack overflows when there is a cycle in the referenced projects/configurations. Please review the references in Project Properties -> C/C++ General -> Path and Symbols -> References tab and let me know if there are any cycles between your projects in your workspace. The cycle may involve multiple configurations - see steps to reproduce for some more insight. --- Steps to reproduce: - Make a project - Project Properties -> C/C++ General -> Path and Symbols -> References - With Configuration "Debug" selected (drop down at top of UI), make the reference to "Release" - Change configuration to "Release" and make that reference "Debug" The same type of cycle can be done between multiple projects. --- What to do next: - We need to detect this cycle at some point.
*** Bug 561568 has been marked as a duplicate of this bug. ***
@Umair - the code from Bug 546407 has caused this regression. Are you able to have a look at this?
Turns out some work was started on this already - https://git.eclipse.org/r/c/cdt/org.eclipse.cdt/+/160115/ - lets see if we can complete it now.
We are in the last couple of days for CDT 10.6.0 - I have sent out a request for a review on this to see if it is suitable to put in at the last moment - https://www.eclipse.org/lists/cdt-dev/msg35134.html
I can confirm this is the bug I am seeing. I tracked down two projects referencing each other. I took the uneccessary reference out and the build worked. Thanks for the feedback.
Gerrit change https://git.eclipse.org/r/c/cdt/org.eclipse.cdt/+/160115 was merged to [master]. Commit: http://git.eclipse.org/c/cdt/org.eclipse.cdt.git/commit/?id=96f928152f70c48029478356e104e90fb997ad02
(In reply to Allan Wallace from comment #7) > I can confirm this is the bug I am seeing. I tracked down two projects > referencing each other. I took the uneccessary reference out and the build > worked. > Thanks for the feedback. Thank you Allan for taking the time to file the bug and confirming that your immediate issue is worked around. The CDT 10.6.0 version of CDT that is out in the next few days won't have the stackoverflow, but it is certainly better to not have the cycle in your projects.