Skip to content

Prevent unwinding through stack bottom #81770

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

Merged

Conversation

janvorli
Copy link
Member

@janvorli janvorli commented Feb 7, 2023

When processing unhandled exception on the most recent Alpine 3.17, the libunwind doesn't stop at the bottom
frame of the main thread (the caller of main) and tries to unwind further. The reason is that the method is missing dwarf unwind information, so the libunwind falls back to using RBP chain, but the RBP points to a garbage and so it ends up crashing with SIGSEGV.

While the missing DWARF unwind info seems to be a bug in the Alpine 3.17 (older ones work fine), we can prevent issues like this by stopping at the hosting API boundary and not trying to unwind past that. This is what this PR does.

Close #81218

When processing unhandled exception on the most recent Alpine 3.17,
the libunwind doesn't stop at the bottom
frame of the main thread (the caller of `main`) and tries to unwind
further. The reason is that the method is missing dwarf unwind
information, so the libunwind falls back to using RBP chain, but the RBP
points to a garbage and so it ends up crashing with SIGSEGV.

While the missing DWARF unwind info seems to be a bug in the Alpine 3.17
(older ones work fine), we can prevent issues like this by stopping at
the hosting API boundary and not trying to unwind past that. This is
what this PR does.
@janvorli janvorli merged commit 215839e into dotnet:main Feb 8, 2023
@janvorli
Copy link
Member Author

janvorli commented Feb 8, 2023

/backport to release/7.0

@github-actions
Copy link
Contributor

github-actions bot commented Feb 8, 2023

Started backporting to release/7.0: https://github.com/dotnet/runtime/actions/runs/4119655573

@janvorli
Copy link
Member Author

janvorli commented Feb 8, 2023

/backport to release/6.0

@github-actions
Copy link
Contributor

github-actions bot commented Feb 8, 2023

Started backporting to release/6.0: https://github.com/dotnet/runtime/actions/runs/4119656749

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.

Logging isnt shown and exception isnt thrown when using aspnet:6.0.13-alpine3.17-amd64
3 participants