[ruby-core:127340] [Ruby Bug#22510] YJIT on arm64 crashes when the code region is larger than 128MiB
Issue #22510 has been reported by hsbt (Hiroshi SHIBATA). ---------------------------------------- Bug #22510: YJIT on arm64 crashes when the code region is larger than 128MiB https://bugs.ruby-lang.org/issues/22510 * Author: hsbt (Hiroshi SHIBATA) * Status: Open * ruby -v: ruby 4.0.9 (2026-11-05 revision 1636a3cb0c) +PRISM [aarch64-linux] * Backport: 3.3: UNKNOWN, 3.4: REQUIRED, 4.0: REQUIRED ---------------------------------------- On arm64, YJIT jumps to a small address such as `0x2064` and crashes once the code region exceeds 128MiB. With `--yjit-mem-size=512`, `30k_variables` from ruby-bench crashes this way on the current `ruby_3_4` and `ruby_4_0` built for aarch64-linux. The default size is not affected. Since a1c61f0ae5 made `CodePtr` an offset into the code region, the fallback in `emit_jmp_ptr` for targets out of the range of `b` loads that offset instead of the address before `br`. This is fixed on master by 7f451f6c00 (https://github.com/ruby/ruby/pull/19718), which cherry-picks cleanly to `ruby_3_4` and `ruby_4_0`. -- https://bugs.ruby-lang.org/
Issue #22510 has been updated by nagachika (Tomoyuki Chikanaga). Backport changed from 3.3: UNKNOWN, 3.4: REQUIRED, 4.0: REQUIRED to 3.3: UNKNOWN, 3.4: DONE, 4.0: REQUIRED Merged into `ruby_3_4` at https://github.com/ruby/ruby/commit/d1828a76375c008cd43f93172fb8d7a73a5cda42 ---------------------------------------- Bug #22510: YJIT on arm64 crashes when the code region is larger than 128MiB https://bugs.ruby-lang.org/issues/22510#change-119780 * Author: hsbt (Hiroshi SHIBATA) * Status: Closed * ruby -v: ruby 4.0.9 (2026-11-05 revision 1636a3cb0c) +PRISM [aarch64-linux] * Backport: 3.3: UNKNOWN, 3.4: DONE, 4.0: REQUIRED ---------------------------------------- On arm64, YJIT jumps to a small address such as `0x2064` and crashes once the code region exceeds 128MiB. With `--yjit-mem-size=512`, `30k_variables` from ruby-bench crashes this way on the current `ruby_3_4` and `ruby_4_0` built for aarch64-linux. The default size is not affected. Since a1c61f0ae5 made `CodePtr` an offset into the code region, the fallback in `emit_jmp_ptr` for targets out of the range of `b` loads that offset instead of the address before `br`. This is fixed on master by 7f451f6c00 (https://github.com/ruby/ruby/pull/19718), which cherry-picks cleanly to `ruby_3_4` and `ruby_4_0`. -- https://bugs.ruby-lang.org/
Issue #22510 has been updated by tenderlovemaking (Aaron Patterson). Backport changed from 3.3: UNKNOWN, 3.4: DONE, 4.0: REQUIRED to 3.3: UNKNOWN, 3.4: DONE, 4.0: DONE ruby_4_0 commit:35bd011334 merged revision(s) commit:7f451f6c00 (https://github.com/ruby/ruby/pull/19725). ---------------------------------------- Bug #22510: YJIT on arm64 crashes when the code region is larger than 128MiB https://bugs.ruby-lang.org/issues/22510#change-119875 * Author: hsbt (Hiroshi SHIBATA) * Status: Closed * ruby -v: ruby 4.0.9 (2026-11-05 revision 1636a3cb0c) +PRISM [aarch64-linux] * Backport: 3.3: UNKNOWN, 3.4: DONE, 4.0: DONE ---------------------------------------- On arm64, YJIT jumps to a small address such as `0x2064` and crashes once the code region exceeds 128MiB. With `--yjit-mem-size=512`, `30k_variables` from ruby-bench crashes this way on the current `ruby_3_4` and `ruby_4_0` built for aarch64-linux. The default size is not affected. Since a1c61f0ae5 made `CodePtr` an offset into the code region, the fallback in `emit_jmp_ptr` for targets out of the range of `b` loads that offset instead of the address before `br`. This is fixed on master by 7f451f6c00 (https://github.com/ruby/ruby/pull/19718), which cherry-picks cleanly to `ruby_3_4` and `ruby_4_0`. -- https://bugs.ruby-lang.org/
participants (3)
-
hsbt (Hiroshi SHIBATA) -
nagachika (Tomoyuki Chikanaga) -
tenderlovemaking (Aaron Patterson)