Skip to content
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

[release/9.0] Fix storage of stack trace of exception from reflection #107093

Merged
merged 3 commits into from
Aug 29, 2024

Conversation

github-actions[bot]
Copy link
Contributor

@github-actions github-actions bot commented Aug 28, 2024

Backport of #106901 to release/9.0

/cc @janvorli

Customer Impact

  • Customer reported
  • Found internally

The issue prevents SOS showing correct stack trace for inner exceptions when the exception occurs in reflection invoked code and when it is propagated to the caller of the reflected code.

Regression

  • Yes
  • No

The regression was caused by enabling of the new exception handling by default.

Testing

Tested using a SOS test that was failing and also manually with a testing application and WinDbg.

Risk

Low. There is no visible change for getting the exception stack trace using Exception.ToString, it only influences SOS.

There was one more case where we have saved the stack trace into the _remoteStackTraceString
field in the exception when the exception was passing from reflection invoked code
to the caller of that code. While there is no visible difference in the Exception.ToString,
a SOS test was failing due to that. And it is not necessary to save the stack trace
there.

I have thought about the cases when we really need the stack trace saved into the
_remoteStackTraceString and I believe that actually the only case is when an existing
exception is thrown again in managed code. So I have removed the option to save the stack
trace from all the variants of the DispatchManagedException.
@janvorli janvorli requested a review from jkotas August 28, 2024 15:56
@janvorli janvorli self-assigned this Aug 28, 2024
@janvorli janvorli added the Servicing-consider Issue for next servicing release review label Aug 28, 2024
@janvorli janvorli added this to the 9.0.0 milestone Aug 28, 2024
Copy link
Member

@jeffschwMSFT jeffschwMSFT left a comment

Choose a reason for hiding this comment

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

approved. please get a code review. we can merge when ready

@jeffschwMSFT jeffschwMSFT added Servicing-approved Approved for servicing release and removed Servicing-consider Issue for next servicing release review labels Aug 28, 2024
@jeffschwMSFT jeffschwMSFT merged commit 13c6579 into release/9.0 Aug 29, 2024
10 checks passed
@jkotas jkotas deleted the backport/pr-106901-to-release/9.0 branch September 5, 2024 16:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants