-
Notifications
You must be signed in to change notification settings - Fork 5.4k
Prefer th->ec
for stack base/size.
#13101
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot reviewed 1 out of 1 changed files in this pull request and generated no comments.
35e9888
to
7a9a094
Compare
✅ All Tests passed!✖️no tests failed ✔️61945 tests passed(2 flakes) |
7a9a094
to
a47ca0f
Compare
a47ca0f
to
c632cc5
Compare
Retrying after the machine stack overflowed may not work well on all systems. |
c632cc5
to
89fa2d9
Compare
e7abc44
to
4e32ab3
Compare
@nobu I plan to merge this PR, and skip Windows on the tests. We can follow up with another PR to fix Windows stack overflow handling. |
4e32ab3
to
00d4f38
Compare
It looks like it's also possible for the GC itself to try and scan "out of bounds" of the machine stack:
|
Without this PR, the following program exits with SIGBUS on Darwin:
Fiber.consume_stack(n)
is equivalent toALLOCA
. So it eventually hits guard page.Since
Fiber
will setth->ec
stack base/size, we should prefer it before usingget_stack
which may return the original thread's stack details. For the purpose of computing a stack overflow, it is preferable to use the current Fiber's stack.Test Output
Before PR
After PR