Skip to content

Enable NativeAOT callback stress coverage without SEH interop - #133403

Merged
MichalStrehovsky merged 1 commit into
dotnet:mainfrom
MichalStrehovsky:fix/nativeaot-callback-stress
Sep 9, 2026
Merged

MichalStrehovsky merged 1 commit into
dotnet:mainfrom
MichalStrehovsky:fix/nativeaot-callback-stress

Conversation

@MichalStrehovsky

Copy link
Copy Markdown
Member

Gate native exception propagation on IsExceptionInteropSupported instead of skipping the whole test. Use the existing native-library path helper so the resolver works with the NativeAOT test layout.

Gate native exception propagation on IsExceptionInteropSupported instead of skipping the whole test. Use the existing native-library path helper so the resolver works with the NativeAOT test layout.

Co-authored-by: Copilot <[email protected]>
Copilot-Session: 3dea65e4-6bec-47a1-b938-b02f43d8a0bb
@azure-pipelines

Copy link
Copy Markdown
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.

@dotnet-policy-service

Copy link
Copy Markdown
Contributor

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

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The changes are small, test-scoped, and align with existing helper patterns (GetFullPath / IsExceptionInteropSupported) used elsewhere in the interop test suite.

Pull request overview

This PR updates the NativeLibrary callback stress test to run on more runtimes (notably NativeAOT) by (1) using the existing helper that resolves the native library via an explicit full path and (2) gating Windows SEH exception propagation behavior on a centralized runtime capability check rather than skipping the entire test.

Changes:

  • Update the DllImportResolver path to load the native library via NativeLibraryToLoad.GetFullPath() (consistent with other NativeLibrary tests and compatible with NativeAOT layout).
  • Gate RaiseException/SEHException behavior on PlatformDetection.IsExceptionInteropSupported and treat unsupported runtimes as “covered” for the counter-based assertion.
  • Remove the NativeAOT-specific [ActiveIssue] skip so the test can run under NativeAOT (while still skipping only the unsupported exception interop portion).
File summaries
File Description
src/tests/Interop/NativeLibrary/Callback/CallbackStressTest.cs Uses NativeLibraryToLoad.GetFullPath() in the resolver and gates SEH interop via PlatformDetection.IsExceptionInteropSupported, enabling broader runtime coverage (incl. NativeAOT).
Review details
  • Files reviewed: 1/1 changed files
  • Comments generated: 0
  • Review effort level: Lite

@MichalStrehovsky

Copy link
Copy Markdown
Member Author

/ba-g mono crash was #133442

@MichalStrehovsky
MichalStrehovsky enabled auto-merge (squash) September 9, 2026 05:14
@MichalStrehovsky
MichalStrehovsky merged commit 66ac0ae into dotnet:main Sep 9, 2026
94 of 97 checks passed
@MichalStrehovsky
MichalStrehovsky deleted the fix/nativeaot-callback-stress branch September 9, 2026 05:15
@dotnet-milestone-bot dotnet-milestone-bot Bot added this to the 12.0-preview1 milestone Sep 9, 2026
@github-actions github-actions Bot locked and limited conversation to collaborators Oct 10, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants