Skip to content

Report StackOverflowException on NativeAOT on Linux#94485

Merged
jtschuster merged 22 commits into
dotnet:mainfrom
jtschuster:StackOverflowLinuxNAOT2
Nov 13, 2023
Merged

Report StackOverflowException on NativeAOT on Linux#94485
jtschuster merged 22 commits into
dotnet:mainfrom
jtschuster:StackOverflowLinuxNAOT2

Conversation

@jtschuster

Copy link
Copy Markdown
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
…ester.cs

Co-authored-by: Michal Strehovský <MichalStrehovsky@users.noreply.github.com>
…cted failures and remove messages about failing to find createdump
Co-authored-by: Jan Vorlicek <jan.vorlicek@volny.cz>
@ghost ghost 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

ghost commented Nov 7, 2023

Copy link
Copy Markdown

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: -

@janvorli janvorli left a comment

Copy link
Copy Markdown
Member

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
Copy Markdown
Member Author

/azp run runtime-nativeaot-outerloop

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@jtschuster

Copy link
Copy Markdown
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
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