Skip to content
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

Assert in System.Net.Sockets.SocketAsyncEventArgs.CompleteAcceptOperation #89806

Closed
ericstj opened this issue Aug 1, 2023 · 3 comments · Fixed by #89901
Closed

Assert in System.Net.Sockets.SocketAsyncEventArgs.CompleteAcceptOperation #89806

ericstj opened this issue Aug 1, 2023 · 3 comments · Fixed by #89901
Assignees
Labels
area-System.Net.Sockets blocking-clean-ci Blocking PR or rolling runs of 'runtime' or 'runtime-extra-platforms' Known Build Error Use this to report build issues in the .NET Helix tab
Milestone

Comments

@ericstj
Copy link
Member

ericstj commented Aug 1, 2023

Build Information

Build: https://dev.azure.com/dnceng-public/cbb18261-c48f-4abb-8651-8cdcb5474649/_build/results?buildId=359274
Build error leg or test failing: System.Net.Http.Json.Functional.Tests.WorkItemExecution
Pull request: #89537

Error Message

Fill the error message using step by step known issues guidance.

{
  "ErrorMessage": "System.Net.Sockets.SocketAsyncEventArgs.CompleteAcceptOperation",
  "ErrorPattern": "",
  "BuildRetry": false,
  "ExcludeConsoleLog": false
}

Sample failure log:

Process terminated. Assertion failed.
   at System.Net.Sockets.SocketAsyncEventArgs.CompleteAcceptOperation(IntPtr acceptedFileDescriptor, Memory`1 socketAddress) in /_/src/libraries/System.Net.Sockets/src/System/Net/Sockets/SocketAsyncEventArgs.Unix.cs:line 36
   at System.Net.Sockets.SocketAsyncEventArgs.DoOperationAccept(Socket _, SafeSocketHandle handle, SafeSocketHandle acceptHandle, CancellationToken cancellationToken) in /_/src/libraries/System.Net.Sockets/src/System/Net/Sockets/SocketAsyncEventArgs.Unix.cs:line 56
   at System.Net.Sockets.Socket.AcceptAsync(SocketAsyncEventArgs e, CancellationToken cancellationToken) in /_/src/libraries/System.Net.Sockets/src/System/Net/Sockets/Socket.cs:line 2695
   at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.AcceptAsync(Socket socket, CancellationToken cancellationToken) in /_/src/libraries/System.Net.Sockets/src/System/Net/Sockets/Socket.Tasks.cs:line 965
   at System.Net.Sockets.Socket.AcceptAsync(Socket acceptSocket, CancellationToken cancellationToken) in /_/src/libraries/System.Net.Sockets/src/System/Net/Sockets/Socket.Tasks.cs:line 70
   at System.Net.Sockets.Socket.AcceptAsync() in /_/src/libraries/System.Net.Sockets/src/System/Net/Sockets/Socket.Tasks.cs:line 32
   at System.Net.Test.Common.LoopbackServer.EstablishConnectionAsync() in /_/src/libraries/Common/tests/System/Net/Http/LoopbackServer.cs:line 142
   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.Test.Common.LoopbackServer.EstablishConnectionAsync()
   at System.Net.Test.Common.LoopbackServer.AcceptConnectionAsync(Func`2 funcAsync) in /_/src/libraries/Common/tests/System/Net/Http/LoopbackServer.cs:line 165
   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.Test.Common.LoopbackServer.AcceptConnectionAsync(Func`2 funcAsync)
   at System.Net.Http.Json.Functional.Tests.HttpClientJsonExtensionsTests.<>c__DisplayClass14_2.<<GetFromJsonAsync_EnforcesTimeout>b__3>d.MoveNext() in /_/src/libraries/System.Net.Http.Json/tests/FunctionalTests/HttpClientJsonExtensionsTests.cs:line 495
   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.Http.Json.Functional.Tests.HttpClientJsonExtensionsTests.<>c__DisplayClass14_2.<GetFromJsonAsync_EnforcesTimeout>b__3()
   at System.Threading.Tasks.Task`1.InnerInvoke() in /_/src/libraries/System.Private.CoreLib/src/System/Threading/Tasks/Future.cs:line 501
   at System.Threading.Tasks.Task.<>c.<.cctor>b__281_0(Object obj) in /_/src/libraries/System.Private.CoreLib/src/System/Threading/Tasks/Task.cs:line 2387
   at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread threadPoolThread, ExecutionContext executionContext, ContextCallback callback, Object state) in /_/src/libraries/System.Private.CoreLib/src/System/Threading/ExecutionContext.cs:line 264
   at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread) in /_/src/libraries/System.Private.CoreLib/src/System/Threading/Tasks/Task.cs:line 2349
   at System.Threading.Tasks.Task.ExecuteEntryUnsafe(Thread threadPoolThread) in /_/src/libraries/System.Private.CoreLib/src/System/Threading/Tasks/Task.cs:line 2283
   at System.Threading.Tasks.Task.ExecuteFromThreadPool(Thread threadPoolThread) in /_/src/libraries/System.Private.CoreLib/src/System/Threading/Tasks/Task.cs:line 2274
   at System.Threading.ThreadPoolWorkQueue.Dispatch() in /_/src/libraries/System.Private.CoreLib/src/System/Threading/ThreadPoolWorkQueue.cs:line 913
   at System.Threading.PortableThreadPool.WorkerThread.WorkerThreadStart() in /_/src/libraries/System.Private.CoreLib/src/System/Threading/PortableThreadPool.WorkerThread.NonBrowser.cs:line 58
   at System.Threading.Thread.StartCallback() in /_/src/coreclr/System.Private.CoreLib/src/System/Threading/Thread.CoreCLR.cs:line 105

