JasperFx / lamar

Fast Inversion of Control Tool and Successor to StructureMap
https://jasperfx.github.io/lamar
MIT License
563 stars 118 forks source link

Large dependency graphs can cause StackOverflowException #361

Closed bryanboettcher closed 1 year ago

bryanboettcher commented 1 year ago

We encountered an instance where Lamar would begin to throw StackOverflowExceptions while debugging integration tests. These tests are a bit sloppy and will double-register some implementations, telling us we were very near a threshold of overflow. The exceptions stemmed from both EnumerableExtensions.Visit, as well as the IResolverFrame system.

Replacing the clean recursive code with more manual iterative code using a Stack object will help mitigate this.

jeremydmiller commented 1 year ago

Closed by #362