[GRADLE-944] StackOverflowError with circular multiproject dependency Created: 21/May/10  Updated: 10/Feb/17  Resolved: 10/Feb/17

Status: Resolved
Project: Gradle
Affects Version/s: 0.9
Fix Version/s: None

Type: Bug
Reporter: Philip Crotwell Assignee: Unassigned
Resolution: Won't Fix Votes: 0

Issue Links:
Duplicate
Duplicates GRADLE-715 Circular Runtime Project Dependencies... Resolved

 Description   

So I mistakenly created a circular dependency amongst a multiproject, so proj A had:
dependencies {
compile project(':projB')

{ transitive = true }
}

and proj B had
dependencies {
compile project(':projA') { transitive = true }

}

Clearly this is user error, but probably it would be good if gradle would detect the problem in the dependency mapping and print a "circular depenency detected" message instead of the huge stack trace.

FAILURE: Build aborted because of an internal error.

  • What went wrong:
    Build aborted because of an unexpected internal error. Please file an issue at: www.gradle.org.
  • Try:
    Run with -d option to get additional debug info.
  • Exception is:
    java.lang.StackOverflowError: null
    at java.util.HashMap$KeyIterator.<init>(HashMap.java:875)
    at java.util.HashMap$KeyIterator.<init>(HashMap.java:875)
    at java.util.HashMap.newKeyIterator(HashMap.java:889)
    at java.util.HashMap$KeySet.iterator(HashMap.java:921)
    at java.util.HashSet.iterator(HashSet.java:154)
    at java.util.AbstractCollection.toArray(AbstractCollection.java:124)
    at java.util.LinkedList.addAll(LinkedList.java:265)
    at java.util.LinkedList.addAll(LinkedList.java:242)
    at java.util.LinkedList.<init>(LinkedList.java:98)
    at org.gradle.api.internal.tasks.DefaultTaskDependency.getDependencies(DefaultTaskDependency.java:47)
    at org.gradle.api.internal.artifacts.dependencies.DefaultProjectDependency$2.getDependencies(DefaultProjectDependency.java:119)
    at org.gradle.api.internal.tasks.DefaultTaskDependency.getDependencies(DefaultTaskDependency.java:52)
    at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration$1.getDependencies(DefaultConfiguration.java:209)
    at org.gradle.api.internal.tasks.DefaultTaskDependency.getDependencies(DefaultTaskDependency.java:57)
    at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration$1.getDependencies(DefaultConfiguration.java:209)
    at org.gradle.api.internal.tasks.DefaultTaskDependency.getDependencies(DefaultTaskDependency.java:57)
    at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration$1.getDependencies(DefaultConfiguration.java:209)
    at org.gradle.api.internal.tasks.DefaultTaskDependency.getDependencies(DefaultTaskDependency.java:52)
    at org.gradle.api.internal.artifacts.dependencies.DefaultProjectDependency$2.getDependencies(DefaultProjectDependency.java:119)
    at org.gradle.api.internal.tasks.DefaultTaskDependency.getDependencies(DefaultTaskDependency.java:52)
    at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration$1.getDependencies(DefaultConfiguration.java:209)
    at org.gradle.api.internal.tasks.DefaultTaskDependency.getDependencies(DefaultTaskDependency.java:57)
    at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration$1.getDependencies(DefaultConfiguration.java:209)
    at org.gradle.api.internal.tasks.DefaultTaskDependency.getDependencies(DefaultTaskDependency.java:57)
    at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration$1.getDependencies(DefaultConfiguration.java:209)
    at org.gradle.api.internal.tasks.DefaultTaskDependency.getDependencies(DefaultTaskDependency.java:52)
    at org.gradle.api.internal.artifacts.dependencies.DefaultProjectDependency$2.getDependencies(DefaultProjectDependency.java:119)


 Comments   
Comment by Philip Crotwell [ 21/May/10 ]


This might be related to GRADLE-766 and GRADLE-915

Comment by Adam Murdoch [ 23/May/10 ]

This is the same as GRADLE-715.

Comment by Benjamin Muschko [ 15/Nov/16 ]

As announced on the Gradle blog we are planning to completely migrate issues from JIRA to GitHub.

We intend to prioritize issues that are actionable and impactful while working more closely with the community. Many of our JIRA issues are inactionable or irrelevant. We would like to request your help to ensure we can appropriately prioritize JIRA issues you’ve contributed to.

Please confirm that you still advocate for your JIRA issue before December 10th, 2016 by:

  • Checking that your issues contain requisite context, impact, behaviors, and examples as described in our published guidelines.
  • Leave a comment on the JIRA issue or open a new GitHub issue confirming that the above is complete.

We look forward to collaborating with you more closely on GitHub. Thank you for your contribution to Gradle!

Comment by Benjamin Muschko [ 10/Feb/17 ]

Thanks again for reporting this issue. We haven't heard back from you after our inquiry from November 15th. We are closing this issue now. Please create an issue on GitHub if you still feel passionate about getting it resolved.

Generated at Wed Jun 30 11:42:54 CDT 2021 using Jira 8.4.2#804003-sha1:d21414fc212e3af190e92c2d2ac41299b89402cf.