Seems to be introduced in e2c6fcf#diff-31c708307a9d9c09e7e488a873803e62bfcc91a8d3fa6d9398d3c8bb13cff1afR36 cc @wfurt

Known issue validation

Build: 🔎 https://dev.azure.com/dnceng-public/public/_build/results?buildId=359274
Error message validated: System.Net.Sockets.SocketAsyncEventArgs.CompleteAcceptOperation
Result validation: ✅ Known issue matched with the provided build.
Validation performed at: 8/1/2023 8:29:07 PM UTC

Report

Build Definition Test Pull Request
361800 dotnet/runtime System.Net.HttpListener.Tests.WorkItemExecution #89912
361711 dotnet/runtime System.Net.HttpListener.Tests.WorkItemExecution #89630
361700 dotnet/runtime System.Net.HttpListener.Tests.WorkItemExecution #88926
361673 dotnet/runtime System.Net.Http.Json.Functional.Tests.WorkItemExecution #86888
361597 dotnet/runtime System.Net.HttpListener.Tests.WorkItemExecution #89841
361610 dotnet/runtime System.Net.HttpListener.Tests.WorkItemExecution #89902
361577 dotnet/runtime System.Net.HttpListener.Tests.WorkItemExecution #89900
361506 dotnet/runtime System.Net.Http.Json.Functional.Tests.WorkItemExecution #89869
361496 dotnet/runtime System.Net.HttpListener.Tests.WorkItemExecution #89894
361438 dotnet/runtime System.Net.Http.Json.Functional.Tests.WorkItemExecution #89892
361299 dotnet/runtime System.Net.HttpListener.Tests.WorkItemExecution #89882
361145 dotnet/runtime System.Net.HttpListener.Tests.WorkItemExecution #89870
361051 dotnet/runtime System.Net.Http.Json.Functional.Tests.WorkItemExecution #87773
360929 dotnet/runtime System.Net.Http.Json.Functional.Tests.WorkItemExecution #89863
360734 dotnet/runtime System.Net.HttpListener.Tests.WorkItemExecution #89736
360640 dotnet/runtime System.Net.Http.Json.Functional.Tests.WorkItemExecution #89813
360105 dotnet/runtime System.Net.Http.Json.Functional.Tests.WorkItemExecution #89636
359917 dotnet/runtime System.Net.Http.Json.Functional.Tests.WorkItemExecution #89827
359852 dotnet/runtime System.Net.Http.Json.Functional.Tests.WorkItemExecution #89822
359833 dotnet/runtime System.Net.Http.Json.Functional.Tests.WorkItemExecution #89689
359830 dotnet/runtime System.Net.Http.Json.Functional.Tests.WorkItemExecution #89531
359812 dotnet/runtime System.Net.Http.Json.Functional.Tests.WorkItemExecution #89809
359866 dotnet/runtime System.Net.HttpListener.Tests.WorkItemExecution #89799
359677 dotnet/runtime System.Net.HttpListener.Tests.WorkItemExecution #89583
359495 dotnet/runtime System.Net.HttpListener.Tests.WorkItemExecution #89781
359395 dotnet/runtime System.Net.Http.Json.Functional.Tests.WorkItemExecution #89630
359274 dotnet/runtime System.Net.Http.Json.Functional.Tests.WorkItemExecution #89537
359286 dotnet/runtime System.Net.HttpListener.Tests.WorkItemExecution #87773
358747 dotnet/runtime System.Net.Http.Json.Functional.Tests.WorkItemExecution #89301

