Bug 442594 - java.lang.StackOverflowError if field "Fragment-Host" references itself
Summary: java.lang.StackOverflowError if field "Fragment-Host" references itself
Status: RESOLVED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Tycho (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Jan Sievers CLA
QA Contact:
URL:
Whiteboard:
Keywords: contributed, helpwanted
Depends on:
Blocks:
 
Reported: 2014-08-26 11:08 EDT by Riccardo Gorza CLA
Modified: 2021-04-28 16:51 EDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Riccardo Gorza CLA 2014-08-26 11:08:06 EDT
An "eclipse-test-plugin" referencing itself as the fragment-host produces a java.lang.StackOverflowError
===========================
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: fubar.test.automax.nftests
Bundle-SymbolicName: fubar.test.automax.nftests
Bundle-Version: 1.0.0.qualifier
Bundle-ActivationPolicy: lazy
Bundle-ActivationPolicy: lazy
Bundle-Vendor: FUBAR
Bundle-RequiredExecutionEnvironment: JavaSE-1.7
Fragment-Host: fubar.test.automax.nftests
Require-Bundle: org.junit
===========================

The above MANIFEST.MF is of course a developers mistake, but it produces the following stackoverflow:

===========================
15:58:08 [INFO] Resolving class path of MavenProject: fubar:fubar.server.transfer.test:4.0.0-SNAPSHOT @ /appl-test/jenkinsSlave/workspace/FUBAR-Build/fubar.server.transfer.test/pom.xml
15:58:08 [INFO] Computing target platform for MavenProject: fubar:fubar.test.automax:4.0.0-SNAPSHOT @ /appl-test/jenkinsSlave/workspace/FUBAR-Build/fubar.test.automax/pom.xml
15:58:08 [INFO] Resolving dependencies of MavenProject: fubar:fubar.test.automax:4.0.0-SNAPSHOT @ /appl-test/jenkinsSlave/workspace/FUBAR-Build/fubar.test.automax/pom.xml
15:58:08 [INFO] Resolving class path of MavenProject: fubar:fubar.test.automax:4.0.0-SNAPSHOT @ /appl-test/jenkinsSlave/workspace/FUBAR-Build/fubar.test.automax/pom.xml
15:58:08 [INFO] Computing target platform for MavenProject: fubar:fubar.test.automax.nftests:4.0.0-SNAPSHOT @ /appl-test/jenkinsSlave/workspace/FUBAR-Build/fubar.test.automax.nftests/pom.xml
15:58:08 [INFO] Resolving dependencies of MavenProject: fubar:fubar.test.automax.nftests:4.0.0-SNAPSHOT @ /appl-test/jenkinsSlave/workspace/FUBAR-Build/fubar.test.automax.nftests/pom.xml
15:58:08 [INFO] Resolving class path of MavenProject: fubar:fubar.test.automax.nftests:4.0.0-SNAPSHOT @ /appl-test/jenkinsSlave/workspace/FUBAR-Build/fubar.test.automax.nftests/pom.xml
15:58:08 ---------------------------------------------------
15:58:08 constituent[0]: file:/appl/maven-3.2/lib/aether-impl-0.9.0.M2.jar
15:58:08 constituent[1]: file:/appl/maven-3.2/lib/maven-model-3.2.2.jar
15:58:08 constituent[2]: file:/appl/maven-3.2/lib/plexus-cipher-1.7.jar
15:58:08 constituent[3]: file:/appl/maven-3.2/lib/jsoup-1.7.2.jar
15:58:08 constituent[4]: file:/appl/maven-3.2/lib/wagon-http-shared-2.6.jar
15:58:08 constituent[5]: file:/appl/maven-3.2/lib/cdi-api-1.0.jar
15:58:08 constituent[6]: file:/appl/maven-3.2/lib/wagon-provider-api-2.6.jar
15:58:08 constituent[7]: file:/appl/maven-3.2/lib/maven-core-3.2.2.jar
15:58:08 constituent[8]: file:/appl/maven-3.2/lib/org.eclipse.sisu.inject-0.0.0.M5.jar
15:58:08 constituent[9]: file:/appl/maven-3.2/lib/maven-aether-provider-3.2.2.jar
15:58:08 constituent[10]: file:/appl/maven-3.2/lib/maven-repository-metadata-3.2.2.jar
15:58:08 constituent[11]: file:/appl/maven-3.2/lib/aether-api-0.9.0.M2.jar
15:58:08 constituent[12]: file:/appl/maven-3.2/lib/maven-embedder-3.2.2.jar
15:58:08 constituent[13]: file:/appl/maven-3.2/lib/aether-util-0.9.0.M2.jar
15:58:08 constituent[14]: file:/appl/maven-3.2/lib/plexus-sec-dispatcher-1.3.jar
15:58:08 constituent[15]: file:/appl/maven-3.2/lib/org.eclipse.sisu.plexus-0.0.0.M5.jar
15:58:08 constituent[16]: file:/appl/maven-3.2/lib/aether-spi-0.9.0.M2.jar
15:58:08 constituent[17]: file:/appl/maven-3.2/lib/plexus-component-annotations-1.5.5.jar
15:58:08 constituent[18]: file:/appl/maven-3.2/lib/aether-connector-wagon-0.9.0.M2.jar
15:58:08 constituent[19]: file:/appl/maven-3.2/lib/maven-compat-3.2.2.jar
15:58:08 constituent[20]: file:/appl/maven-3.2/lib/maven-artifact-3.2.2.jar
15:58:08 constituent[21]: file:/appl/maven-3.2/lib/maven-plugin-api-3.2.2.jar
15:58:08 constituent[22]: file:/appl/maven-3.2/lib/plexus-utils-3.0.17.jar
15:58:08 constituent[23]: file:/appl/maven-3.2/lib/javax.inject-1.jar
15:58:08 constituent[24]: file:/appl/maven-3.2/lib/plexus-interpolation-1.19.jar
15:58:08 constituent[25]: file:/appl/maven-3.2/lib/slf4j-simple-1.7.5.jar
15:58:08 constituent[26]: file:/appl/maven-3.2/lib/commons-io-2.2.jar
15:58:08 constituent[27]: file:/appl/maven-3.2/lib/commons-cli-1.2.jar
15:58:08 constituent[28]: file:/appl/maven-3.2/lib/maven-model-builder-3.2.2.jar
15:58:08 constituent[29]: file:/appl/maven-3.2/lib/wagon-file-2.6.jar
15:58:08 constituent[30]: file:/appl/maven-3.2/lib/commons-lang-2.6.jar
15:58:08 constituent[31]: file:/appl/maven-3.2/lib/maven-settings-3.2.2.jar
15:58:08 constituent[32]: file:/appl/maven-3.2/lib/sisu-guice-3.1.3-no_aop.jar
15:58:08 constituent[33]: file:/appl/maven-3.2/lib/jsr250-api-1.0.jar
15:58:08 constituent[34]: file:/appl/maven-3.2/lib/wagon-http-2.6-shaded.jar
15:58:08 constituent[35]: file:/appl/maven-3.2/lib/guava-14.0.1.jar
15:58:08 constituent[36]: file:/appl/maven-3.2/lib/maven-settings-builder-3.2.2.jar
15:58:08 constituent[37]: file:/appl/maven-3.2/lib/aopalliance-1.0.jar
15:58:08 constituent[38]: file:/appl/maven-3.2/lib/slf4j-api-1.7.5.jar
15:58:08 constituent[39]: file:/appl/maven-3.2/conf/logging/
15:58:08 ---------------------------------------------------
15:58:08 Exception in thread "main" java.lang.StackOverflowError
15:58:08 	at org.eclipse.osgi.internal.resolver.StateImpl.getResolverErrors(StateImpl.java:1131)
15:58:08 	at org.eclipse.tycho.core.osgitools.EquinoxResolver.getRelevantErrors(EquinoxResolver.java:297)
15:58:08 	at org.eclipse.tycho.core.osgitools.EquinoxResolver.getRelevantErrors(EquinoxResolver.java:306)
15:58:08 	at org.eclipse.tycho.core.osgitools.EquinoxResolver.getRelevantErrors(EquinoxResolver.java:306)
15:58:08 	at org.eclipse.tycho.core.osgitools.EquinoxResolver.getRelevantErrors(EquinoxResolver.java:306)
15:58:08 	at org.eclipse.tycho.core.osgitools.EquinoxResolver.getRelevantErrors(EquinoxResolver.java:306)
15:58:08 	at org.eclipse.tycho.core.osgitools.EquinoxResolver.getRelevantErrors(EquinoxResolver.java:306)
15:58:08 	at org.eclipse.tycho.core.osgitools.EquinoxResolver.getRelevantErrors(EquinoxResolver.java:306)
15:58:08 	at org.eclipse.tycho.core.osgitools.EquinoxResolver.getRelevantErrors(EquinoxResolver.java:306)
Comment 1 Martin Schreiber CLA 2014-09-22 04:32:05 EDT
Submitted a patch for review:  https://git.eclipse.org/r/33655
Comment 2 Jan Sievers CLA 2014-09-26 03:20:26 EDT
http://git.eclipse.org/c/tycho/org.eclipse.tycho.git/commit/?id=0419f0400c08f844d9a560de730032b4f92b54ee

thanks for the patch Martin!

I verified manually that indirect cycles (A requires B requires A) do not cause a stackoverflow but rather cause the expected error "The projects in the reactor contain a cyclic reference"