dotnet / dotnet/SqlClient

Stack overflow caused by SqlConfigurableRetryLogicLoader.Defaul_resolving

Open
#2,214 6 comments 0 reactions 0 assignees View on GitHub
Dominant language
C#
Stars
989
Forks
340
Avg merge
4d 19h
Merged PRs (30d)
72

Description

### Describe the bug
I have an Blazor web app on .NET 7, using EF and Microsoft.Data.SqlClient 5.0.2. The web app was running fine for several months. It crashed this morning, with the following exception:

```
Stack overflow.
at System.RuntimeMethodHandle._GetCurrentMethod(System.Threading.StackCrawlMark ByRef)
at System.Reflection.MethodBase.GetCurrentMethod()
at Microsoft.Data.SqlClient.SqlConfigurableRetryLogicLoader.Default_Resolving(System.Runtime.Loader.AssemblyLoadContext, System.Reflection.AssemblyName)
at System.Runtime.Loader.AssemblyLoadContext.GetFirstResolvedAssemblyFromResolvingEvent(System.Reflection.AssemblyName)
at System.Runtime.Loader.AssemblyLoadContext.ResolveUsingEvent(System.Reflection.AssemblyName)
at System.Runtime.Loader.AssemblyLoadContext.ResolveUsingResolvingEvent(IntPtr, System.Reflection.AssemblyName)
at Microsoft.Data.SqlClient.SqlConfigurableRetryLogicLoader.MakeFullPath(System.String, System.String, System.String)
at Microsoft.Data.SqlClient.SqlConfigurableRetryLogicLoader.Default_Resolving(System.Runtime.Loader.AssemblyLoadContext, System.Reflection.AssemblyName)
at System.Runtime.Loader.AssemblyLoadContext.GetFirstResolvedAssemblyFromResolvingEvent(System.Reflection.AssemblyName)
at System.Runtime.Loader.AssemblyLoadContext.ResolveUsingEvent(System.Reflection.AssemblyName)
at System.Runtime.Loader.AssemblyLoadContext.ResolveUsingResolvingEvent(IntPtr, System.Reflection.AssemblyName)
at Microsoft.Data.SqlClient.SqlConfigurableRetryLogicLoader.MakeFullPath(System.String, System.String, System.String)
at Microsoft.Data.SqlClient.SqlConfigurableRetryLogicLoader.Default_Resolving(System.Runtime.Loader.AssemblyLoadContext, System.Reflection.AssemblyName)
at System.Runtime.Loader.AssemblyLoadContext.GetFirstResolvedAssemblyFromResolvingEvent(System.Reflection.AssemblyName)
at System.Runtime.Loader.AssemblyLoadContext.ResolveUsingEvent(System.Reflection.AssemblyName)
at System.Runtime.Loader.AssemblyLoadContext.ResolveUsingResolvingEvent(IntPtr, System.Reflection.AssemblyName)
at Microsoft.Data.SqlClient.SqlConfigurableRetryLogicLoader.MakeFullPath(System.String, System.String, System.String)
at Microsoft.Data.SqlClient.SqlConfigurableRetryLogicLoader.Default_Resolving(System.Runtime.Loader.AssemblyLoadContext, System.Reflection.AssemblyName)
at System.Runtime.Loader.AssemblyLoadContext.GetFirstResolvedAssemblyFromResolvingEvent(System.Reflection.AssemblyName)
at System.Runtime.Loader.AssemblyLoadContext.ResolveUsingEvent(System.Reflection.AssemblyName)
at System.Runtime.Loader.AssemblyLoadContext.ResolveUsingResolvingEvent(IntPtr, System.Reflection.AssemblyName)
at Microsoft.Data.SqlClient.SqlConfigurableRetryLogicLoader.MakeFullPath(System.String, System.String, System.String)
at Microsoft.Data.SqlClient.SqlConfigurableRetryLogicLoader.Default_Resolving(System.Runtime.Loader.AssemblyLoadContext, System.Reflection.AssemblyName)
at System.Runtime.Loader.AssemblyLoadContext.GetFirstResolvedAssemblyFromResolvingEvent(System.Reflection.AssemblyName)
at System.Runtime.Loader.AssemblyLoadContext.ResolveUsingEvent(System.Reflection.AssemblyName)
at System.Runtime.Loader.AssemblyLoadContext.ResolveUsingResolvingEvent(IntPtr, System.Reflection.AssemblyName)
...
```

### To reproduce
Have restarted the app, but was not (yet) successful to repro.

Didn't configure any special options, environment variables, etc. AFAIK. This is the connection string (password etc. changed):
`Data Source=tcp:super-secret.database.windows.net,1433;Initial Catalog=mywebsite.com;Integrated Security=False;Persist Security Info=False;User ID=super-secret;Password=123456;Encrypt=True`

### Further technical details
Microsoft.Data.SqlClient version: 5.0.2
.NET target: 7.0
SQL Server version: Azure SQL
Operating system: Ubuntu 20.04.3 LTS

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.