Summary

24-Hour Hit Count 7-Day Hit Count 1-Month Count
16 29 29
@ericstj ericstj added blocking-clean-ci Blocking PR or rolling runs of 'runtime' or 'runtime-extra-platforms' Known Build Error Use this to report build issues in the .NET Helix tab labels Aug 1, 2023
@ghost ghost added the untriaged New issue has not been triaged by the area owner label Aug 1, 2023
@ghost
Copy link

ghost commented Aug 1, 2023

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

Issue Details

Build Information

Build: https://dev.azure.com/dnceng-public/cbb18261-c48f-4abb-8651-8cdcb5474649/_build/results?buildId=359274
Build error leg or test failing: System.Net.Http.Json.Functional.Tests.WorkItemExecution
Pull request: #89537

Error Message

Fill the error message using step by step known issues guidance.

{
  "ErrorMessage": "System.Net.Sockets.SocketAsyncEventArgs.CompleteAcceptOperation",
  "ErrorPattern": "",
  "BuildRetry": false,
  "ExcludeConsoleLog": false
}

Sample failure log:

Process terminated. Assertion failed.
   at System.Net.Sockets.SocketAsyncEventArgs.CompleteAcceptOperation(IntPtr acceptedFileDescriptor, Memory`1 socketAddress) in /_/src/libraries/System.Net.Sockets/src/System/Net/Sockets/SocketAsyncEventArgs.Unix.cs:line 36
   at System.Net.Sockets.SocketAsyncEventArgs.DoOperationAccept(Socket _, SafeSocketHandle handle, SafeSocketHandle acceptHandle, CancellationToken cancellationToken) in /_/src/libraries/System.Net.Sockets/src/System/Net/Sockets/SocketAsyncEventArgs.Unix.cs:line 56
   at System.Net.Sockets.Socket.AcceptAsync(SocketAsyncEventArgs e, CancellationToken cancellationToken) in /_/src/libraries/System.Net.Sockets/src/System/Net/Sockets/Socket.cs:line 2695
   at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.AcceptAsync(Socket socket, CancellationToken cancellationToken) in /_/src/libraries/System.Net.Sockets/src/System/Net/Sockets/Socket.Tasks.cs:line 965
   at System.Net.Sockets.Socket.AcceptAsync(Socket acceptSocket, CancellationToken cancellationToken) in /_/src/libraries/System.Net.Sockets/src/System/Net/Sockets/Socket.Tasks.cs:line 70
   at System.Net.Sockets.Socket.AcceptAsync() in /_/src/libraries/System.Net.Sockets/src/System/Net/Sockets/Socket.Tasks.cs:line 32
   at System.Net.Test.Common.LoopbackServer.EstablishConnectionAsync() in /_/src/libraries/Common/tests/System/Net/Http/LoopbackServer.cs:line 142
   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.Test.Common.LoopbackServer.EstablishConnectionAsync()
   at System.Net.Test.Common.LoopbackServer.AcceptConnectionAsync(Func`2 funcAsync) in /_/src/libraries/Common/tests/System/Net/Http/LoopbackServer.cs:line 165
   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.Test.Common.LoopbackServer.AcceptConnectionAsync(Func`2 funcAsync)
   at System.Net.Http.Json.Functional.Tests.HttpClientJsonExtensionsTests.<>c__DisplayClass14_2.<<GetFromJsonAsync_EnforcesTimeout>b__3>d.MoveNext() in /_/src/libraries/System.Net.Http.Json/tests/FunctionalTests/HttpClientJsonExtensionsTests.cs:line 495
   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.Http.Json.Functional.Tests.HttpClientJsonExtensionsTests.<>c__DisplayClass14_2.<GetFromJsonAsync_EnforcesTimeout>b__3()
   at System.Threading.Tasks.Task`1.InnerInvoke() in /_/src/libraries/System.Private.CoreLib/src/System/Threading/Tasks/Future.cs:line 501
   at System.Threading.Tasks.Task.<>c.<.cctor>b__281_0(Object obj) in /_/src/libraries/System.Private.CoreLib/src/System/Threading/Tasks/Task.cs:line 2387
   at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread threadPoolThread, ExecutionContext executionContext, ContextCallback callback, Object state) in /_/src/libraries/System.Private.CoreLib/src/System/Threading/ExecutionContext.cs:line 264
   at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread) in /_/src/libraries/System.Private.CoreLib/src/System/Threading/Tasks/Task.cs:line 2349
   at System.Threading.Tasks.Task.ExecuteEntryUnsafe(Thread threadPoolThread) in /_/src/libraries/System.Private.CoreLib/src/System/Threading/Tasks/Task.cs:line 2283
   at System.Threading.Tasks.Task.ExecuteFromThreadPool(Thread threadPoolThread) in /_/src/libraries/System.Private.CoreLib/src/System/Threading/Tasks/Task.cs:line 2274
   at System.Threading.ThreadPoolWorkQueue.Dispatch() in /_/src/libraries/System.Private.CoreLib/src/System/Threading/ThreadPoolWorkQueue.cs:line 913
   at System.Threading.PortableThreadPool.WorkerThread.WorkerThreadStart() in /_/src/libraries/System.Private.CoreLib/src/System/Threading/PortableThreadPool.WorkerThread.NonBrowser.cs:line 58
   at System.Threading.Thread.StartCallback() in /_/src/coreclr/System.Private.CoreLib/src/System/Threading/Thread.CoreCLR.cs:line 105

