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

YJIT: Fix reference update for Invariants::no_ep_escape_iseqs #10656

Merged
merged 3 commits into from Apr 27, 2024

Conversation

XrXr
Copy link
Member

@XrXr XrXr commented Apr 27, 2024

  • YJIT: Fix reference update for Invariants::no_ep_escape_iseqs
  • YJIT: Stop asserting rb_objspace_markable_object_p()
  • YJIT: Correct signature of rb_yjit_root_mark()

The nil-on-stack issue on CI was still reproducible locally by running make test-all TESTS='-j1 ../test/ruby/test_enumerator.rb' RUN_OPTS='--yjit-call-threshold=1 --yjit-verify-ctx' in a loop locally. After apply this changeset the crash seem to have gone away.

Previously, the update was done in the ISEQ callback. That effectively
never updated anything because the callback itself is given an intact
reference, so it could update its content, and `rb_gc_location(iseq)`
never returned a new address. Update the whole table once in the YJIT
root instead.
Because of the way things are sequenced, it doesn't work properly during
auto-compaction.
Even though unused, it's supposed to take a pointer like the C side
expects.
@matzbot matzbot requested a review from a team April 27, 2024 00:17
Copy link
Member

@k0kubun k0kubun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That effectively never updated anything because the callback itself is given an intact reference, so it could update its content, and rb_gc_location(iseq) never returned a new address.

I see. Thanks for fixing this 🙇

@k0kubun k0kubun enabled auto-merge (rebase) April 27, 2024 01:00
@k0kubun k0kubun merged commit 2ba7c1b into ruby:master Apr 27, 2024
101 checks passed
@k0kubun k0kubun deleted the yjit-fix-table-compaction branch April 27, 2024 01:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants