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

Report StackOverflowException on NativeAOT on Linux #94485

Merged
merged 22 commits into from
Nov 13, 2023

Conversation

jtschuster
Copy link
Member

Moved #93901 here. Pulling main messed up something, so just going to make a new PR.

Uses similar code as CoreCLR to allocate an alternate stack for handling SIGSEGV, and properly reports a StackOverflowException.

Fixes #82334

Updates the baseservices/exceptions/stackoverflow test to be one project and run on NativeAOT.

jtschuster and others added 22 commits October 19, 2023 19:49
Use SA_ONSTACK for SIGSEGV handler
Call sigaltstack() to set the alternate stack on the main thread only
Check if faulting address is near the stack pointer, if so, report stack overflow
…cted failures and remove messages about failing to find createdump
@dotnet-issue-labeler dotnet-issue-labeler bot added the needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners label Nov 7, 2023
@ghost ghost assigned jtschuster Nov 7, 2023
@jtschuster jtschuster added area-NativeAOT-coreclr and removed needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners labels Nov 7, 2023
@ghost
Copy link

ghost commented Nov 7, 2023

Tagging subscribers to this area: @agocke, @MichalStrehovsky, @jkotas
See info in area-owners.md if you want to be subscribed.

Issue Details

Moved #93901 here. Pulling main messed up something, so just going to make a new PR.

Uses similar code as CoreCLR to allocate an alternate stack for handling SIGSEGV, and properly reports a StackOverflowException.

Fixes #82334

Updates the baseservices/exceptions/stackoverflow test to be one project and run on NativeAOT.

Author: jtschuster
Assignees: jtschuster
Labels:

area-NativeAOT-coreclr, needs-area-label

Milestone: -

Copy link
Member

@janvorli janvorli left a comment

Choose a reason for hiding this comment

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

LGTM, thank you!

@jtschuster
Copy link
Member Author

/azp run runtime-nativeaot-outerloop

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@jtschuster
Copy link
Member Author

@MichalStrehovsky Can you take a look and sign off when you get a chance?

@jtschuster jtschuster merged commit 261668f into dotnet:main Nov 13, 2023
147 of 157 checks passed
jtschuster added a commit that referenced this pull request Nov 29, 2023
jtschuster added a commit that referenced this pull request Nov 29, 2023
…#95415)

This reverts commit 261668f.

We're hitting seg faults instead of null reference exceptions in tests after this change. Reverting to make sure this caused the issue, and then investigate.
jtschuster added a commit to jtschuster/runtime that referenced this pull request Dec 8, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Dec 14, 2023
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.

[NativeAOT] Stackoverflow reporting on Linux
3 participants