Skip to content

SafeDeleteSslContext.WriteToConnection throws System.ArgumentNullException #25734

@bentoi

Description

@bentoi

Hard to reproduce but our CI tests sporadically fail with:

Unhandled Exception: System.ArgumentNullException: Value cannot be null.
   at System.Threading.Monitor.ReliableEnter(Object obj, Boolean& lockTaken)
   at System.Net.SafeDeleteSslContext.WriteToConnection(Void* connection, Byte* data, Void** dataLength)
   at Interop.AppleCrypto.SslHandshake(SafeSslHandle sslHandle)
   at System.Net.Security.SslStreamPal.PerformHandshake(SafeSslHandle sslHandle)
   at System.Net.Security.SslStreamPal.HandshakeInternal(SafeFreeCredentials credential, SafeDeleteContext& context, SecurityBuffer inputBuffer, SecurityBuffer outputBuffer, Boolean isServer, Boolean remoteCertRequired, String targetName)

The dotnet process crashes after this. This occurs with a test where a client opens an SSL connection asynchronously and then closes it -- possibly while the handshake is still in progress.

The crash dump showing the stacks: stacks.txt

This occurs with both .NET Core Runtime 2.0.6 and 2.1-preview.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions