-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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] Remove managed EH code frames from stack trace #108831
Conversation
When StackTrace is created inside of an exception filter, it contains stack frames of the managed exception handling code, like System.Runtime.EH.RhThrowEx System.Runtime.EH.DispatchEx System.Runtime.EH.FindFirstPassHandler These should not occur on the stack trace as they are internal implementation detail of the new EH. This change fixes it by adding [StackTraceHidden] attribute to these methods. Close #107995
Tagging subscribers to this area: @agocke, @MichalStrehovsky, @jkotas |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm. please get a code review. we will take for consideration in 9 GA
src/coreclr/nativeaot/Runtime.Base/src/System/Runtime/ExceptionHandling.cs
Show resolved
Hide resolved
please take a look at the pr failures |
This is known intermittent issue with rc1 toolset. We need to update to rc2 to pick up the fix. |
@carlossanlop When do we expect release/9.0 to be updated to rc2 toolset? |
Backport of #108723 to release/9.0
/cc @janvorli
Customer Impact
[x] Customer reported
[ ] Found internally
When stack trace is captured using the System.Diagnostics.StackTrace in an exception filter, it contains internal frames of the exception handling implementation that should not be visible to the user as they are an implementation detail.
Here is an example provided by the customer who has reported the problem:
And this is what it looks like in .NET 8 (and also with this fix):
Regression
[x] Yes
[ ] No
Regression in .NET 9 due to the new exception handling being enabled by default.
Testing
Testing using a repro provided by the customer.
Risk
Low, the change only modifies metadata (adds attributes to the internal EH implementation methods that prevents showing them on the stack trace.