Skip to content

Conversation

@janvorli
Copy link
Member

This change makes the new exception handling pass all the mdbg tests (tested on Windows x64, Linux x64 and Linux arm64) except for the Exceptions.ReflectionTest that will require a change in the test.
Here is a list of changes:

  • Adds debugger and profiler events in the right places and order
  • Adds debugger exception interception implementation
  • Ensures that the new managed exception handling frames are not visible to the debugger stack trace
  • Fixes some missing frames on stack traces (coming from HelperMethodFrame)
  • Moves first chance exception handling to the native code. It is necessary to ensure that the exception stack trace contains frames from the explicit frames that have MethodDesc at the time the event fires.
  • Makes some refactoring around the ExInfo - the CONTEXT and REGDISPLAY are now in the ExInfo, the ExInfo now also contains the original exception pointers.
  • Fixes one case when an unhandled exception at the boundary of managed and native code was not handled correctly.
  • Changes the way an unhandled exception in exception filter is swallowed. The stack frame iterator was having issues with the fact that the exception "leaked" from the actual filter and was caught by another filter in the managed EH. Now the exception is always swallowed at the filter.

@janvorli janvorli added this to the 9.0.0 milestone Dec 15, 2023
@janvorli janvorli requested a review from jkotas December 15, 2023 15:44
@janvorli janvorli self-assigned this Dec 15, 2023
This change
* Adds debugger and profiler events in the right places and order
* Adds debugger exception interception implementation
* Ensures that the new managed exceptino handling frames are not visible
  to the debugger stack trace
* Fixes some missing frames on stack traces (coming from
  HelperMethodFrame)
* Moves first chance exception handling to the native code. It is
  necessary to ensure that the exception stack trace contains frames
  from the explicit frames that have MethodDesc at the time the event
  fires.
* Makes some refactoring around the ExInfo - the CONTEXT and REGDISPLAY
  are now in the ExInfo, the ExInfo contains the original exception pointers.
* Fixes one case when an UnhandledException at the boundary of managed
  and native code was not handled correctly.
* Changes the way an unhandled exception in exception filter is
  swallowed. The stack frame iterator was having issues with the fact
  that the exception "leaked" from the actual filter and was caught by
  another filter in the managed EH. Now the exception is always
  swallowed at the filter.
@janvorli janvorli force-pushed the new-eh-diag-and-other-fixes branch from c024855 to 102ab95 Compare December 15, 2023 15:48
@jkotas
Copy link
Member

jkotas commented Dec 15, 2023

@tommcdon @dotnet/dotnet-diag-contrib

@tommcdon
Copy link
Member

@mikem8361

@janvorli janvorli force-pushed the new-eh-diag-and-other-fixes branch from 583f180 to 73c5c49 Compare December 18, 2023 16:20
@janvorli janvorli force-pushed the new-eh-diag-and-other-fixes branch from d0eb3b4 to d8383bb Compare December 21, 2023 00:12
Slight modification of the code enables second pass for unhandled
exceptions. That makes finallys get called the same way as without the
new exception handling.
Copy link
Member

@tommcdon tommcdon left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

@janvorli janvorli closed this Dec 22, 2023
@janvorli janvorli reopened this Dec 22, 2023
@janvorli
Copy link
Member Author

The windows arm64 nativeaot leg failure is a known issue

@janvorli janvorli merged commit 955604c into dotnet:main Dec 23, 2023
@janvorli janvorli deleted the new-eh-diag-and-other-fixes branch December 23, 2023 16:30
@github-actions github-actions bot locked and limited conversation to collaborators Jan 23, 2024
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.

3 participants