Seems to be introduced in e2c6fcf#diff-31c708307a9d9c09e7e488a873803e62bfcc91a8d3fa6d9398d3c8bb13cff1afR36 cc @wfurt

Author: ericstj
Assignees: -
Labels:

area-System.Net.Sockets, blocking-clean-ci, Known Build Error

Milestone: -

@wfurt wfurt self-assigned this Aug 1, 2023
@wfurt wfurt removed the untriaged New issue has not been triaged by the area owner label Aug 1, 2023
@wfurt wfurt added this to the 8.0.0 milestone Aug 1, 2023
@wfurt
Copy link
Member

wfurt commented Aug 1, 2023

I was not able to reproduce it locally so far. It is not clear if that is macOS specific and if there was possibility that Accept did not get peer's address before -> this is what new Asser guards.
cc: @rzikm for visibility

@ghost ghost added the in-pr There is an active PR which will close this issue when it is merged label Aug 3, 2023
@ghost ghost removed the in-pr There is an active PR which will close this issue when it is merged label Aug 3, 2023
@ghost ghost locked as resolved and limited conversation to collaborators Sep 2, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-System.Net.Sockets blocking-clean-ci Blocking PR or rolling runs of 'runtime' or 'runtime-extra-platforms' Known Build Error Use this to report build issues in the .NET Helix tab
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants