technomancy / leiningen

Moved to Codeberg; this is a convenience mirror
https://codeberg.org/leiningen/leiningen
Other
7.29k stars 1.61k forks source link

lein deps hangs and exits due to StackOverflowError #2798

Closed liamchzh closed 1 year ago

liamchzh commented 2 years ago

Initial debugging steps Before creating a report, especially around exceptions being thrown when running Leiningen, please check if the error still occurs after:

Describe the bug lein deps would hang after bumping Netty TomcatNative BoringSSL Static to 2.0.50.Final. CPU load increases in the meantime.

To Reproduce Steps to reproduce the behavior:

  1. Create a new project: lein new my-project
  2. Add the netty-tcnative-boringssl-static version 2.0.50.Final to the dependencies: :dependencies [[io.netty/netty-tcnative-boringssl-static "2.0.50.Final"]]
  3. Run lein deps

Actual behavior lein deps hangs and exits due to StackOverflowError on my machine.

Expected behavior Successfully install the netty-tcnative-boringssl-static dep.

Environment

Additional context 2.0.50.Final is the first version that causes the problem and it introduced circular dependency since this version. See related issues of netty-tcnative-boringssl-static on GitHub:

technomancy commented 2 years ago

Thanks for reporting this. Will see what we can do.

In the mean time, you can work around it by putting :pedantic? false in your project.clj.

technomancy commented 1 year ago

This was tricky to debug, but I think it has to do with an assumption in the cycle detection of the pedantic implementation. We have code that does (some #{node} parents) where node and parents are DefaultDependencyNode objects from Aether, so that code assumes that they hash consistently, but the boringssl ones do not.

The fix is quite simple; turn everything into a string before doing cycle detection.