Skip to content

Revert "Fix reporting of foreign native exception not handled by runt… #116621

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 13, 2025

Conversation

tommcdon
Copy link
Member

This PR reverts #115750 which affected debugger scenarios, causing internal Visual Studio testing to fail

This reverts commit 90236b9.

Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR reverts commit 90236b9… which introduced changes to foreign native exception reporting, restoring the previous debugger-friendly behavior.

  • Removes thread-based native exception helpers and associated C# test.
  • Reverts the modified isNotHandledByRuntime logic in the exception handling path.

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
src/tests/baseservices/exceptions/exceptioninterop/ExceptionInteropNative.cpp Deletes InvokeCallbackAndCatchNative and InvokeCallbackOnNewThread to revert test helpers
src/tests/baseservices/exceptions/exceptioninterop/ExceptionInterop.cs Removes the InvokeCallbackOnNewThread DllImport and its PropagateAndCatchCppException test
src/coreclr/vm/exceptionhandling.cpp Restores the original branching logic around detecting unhandled managed exceptions
Comments suppressed due to low confidence (2)

src/tests/baseservices/exceptions/exceptioninterop/ExceptionInterop.cs:193

  • [nitpick] By removing the PropagateAndCatchCppException test, coverage for native exception propagation is reduced. Consider adding an alternative test or updating existing tests to ensure this behavior remains exercised.
[DllImport(nameof(ExceptionInteropNative))]

src/coreclr/vm/exceptionhandling.cpp:4018

  • The condition no longer checks that the exception is a managed (COM+) exception; the IsComPlusException guard was removed, which may cause non-managed exceptions to be treated as unhandled. Consider restoring the IsComPlusException(pTopExInfo->m_ptrs.ExceptionRecord) check in this if condition.
if ((pFrame == FRAME_TOP) ||

@janvorli janvorli merged commit 086ecfb into dotnet:main Jun 13, 2025
103 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants