YJIT: ZJIT: Use opt-level=1 on dev builds to avoid SystemStackError - #16647
Merged
Conversation
XrXr
commented
Apr 2, 2026
Member
- YJIT: ZJIT: Use opt-level=1 on dev builds to avoid SystemStackError
- Revert "ZJIT: Skip TestOpenURIProxy on Linux (ZJIT: Skip TestOpenURIProxy on Linux #16606)"
- Revert "ZJIT: Skip TestOpenURI and TestOpenURISSL (ZJIT: Skip TestOpenURI and TestOpenURISSL #16603)"
Member
Author
|
(the way I figured this out was by commenting out the check in SEGV/SIGBUS handlers for stackoverflow to get a crash with a stack trace instead of a nondescript SystemStackError 8f64228) |
XrXr
force-pushed
the
zjit-opt-1-to-save-stack-space
branch
from
April 2, 2026 21:08
4cdb64f to
a34f7e9
Compare
k0kubun
reviewed
Apr 2, 2026
k0kubun
reviewed
Apr 2, 2026
k0kubun
approved these changes
Apr 2, 2026
k0kubun
left a comment
Member
There was a problem hiding this comment.
Thank you for figuring this out 🙏
XrXr
force-pushed
the
zjit-opt-1-to-save-stack-space
branch
2 times, most recently
from
April 2, 2026 22:00
d401926 to
c3e5830
Compare
XrXr
enabled auto-merge (rebase)
April 2, 2026 22:23
The transmute triggered a miscompilation on Rust 1.85.0, where the callback was "optimized" to unconditional go to a `SIGTRAP`ping instruction. While later Rust versions don't have the same miscompilation, it seems that this is also partly our fault for being funky with the pointer provenance in this code. It's possible rust will make some changes that break the transmute. Use the Exposed Provenance API here and steer clear of transmute. See: rust-lang/rust#121282 See: rust-lang/rust#147265 See: rust-lang/rust#128409 (comment)
Despite adding rb_ec_stack_check() to Rust code entry points, we've seen SystemStackError causing test failures due to debug builds consume too much native stack space. Let's use opt-level=1 so rustc/LLVM are more efficient with stack space usage, hopefully enough to fit in the margin in rb_ec_stack_check(). Continue to use opt-level=0 in the test profile.
This reverts commit d368d42.
This reverts commit 33b9d2a.
XrXr
force-pushed
the
zjit-opt-1-to-save-stack-space
branch
from
April 2, 2026 22:28
c3e5830 to
2c63fcd
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.