Repository navigation
System.Net.Sockets.Tests tests fail with ObjectDisposedException #126183
Copy link
Copy link
Open
Labels
Known Build ErrorUse this to report build issues in the .NET Helix tabUse this to report build issues in the .NET Helix tabarea-System.Net.Socketsblocking-clean-ciBlocking PR or rolling runs of 'runtime' or 'runtime-extra-platforms'Blocking PR or rolling runs of 'runtime' or 'runtime-extra-platforms'
Milestone
Description
Build Information
Build: https://dev.azure.com/dnceng-public/public/_build/results?buildId=1512502
Build error leg or test failing: System.Net.Sockets.Tests.WorkItemExecution
Pull request: #126006
Error Message
Fill the error message using step by step known issues guidance.
{
"ErrorMessage": ["System.Net.Sockets.Tests", "ObjectDisposedException", "System.Net.Sockets.SafeSocketHandle"],
"ErrorPattern": "",
"BuildRetry": false,
"ExcludeConsoleLog": false
}net11.0-osx-Debug-x64-Mono_Minijit_Debug-OSX.15.Amd64.Open
Starting: System.Net.Sockets.Tests (parallel test collections = on [2 threads], stop on fail = off)
[ERROR] FATAL UNHANDLED EXCEPTION: System.ObjectDisposedException: Cannot access a disposed object.
Object name: 'System.Net.Sockets.SafeSocketHandle'.
at System.Runtime.InteropServices.SafeHandle.DangerousAddRef(Boolean& success) in /_/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/SafeHandle.cs:line 165
at System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller`1.ManagedToUnmanagedIn[[System.Runtime.InteropServices.SafeHandle, System.Private.CoreLib, Version=11.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].FromManaged(SafeHandle handle) in /_/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/Marshalling/SafeHandleMarshaller.cs:line 32
at Interop.Sys.Fcntl.SetIsNonBlocking(SafeHandle fd, Int32 isNonBlocking) in /_/artifacts/obj/System.Net.Sockets/Debug/net11.0-unix/Microsoft.Interop.LibraryImportGenerator/Microsoft.Interop.LibraryImportGenerator/LibraryImports.g.cs:line 314
at System.Net.Sockets.SocketAsyncContext.SetHandleBlocking() in /_/src/libraries/System.Net.Sockets/src/System/Net/Sockets/SocketAsyncContext.Unix.cs:line 1386
at System.Net.Sockets.SafeSocketHandle.SetBlocking() in /_/src/libraries/System.Net.Sockets/src/System/Net/Sockets/SafeSocketHandle.Unix.cs:line 154
at System.Net.Sockets.SocketAsyncContext.ConnectOperation.InvokeCallback(Boolean allowPooling) in /_/src/libraries/System.Net.Sockets/src/System/Net/Sockets/SocketAsyncContext.Unix.cs:line 681
at System.Net.Sockets.SocketAsyncContext.OperationQueue`1[[System.Net.Sockets.SocketAsyncContext.WriteOperation, System.Net.Sockets, Version=11.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a]].ProcessAsyncOperation(WriteOperation op) in /_/src/libraries/System.Net.Sockets/src/System/Net/Sockets/SocketAsyncContext.Unix.cs:line 1027
at System.Net.Sockets.SocketAsyncContext.ProcessAsyncWriteOperation(WriteOperation op) in /_/src/libraries/System.Net.Sockets/src/System/Net/Sockets/SocketAsyncContext.Unix.cs:line 1468
at System.Net.Sockets.SocketAsyncContext.WriteOperation.System.Threading.IThreadPoolWorkItem.Execute() in /_/src/libraries/System.Net.Sockets/src/System/Net/Sockets/SocketAsyncContext.Unix.cs:line 347
at System.Net.Sockets.SocketAsyncContext.AsyncOperation.Process() in /_/src/libraries/System.Net.Sockets/src/System/Net/Sockets/SocketAsyncContext.Unix.cs:line 291
at System.Net.Sockets.SocketAsyncContext.HandleEvents(SocketEvents events) in /_/src/libraries/System.Net.Sockets/src/System/Net/Sockets/SocketAsyncContext.Unix.cs:line 2302
at System.Net.Sockets.SocketAsyncEngine.System.Threading.IThreadPoolWorkItem.Execute() in /_/src/libraries/System.Net.Sockets/src/System/Net/Sockets/SocketAsyncEngine.Unix.cs:line 279
at System.Threading.ThreadPoolWorkQueue.Dispatch() in /_/src/libraries/System.Private.CoreLib/src/System/Threading/ThreadPoolWorkQueue.cs:line 950
at System.Threading.PortableThreadPool.WorkerThread.WorkerDoWork(PortableThreadPool threadPoolInstance) in /_/src/libraries/System.Private.CoreLib/src/System/Threading/PortableThreadPool.WorkerThread.cs:line 145
at System.Threading.PortableThreadPool.WorkerThread.WorkerThreadStart() in /_/src/libraries/System.Private.CoreLib/src/System/Threading/PortableThreadPool.WorkerThread.cs:line 121
at System.Threading.Thread.StartHelper.RunWorker() in /_/src/libraries/System.Private.CoreLib/src/System/Threading/Thread.cs:line 90
Known issue validation
Build: 🔎 https://dev.azure.com/dnceng-public/public/_build/results?buildId=1512502
Error message validated: [System.Net.Sockets.Tests ObjectDisposedException System.Net.Sockets.SafeSocketHandle]
Result validation: ✅ Known issue matched with the provided build.
Validation performed at: 7/17/2026 11:25:31 AM UTC
Report
Summary
| 24-Hour Hit Count | 7-Day Hit Count | 1-Month Count |
|---|---|---|
| 0 | 0 | 0 |
Report
| Build | Repository | Test | Pull Request |
|---|---|---|---|
| 1512502 | dotnet/runtime | System.Net.Sockets.Tests.WorkItemExecution | #130416 |
Summary
| 24-Hour Hit Count | 7-Day Hit Count | 1-Month Count |
|---|---|---|
| 1 | 1 | 1 |
Report
Summary
| 24-Hour Hit Count | 7-Day Hit Count | 1-Month Count |
|---|---|---|
| 0 | 2 | 20 |
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Known Build ErrorUse this to report build issues in the .NET Helix tabUse this to report build issues in the .NET Helix tabarea-System.Net.Socketsblocking-clean-ciBlocking PR or rolling runs of 'runtime' or 'runtime-extra-platforms'Blocking PR or rolling runs of 'runtime' or 'runtime-extra-platforms'
Activity
dotnet-policy-service commentedon Mar 27, 2026
Tagging subscribers to this area: @karelz, @dotnet/ncl
See info in area-owners.md if you want to be subscribed.
rzikm commentedon Mar 27, 2026
@liveans seems like this is related to setting non-blocking after connectasync
liveans commentedon Mar 27, 2026
Seems like we need to make
SetHandleBlockingbest effort, I'll take a look next week.jeffschwMSFT commentedon Jun 1, 2026
removing blocking-clean-ci as it has not failed in 30 days
svick commentedon Jul 17, 2026
I have encountered this in #130416, so I'm adding blocking-clean-ci back. Note that the
ErrorMessageseems to have been wrong: it rarely matched, so I have fixed it.bblankenship78 commentedon Oct 12, 2026
We're testing .NET11 and encountering this issue in RC1. Any updates?