Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stackoverflow exception 4.0.3 #124

Closed
Havunen opened this issue Apr 27, 2019 · 7 comments
Closed

Stackoverflow exception 4.0.3 #124

Havunen opened this issue Apr 27, 2019 · 7 comments
Assignees
Labels
bug Something isn't working
Milestone

Comments

@Havunen
Copy link
Contributor

Havunen commented Apr 27, 2019

Hey,

Thanks for this project, we are looking for more performant IOC than autofac for our REST API and dryioc seems to be promising! I have converted most of autofac code to dryioc and it seems to work nice. However one of our REST API controller is throwing stackoverflow exception when calling it.

We are using DryIoc + WebAPI + Owin setup Compiled from sources due to issue in 4.0.3 platform targets.

System.StackOverflowException: 'Exception of type 'System.StackOverflowException' was thrown.'

Call stack

.Ioc.dll!DryIoc.Interpreter.TryInterpret(DryIoc.IResolverContext r, FastExpressionCompiler.LightExpression.Expression expr, bool useFec, out object result) Line 2274	C#
.Ioc.dll!DryIoc.Interpreter.InterpretGetScoped(DryIoc.IResolverContext r, System.Collections.Generic.IList<FastExpressionCompiler.LightExpression.Expression> args, bool useFec, out object result) Line 2501	C#
.Ioc.dll!DryIoc.Interpreter.TryInterpret(DryIoc.IResolverContext r, FastExpressionCompiler.LightExpression.Expression expr, bool useFec, out object result) Line 2311	C#
.Ioc.dll!DryIoc.Interpreter.TryInterpret(DryIoc.IResolverContext r, FastExpressionCompiler.LightExpression.Expression expr, bool useFec, out object result) Line 2353	C#
.Ioc.dll!DryIoc.Interpreter.TryInterpretAndUnwrapContainerException(DryIoc.IResolverContext r, FastExpressionCompiler.LightExpression.Expression expr, bool useFec, out object result) Line 2261	C#
.Ioc.dll!DryIoc.Container.DryIoc.IResolver.Resolve(System.Type serviceType, object serviceKey, DryIoc.IfUnresolved ifUnresolved, System.Type requiredServiceType, DryIoc.Request preResolveParent, object[] args) Line 356	C#
[External Code]	
.Ioc.dll!FastExpressionCompiler.LightExpression.ExpressionCompiler.CurryClosureFuncs.Curry.AnonymousMethod__0() Line 832	C#
.Ioc.dll!DryIoc.Scope.TryGetOrAdd(ImTools.ImMap<object> items, int id, DryIoc.CreateScopedValue createValue, int disposalOrder) Line 9208	C#
.Ioc.dll!DryIoc.Scope.GetOrAdd(int id, DryIoc.CreateScopedValue createValue, int disposalOrder) Line 9194	C#
.Ioc.dll!DryIoc.CurrentScopeReuse.GetNameScoped(DryIoc.IResolverContext r, object scopeName, bool throwIfNoScope, int id, DryIoc.CreateScopedValue createValue, int disposalIndex) Line 9710	C#
[External Code]	
.Ioc.dll!DryIoc.Container.DryIoc.IResolver.Resolve(System.Type serviceType, object serviceKey, DryIoc.IfUnresolved ifUnresolved, System.Type requiredServiceType, DryIoc.Request preResolveParent, object[] args) Line 309	C#
.Ioc.dll!DryIoc.Container.ResolveAndCacheFactoryDelegate(System.Type serviceType, DryIoc.IfUnresolved ifUnresolved) Line 235	C#
.Ioc.dll!DryIoc.Container.DryIoc.IResolver.Resolve(System.Type serviceType, DryIoc.IfUnresolved ifUnresolved) Line 204	C#
.Ioc.dll!DryIoc.Resolver.Resolve(DryIoc.IResolver resolver, System.Type serviceType) Line 5786	C#
Web..Rest.API.dll!.Rest.API.DryIocControllerActivator.Create(System.Net.Http.HttpRequestMessage request, System.Web.Http.Controllers.HttpControllerDescriptor controllerDescriptor, System.Type controllerType) Line 19	Basic
[External Code]	
.Ioc.dll!DryIoc.WebApi.RegisterRequestMessageHandler.SendAsync(System.Net.Http.HttpRequestMessage request, System.Threading.CancellationToken cancellationToken) Line 240	C#
[External Code]	
.Ioc.dll!DryIoc.Owin.DryIocOwin.InsertOpenScope.AnonymousMethod__0(Microsoft.Owin.IOwinContext context, System.Func<System.Threading.Tasks.Task> next) Line 85	C#
[External Code]	

Any idea where should I look into to get more information whats happening? Thanks!

@Havunen
Copy link
Contributor Author

Havunen commented Apr 27, 2019

The exception seems to occur when parallel requests are done to same controller. Usually 1-2 first requests get resolved correctly and remaining fail.

@Havunen
Copy link
Contributor Author

Havunen commented Apr 27, 2019

This error seems to occur with more than one route, when many parallel requests are done.

@dadhi
Copy link
Owner

dadhi commented Apr 27, 2019

Thanks for letting me know, will check.
Any chance to have a small reproducible test or sample app?

@dadhi
Copy link
Owner

dadhi commented May 1, 2019

Another q, do you have open-generic services or do you use decorators?

@Havunen
Copy link
Contributor Author

Havunen commented May 1, 2019

@dadhi Yes. We have many decorators and some open generic too.

@dadhi
Copy link
Owner

dadhi commented May 1, 2019

Huh, then it may be related to #116. Which is fixed in the master and I planning the release soon.

@dadhi dadhi self-assigned this May 1, 2019
@dadhi dadhi added the bug Something isn't working label May 1, 2019
@dadhi dadhi added this to the v4.0.4 milestone May 1, 2019
@dadhi dadhi closed this as completed May 1, 2019
@dadhi
Copy link
Owner

dadhi commented May 1, 2019

@Havunen Version 4.0.4 is published

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants