dotnet / dotnet/runtime

UnmanagedCallersOnly methods that require marshalling throw catchable exceptions

Open
#130,233 1 comment 0 reactions 0 assignees View on GitHub
area-Interop-coreclr
Dominant language
C#
Stars
18.3k
Forks
5.6k
PR merge metrics
PR metrics pending

Description

In https://github.com/dotnet/runtime/pull/130160#discussion_r3518105656 we noticed a test that is apparently successfully catching the exception that we throw when UnmanagedCallersOnly method requires marshalling. How does this exception survive through the managed/native transition on non-Windows?

The tests that had to be excluded for native AOT in #133399 are also suspicious.

Contributor guide

Open the contributing guide

Research direction

Start with the test discussed in PR 130160 and the tests excluded for native AOT in #133399; compare their behavior across non-Windows managed/native transitions. Reproduce the catchable exception, then determine whether the excluded tests should be restored or adjusted; done means the exception behavior is explained and the affected tests accurately reflect it.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
devtools, operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.