Skip to content

[SSL] SslStress intermittently fails with SocketException (995) #121340

Open

Description

@ManickaP

~3x occurrences per month

Details:

System.IO.IOException: Unable to read data from the transport connection: The I/O operation has been aborted because of either a thread exit or an application request..
  ---> System.Net.Sockets.SocketException (995): The I/O operation has been aborted because of either a thread exit or an application request.
    at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.CreateException(SocketError error, Boolean forAsyncThrow) in /_/src/libraries/System.Net.Sockets/src/System/Net/Sockets/Socket.Tasks.cs:line 1370
    at SslStress.Utils.CountingStream.ReadAsync(Memory`1 buffer, CancellationToken cancellationToken) in C:\app\System.Net.Security\tests\StressTests\SslStress\Utils\CountingStream.cs:line 64
    at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[TStateMachine](TStateMachine& stateMachine) in /_/src/libraries/System.Private.CoreLib/src/System/Runtime/CompilerServices/AsyncMethodBuilderCore.cs:line 38
    at System.Net.Security.SslStream.EnsureFullTlsFrameAsync[TIOAdapter](CancellationToken cancellationToken, Int32 estimatedSize)
    at System.Net.Security.SslStream.ReadAsyncInternal[TIOAdapter](Memory`1 buffer, CancellationToken cancellationToken) in /_/src/libraries/System.Net.Security/src/System/Net/Security/SslStream.IO.cs:line 896
    at System.IO.Pipelines.PipeWriter.CopyFromAsync(Stream source, CancellationToken cancellationToken) in /_/src/libraries/System.IO.Pipelines/src/System/IO/Pipelines/PipeWriter.cs:line 128
    at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) in /_/src/libraries/System.Private.CoreLib/src/System/Threading/ExecutionContext.cs:line 179
    at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1.AsyncStateMachineBox`1.MoveNext() in /_/src/libraries/System.Private.CoreLib/src/System/Runtime/CompilerServices/AsyncTaskMethodBuilderT.cs:line 350
    at System.Net.Security.SslStream.ReadAsyncInternal[TIOAdapter](Memory`1 buffer, CancellationToken cancellationToken) in /_/src/libraries/System.Net.Security/src/System/Net/Security/SslStream.IO.cs:line 990
    at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) in /_/src/libraries/System.Private.CoreLib/src/System/Threading/ExecutionContext.cs:line 179
    at System.Net.Security.SslStream.EnsureFullTlsFrameAsync[TIOAdapter](CancellationToken cancellationToken, Int32 estimatedSize) in /_/src/libraries/System.Net.Security/src/System/Net/Security/SslStream.IO.cs:line 802
    at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) in /_/src/libraries/System.Private.CoreLib/src/System/Threading/ExecutionContext.cs:line 179
    at System.Threading.Tasks.AwaitTaskContinuation.RunOrScheduleAction(IAsyncStateMachineBox box, Boolean allowInlining) in /_/src/libraries/System.Private.CoreLib/src/System/Threading/Tasks/TaskContinuation.cs:line 795
    at System.Threading.Tasks.Task.RunContinuations(Object continuationObject) in /_/src/libraries/System.Private.CoreLib/src/System/Threading/Tasks/Task.cs:line 3475
    at SslStress.Utils.CountingStream.ReadAsync(Memory`1 buffer, CancellationToken cancellationToken) in C:\app\System.Net.Security\tests\StressTests\SslStress\Utils\CountingStream.cs:line 67
    at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) in /_/src/libraries/System.Private.CoreLib/src/System/Threading/ExecutionContext.cs:line 179
    at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1.AsyncStateMachineBox`1.MoveNext() in /_/src/libraries/System.Private.CoreLib/src/System/Runtime/CompilerServices/AsyncTaskMethodBuilderT.cs:line 350
    at System.Threading.ThreadPoolBoundHandleOverlapped.CompletionCallback(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* nativeOverlapped) in /_/src/libraries/System.Private.CoreLib/src/System/Threading/ThreadPoolBoundHandleOverlapped.cs:line 36
    at System.Threading.ThreadPoolTypedWorkItemQueue.System.Threading.IThreadPoolWorkItem.Execute() in /_/src/libraries/System.Private.CoreLib/src/System/Threading/ThreadPoolWorkQueue.cs:line 1430
    at System.Threading.ThreadPoolWorkQueue.Dispatch() in /_/src/libraries/System.Private.CoreLib/src/System/Threading/ThreadPoolWorkQueue.cs:line 1154
    at System.Threading.PortableThreadPool.WorkerThread.WorkerThreadStart() in /_/src/libraries/System.Private.CoreLib/src/System/Threading/PortableThreadPool.WorkerThread.cs:line 118
    at System.Threading.Thread.StartCallback() in /_/src/coreclr/System.Private.CoreLib/src/System/Threading/Thread.CoreCLR.cs:line 104
 --- End of stack trace from previous location ---
 
    --- End of inner exception stack trace ---
    at SslStress.Utils.CountingStream.ReadAsync(Memory`1 buffer, CancellationToken cancellationToken) in C:\app\System.Net.Security\tests\StressTests\SslStress\Utils\CountingStream.cs:line 64
    at System.Net.Security.SslStream.EnsureFullTlsFrameAsync[TIOAdapter](CancellationToken cancellationToken, Int32 estimatedSize) in /_/src/libraries/System.Net.Security/src/System/Net/Security/SslStream.IO.cs:line 765
    at System.Runtime.CompilerServices.PoolingAsyncValueTaskMethodBuilder`1.StateMachineBox`1.System.Threading.Tasks.Sources.IValueTaskSource<TResult>.GetResult(Int16 token) in /_/src/libraries/System.Private.CoreLib/src/System/Runtime/CompilerServices/PoolingAsyncValueTaskMethodBuilderT.cs:line 422
    at System.Net.Security.SslStream.ReadAsyncInternal[TIOAdapter](Memory`1 buffer, CancellationToken cancellationToken) in /_/src/libraries/System.Net.Security/src/System/Net/Security/SslStream.IO.cs:line 896
    at System.Runtime.CompilerServices.PoolingAsyncValueTaskMethodBuilder`1.StateMachineBox`1.System.Threading.Tasks.Sources.IValueTaskSource<TResult>.GetResult(Int16 token) in /_/src/libraries/System.Private.CoreLib/src/System/Runtime/CompilerServices/PoolingAsyncValueTaskMethodBuilderT.cs:line 422
    at System.IO.Pipelines.PipeWriter.CopyFromAsync(Stream source, CancellationToken cancellationToken) in /_/src/libraries/System.IO.Pipelines/src/System/IO/Pipelines/PipeWriter.cs:line 128
    at SslStress.Utils.PipeExtensions.<>c__DisplayClass0_0.<<ReadLinesUsingPipesAsync>g__FillPipeAsync|0>d.MoveNext() in C:\app\System.Net.Security\tests\StressTests\SslStress\Utils\PipeExtensions.cs:line 33
 --- End of stack trace from previous location ---
    at SslStress.Utils.StressTaskExtensions.<>c__DisplayClass0_0.<<WhenAllThrowOnFirstException>g__RunOne|0>d.MoveNext() in C:\app\System.Net.Security\tests\StressTests\SslStress\Utils\StressTaskExtensions.cs:line 39
 --- End of stack trace from previous location ---
    at SslStress.Utils.StressTaskExtensions.WhenAllThrowOnFirstException(CancellationToken token, Func`2[] tasks) in C:\app\System.Net.Security\tests\StressTests\SslStress\Utils\StressTaskExtensions.cs:line 32
    at SslStress.Utils.PipeExtensions.ReadLinesUsingPipesAsync(Stream stream, Func`2 callback, CancellationToken token, Char separator) in C:\app\System.Net.Security\tests\StressTests\SslStress\Utils\PipeExtensions.cs:line 22
    at SslStress.StressClient.<>c__DisplayClass2_0.<<HandleConnection>g__Receiver|1>d.MoveNext() in C:\app\System.Net.Security\tests\StressTests\SslStress\StressOperations.cs:line 303
 --- End of stack trace from previous location ---
    at SslStress.Utils.StressTaskExtensions.<>c__DisplayClass0_0.<<WhenAllThrowOnFirstException>g__RunOne|0>d.MoveNext() in C:\app\System.Net.Security\tests\StressTests\SslStress\Utils\StressTaskExtensions.cs:line 39
 --- End of stack trace from previous location ---
    at SslStress.Utils.StressTaskExtensions.WhenAllThrowOnFirstException(CancellationToken token, Func`2[] tasks) in C:\app\System.Net.Security\tests\StressTests\SslStress\Utils\StressTaskExtensions.cs:line 32
    at SslStress.StressClient.HandleConnection(Int32 workerId, Int64 jobId, SslStream stream, TcpClient client, Random random, TimeSpan duration, CancellationToken token) in C:\app\System.Net.Security\tests\StressTests\SslStress\StressOperations.cs:line 236
    at SslStress.SslClientBase.<StartCore>g__RunSingleWorker|15_1(Int32 workerId, Random random) in C:\app\System.Net.Security\tests\StressTests\SslStress\SslClientBase.cs:line 119

Activity

  1. added
    untriaged
    on Nov 4, 2025
  2. dotnet-policy-service commented on Nov 4, 2025

    @dotnet-policy-service
    Contributor

    Tagging subscribers to this area: @dotnet/ncl, @bartonjs, @vcsjones
    See info in area-owners.md if you want to be subscribed.

  3. removed
    untriaged
    on Nov 4, 2025
  4. added this to the Future milestone on Nov 4, 2025
  5. added
    test-enhancement
    on Nov 4, 2025
  6. MihuBot commented on Nov 4, 2025

    @MihuBot

    I'm a bot. Here is a possible related and/or duplicate issue (I may be wrong):

  7. added theissue type on Aug 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-System.Net.Securitytest-enhancement

    Type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions