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

Stackoverflow on macOS x64 hangs #98477

Open
jkotas opened this issue Feb 15, 2024 · 1 comment
Open

Stackoverflow on macOS x64 hangs #98477

jkotas opened this issue Feb 15, 2024 · 1 comment

Comments

@jkotas
Copy link
Member

jkotas commented Feb 15, 2024

Stackoverflow on macOS x64 can cause infinite memory allocation loop. See #97049 for repro and other context.

@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 Feb 15, 2024
@ghost ghost added the untriaged New issue has not been triaged by the area owner label Feb 15, 2024
@jkotas jkotas added area-ExceptionHandling-coreclr and removed untriaged New issue has not been triaged by the area owner needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners labels Feb 15, 2024
@janvorli
Copy link
Member

janvorli commented Feb 15, 2024

The infinite loop is caused by an insufficient stack size allocated for the stack overflow handling. We allocate 32kB out of which 4kB is a guard page (on x64). The frames on the stack contain large data structures and that end up resulting in stack overflow again in unw_step when the code is unwinding to the first managed frame. Maybe some recent update in the apple libunwind has caused that it tripped the line. There also seems to be a bug in the ___chkstk_darwin that probes too deep (effectively twice the requested amount - it first correctly probes page by page the requested amount, but at the end it probes the requested size below the lowest address is has probed before). That can prevent us from detecting it as a stack overflow, as the probe then goes below the guard page we create.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants