✅ Is throwing and catching an exception in an UnmanagedCallersOnly method valid?
I'm getting a crash under some very specific conditions:
The process just crashes without printing any error messages... or at least it appears to. The process actually stays open and must be killed manually.
I'm planning to write up a Github issue for this, but I want to double check to make sure that this is valid and that I'm submitting the issue to the right place.
Can someone make sure that the code below is valid and point me to which .NET/C# repo I should submit an issue to?
From my understanding, exceptions are fine as long as all of the exceptions are caught before exiting back to native code.
The following reproduction code is the least amount of code I've tested that reproduces the issue.
Reproduction code:
- Must be on Linux (Windows is fine)
- Must have the debugger attached (not attaching the debugger is fine). The VS Code and Rider debuggers both crash.
- The program must be built in Debug configuration (Release is fine)
- The exception must be thrown from a callback function marked with UnmanagedCallersOnly.
The process just crashes without printing any error messages... or at least it appears to. The process actually stays open and must be killed manually.
I'm planning to write up a Github issue for this, but I want to double check to make sure that this is valid and that I'm submitting the issue to the right place.
Can someone make sure that the code below is valid and point me to which .NET/C# repo I should submit an issue to?
From my understanding, exceptions are fine as long as all of the exceptions are caught before exiting back to native code.
The following reproduction code is the least amount of code I've tested that reproduces the issue.
Reproduction code: