Uh oh!
There was an error while loading. Please reload this page.
Fix NullReferenceException in background thread emitting IL in Depend… - #55340
Conversation
…encyInjection When ILEmitResolverBuilder is getting created, it grabs the "Root" scope off of the ServiceProvider. However, the Root scope isn't set on ServiceProvider yet. So later when it tries to get used, it null refs. But this exception gets caught an eaten since it happens on a background thread. The fix is to set Root before creating the ServiceProviderEngine.
ghost
commented
Jul 8, 2021
Tagging subscribers to this area: @eerhardt, @maryamariyan Issue Details…encyInjection When ILEmitResolverBuilder is getting created, it grabs the "Root" scope off of the ServiceProvider. However, the Root scope isn't set on ServiceProvider yet. So later when it tries to get used, it null refs. But this exception gets caught an eaten since it happens on a background thread. The fix is to set Root before creating the ServiceProviderEngine.
|
davidfowl
commented
Jul 8, 2021
I'm betting this it the cause of the performance regression on ARM. |
Uh oh!
There was an error while loading. Please reload this page.
pakrym
commented
Jul 8, 2021
What do you think about adding a Debug.Assert to https://github.com/dotnet/runtime/blob/main/src/libraries/Microsoft.Extensions.DependencyInjection/src/ServiceLookup/DynamicServiceProviderEngine.cs#L39 ? |
…nd compilation thread
eerhardt
commented
Jul 8, 2021
|
…encyInjection
When ILEmitResolverBuilder is getting created, it grabs the "Root" scope off of the ServiceProvider. However, the Root scope isn't set on ServiceProvider yet. So later when it tries to get used, it null refs. But this exception gets caught an eaten since it happens on a background thread.
The fix is to set Root before creating the ServiceProviderEngine.
See description of the issue in #55255 (comment).