Uh oh!
There was an error while loading. Please reload this page.
Fix LibraryImport QCall signature mismatches - #132530
Merged
jkotas merged 1 commit intoAug 21, 2026
Merged
Conversation
Align managed and native return types and BOOL parameter widths for assembly tracing, thread statics, and runtime event source QCalls. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 97860be5-98b0-40c6-8f3d-6fcce5f6b56c
|
Azure Pipelines: Successfully started running 3 pipeline(s). 13 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
Contributor
Tagging subscribers to this area: @agocke |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR aligns several CoreCLR/NativeAOT QCall boundaries so the managed LibraryImport signatures match the native implementations, avoiding ABI mismatches (void-vs-bool returns and 1-byte bool vs 4-byte BOOL parameters) in tracing and thread-static helpers.
Changes:
- Updated native QCall signatures to use 4-byte
BOOLfor boolean parameters where managed marshalling usesUnmanagedType.Bool. - Fixed CoreCLR
LibraryImportassembly tracing declarations that previously returnedbooleven though the native QCalls returnvoid. - Kept NativeAOT enabled/disabled EventPipe implementations consistent for the ThreadPool I/O enqueue event.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/coreclr/vm/nativeeventsource.h | Changes NativeRuntimeEventSource_LogThreadPoolIOEnqueue boolean parameter type to BOOL to match managed marshalling. |
| src/coreclr/vm/nativeeventsource.cpp | Updates the corresponding QCall implementation signature to BOOL for multiDequeues. |
| src/coreclr/vm/JitQCallHelpers.h | Changes thread-static helper QCall declarations to take BOOL instead of bool for ABI consistency. |
| src/coreclr/vm/jithelpers.cpp | Updates thread-static helper QCall implementations to accept BOOL for gcStatic. |
| src/coreclr/vm/assemblynative.hpp | Changes AssemblyNative_TraceAssemblyLoadFromResolveHandlerInvoked to take BOOL for isTrackedAssembly. |
| src/coreclr/vm/assemblynative.cpp | Updates the corresponding QCall implementation signature to use BOOL. |
| src/coreclr/System.Private.CoreLib/src/System/Runtime/Loader/AssemblyLoadContext.CoreCLR.cs | Fixes tracing LibraryImport declarations to return void (matching native QCalls) and removes incorrect return marshalling. |
| src/coreclr/nativeaot/Runtime/disabledruntimeeventinternal.cpp | Updates disabled NativeAOT event stub for LogThreadPoolIOEnqueue to use BOOL for the boolean parameter. |
jkoritzinsky
approved these changes
Aug 19, 2026
Uh oh!
There was an error while loading. Please reload this page.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
LibraryImportdeclarations that returnedbooleven though their QCall implementations returnvoid.[MarshalAs(UnmanagedType.Bool)]parameters with 4-byte nativeBOOLparameters for thread-static helpers, assembly load tracing, and ThreadPool I/O enqueue events.MonoBooleanABI.These mismatches could read an undefined return value or pass a differently sized boolean across the managed/native ABI, depending on the target architecture and calling convention.
Testing
build.cmd clr -rc Debugbuild.cmd clr.aot+libs -rc Debug -lc ReleaseThreadStatic01andThreadStatic06on the rebuilt CoreCLRSystem.Threading.ThreadPool.Tests: 70 passed, 1 skipped; the Windows ThreadPool-specificReadWriteAsyncTestwas skipped because its runtime condition was not metNote
This pull request description was generated with GitHub Copilot.