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
YJIT: Fix false object collection when setting ivar #7718
Conversation
294adde
to
b8c5682
Compare
Not for this PR, but with this amount of |
Uh oh, the regression test is so good that it crashes RJIT even after my fix attempt at f889a96. Will need to debug that further, or skip it for now for RJIT? |
No worries. Please skip it for RJIT for now. |
Previously, setinstancevariable could generate code that calls `rb_ensure_iv_list_size()` without first updating `cfp->sp`. This means in the event that a GC start from within said routine the top few objects would not be marked, causing them to be falsly collected. Call `jit_prepare_routine_call()` first. [Bug #19601]
`jit_prepare_routine_call()` calls it, and there is another call above on line 2302. Co-authored-by: Takashi Kokubun <takashikkbn@gmail.com>
Despite applying a fix to RJIT similar to the YJIT fix, this test still crashes RJIT.
08ca563
to
237f738
Compare
Yeah. Kind of related to that, given how often we've had this class of bugs, I think ccall should do |
If it doesn't cause a significant performance drawback, that'd be nice.
|
Seems like a decent solution. Another option could be to remove the |
Backports: ruby/ruby#7718 This fixes a GC crash caused by YJIT. It generally manifest itself with a `[BUG] try to mark T_NONE object`.
Previously, setinstancevariable could generate code that calls
rb_ensure_iv_list_size()
without first updatingcfp->sp
. This meansin the event that a GC start from within said routine the top few
objects would not be marked, causing them to be falsly collected.
Call
jit_prepare_routine_call()
first.[Bug #19601]