-
Notifications
You must be signed in to change notification settings - Fork 299
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
Deadlock in System.Data.SqlClient.SNI.SNIMarsHandle, SNIMarsConnection, TdsParserStateObjectManaged #383
Comments
cc @cheenamalhotra @saurabh500 I had a peek through this. I think what is happening is thread 21: SNIMarsConnection.HandleReceiveComplete calls SNITCPHandle.ReceiveAsync which locks itself which calls back into SNIMarsConnection.HandleReceiveComplete later on. The SNIMarsConnection.HandleReceiveComplete is careful to not call the lower handle while locking itself but re-entrance breaks this and causes both locks to be taken in the "down" order thread 22: SNIMarsHandle.InternalSendAsync locks self and calls into SNIMarsConnection.SendAsync which then locks itself. Both locks taken in "up" order. Classic two locks in a different order deadlock situation. |
Do you have a repro app we can try? Also if you can test the same with Microsoft.Data.SqlClient 1.1.0, let us know if issue exists. @Wraith2 looks like that from the logs, it would be good if we can know the impacted APIs and if the issue still exists with Microsoft.Data.SqlClient. |
@cheenamalhotra |
Those parts are unchanged in the current versions. The reproduction will require some very precise timing on sends and receives on the same connection. |
Hi @czd890 Did you get a chance to investigate the problem with v4.6.1? |
Closing as inactive. |
System vestion
$ dotnet --info .NET Core SDK (reflecting any global.json): Version: 3.1.100 Commit: cd82f021f4 Runtime Environment: OS Name: centos OS Version: 7 OS Platform: Linux RID: centos.7-x64 Base Path: /usr/share/dotnet/sdk/3.1.100/ Host (useful for support): Version: 3.1.0 Commit: 157910edee .NET Core SDKs installed: 2.2.402 [/usr/share/dotnet/sdk] 3.0.100 [/usr/share/dotnet/sdk] 3.1.100 [/usr/share/dotnet/sdk] .NET Core runtimes installed: Microsoft.AspNetCore.All 2.2.7 [/usr/share/dotnet/shared/Microsoft.AspNetCore.All] Microsoft.AspNetCore.App 2.2.7 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 3.0.0 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 3.1.0 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App] Microsoft.NETCore.App 2.2.7 [/usr/share/dotnet/shared/Microsoft.NETCore.App] Microsoft.NETCore.App 3.0.0 [/usr/share/dotnet/shared/Microsoft.NETCore.App] Microsoft.NETCore.App 3.1.0 [/usr/share/dotnet/shared/Microsoft.NETCore.App]
System.Data.SqlClient.dll version
List clrthreads and syncblk
List stack of thread 22
List stack of thread 21
The text was updated successfully, but these errors were encountered: