Skip to content

Fix edge case in stack overflow handling - #85272

Merged
janvorli merged 1 commit into
dotnet:mainfrom
janvorli:fix-stack-overflow-handling-issue
Apr 25, 2023
Merged

Fix edge case in stack overflow handling#85272
janvorli merged 1 commit into
dotnet:mainfrom
janvorli:fix-stack-overflow-handling-issue

Conversation

@janvorli

Copy link
Copy Markdown
Member

There is a problematic case when the stack overflow happens in native code and there is an explicit frame between the managed and native code. Some time ago, I have added a fix for a problem when the stack overflow happened in native code, but I haven't found that it actually works only in case there is no explicit frame between the managed code and the failing native code frame. That fix makes the FaultingExceptionFrame that is created for the stack overflow to contain context of the managed code frame, so the stack walker uses that to move to the next frame. But while doing so, it hits the other explicit frame that it doesn't expect there and fires an assert.

This fix handles the problematic case correctly.

Close #81360

There is a problematic case when the stack overflow happens in native code
and there is an explicit frame between the managed and native code. Some
time ago, I have added a fix for a problem when the stack overflow
happened in native code, but I haven't found that it actually works only
in case there is no explicit frame between the managed code and the
failing native code frame. That fix makes the `FaultingExceptionFrame`
that is created for the stack overflow to contain context of the managed
code frame, so the stack walker uses that to move to the next frame. But
while doing so, it hits the other explicit frame that it doesn't expect
there and fires an assert.

This fix handles the problematic case correctly.
@janvorli janvorli added the area-ExceptionHandling-coreclr only use for closed issues label Apr 24, 2023
@janvorli janvorli added this to the 8.0.0 milestone Apr 24, 2023
@janvorli
janvorli requested a review from jkotas April 24, 2023 20:34
@janvorli janvorli self-assigned this Apr 24, 2023
@janvorli

Copy link
Copy Markdown
Member Author

cc: @JulieLeeMSFT

@janvorli
janvorli merged commit 5be5b9e into dotnet:main Apr 25, 2023
@ghost ghost locked as resolved and limited conversation to collaborators May 25, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-ExceptionHandling-coreclr only use for closed issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

baseservices\exceptions\stackoverflow\stackoverflowtester fails under pgo stress on windows arm

2 participants