dotnet / dotnet/runtime

[Mono] IOCompletionCallbackHelper fails with "Handle is not initialized." error

Open
#119,795 9 comments 0 reactions 1 assignee Claimed by @VSadov View on GitHub
area-Debugger-mono area-System.Threading runtime-mono
Dominant language
C#
Stars
18.3k
Forks
5.6k
PR merge metrics
PR metrics pending

Description

hi, We use 9.0.5 tags and cherry-pick this merge request https://github.com/dotnet/runtime/pull/116001

but hit below exception:
```
[17:57:19.294] Loader Exception:
System.InvalidOperationException: Handle is not initialized.
at System.Runtime.InteropServices.GCHandle.get_Target() in F:\netease-gitlab\dotnet\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\GCHandle.cs:line 86
at System.Threading.Overlapped.GetOverlappedFromNative(NativeOverlapped* pNativeOverlapped) in F:\netease-gitlab\dotnet\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\Overlapped.cs:line 228
at System.Threading.IOCompletionCallbackHelper.PerformSingleIOCompletionCallback(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* pNativeOverlapped) in F:\netease-gitlab\dotnet\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\IOCompletionCallbackHelper.cs:line 36
at System.Threading.PortableThreadPool.IOCompletionPoller.Callback.Invoke(Event e) in F:\netease-gitlab\dotnet\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\PortableThreadPool.IO.Windows.cs:line 319
at System.Threading.ThreadPoolTypedWorkItemQueue`2[[System.Threading.PortableThreadPool.IOCompletionPoller.Event, System.Private.CoreLib, Version=9.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[System.Threading.PortableThreadPool.IOCompletionPoller.Callback, System.Private.CoreLib, Version=9.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].System.Threading.IThreadPoolWorkItem.Execute() in F:\netease-gitlab\dotnet\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\ThreadPoolWorkQueue.cs:line 1395
at System.Threading.ThreadPoolWorkQueue.Dispatch() in F:\netease-gitlab\dotnet\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\ThreadPoolWorkQueue.cs:line 1120
at System.Threading.PortableThreadPool.WorkerThread.WorkerThreadStart() in F:\netease-gitlab\dotnet\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\PortableThreadPool.WorkerThread.cs:line 128
```

@lateralusX Could you help me check if this change has this effect or maybe a new problem?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.