Failure:
TestRubyOptions#test_enable [/builddir/build/BUILD/ruby-3.2.0/test/ruby/test_rubyoptions.rb:176]:
pid 2482783 killed by SIGABRT (signal 6) (core dumped)
| thread '' panicked at 'assertion failed: (left == right)
| left: 16384,
| right: 0: code page size is not page-aligned', /builddir/build/BUILD/ruby-3.2.0/yjit/src/codegen.rs:7235:13
| note: run with RUST_BACKTRACE=1 environment variable to display a backtrace
.
[1/2] Assertion for "stdout"
| <[]> expected but was
| <["YJIT: rb_yjit_init_rust() panicked. Aborting."]>.
[2/2] Assertion for "stderr"
| <[]> expected but was
| <["thread '' panicked at 'assertion failed: (left == right)",
| " left: 16384,",
| " right: 0: code page size is not page-aligned', /builddir/build/BUILD/ruby-3.2.0/yjit/src/codegen.rs:7235:13",
| "note: run with RUST_BACKTRACE=1 environment variable to display a backtrace"]>.
Failure:
TestYJIT#test_string_interpolation [/builddir/build/BUILD/ruby-3.2.0/test/ruby/test_yjit.rb:457]:
exited with status 134, stderr:
thread '' panicked at 'assertion failed: (left == right)
left: 16384,
right: 0: code page size is not page-aligned', /builddir/build/BUILD/ruby-3.2.0/yjit/src/codegen.rs:7235:13
note: run with RUST_BACKTRACE=1 environment variable to display a backtrace
Failure:
TestYJIT#test_string_then_nil [/builddir/build/BUILD/ruby-3.2.0/test/ruby/test_yjit.rb:302]:
exited with status 134, stderr:
thread '' panicked at 'assertion failed: (left == right)
left: 16384,
right: 0: code page size is not page-aligned', /builddir/build/BUILD/ruby-3.2.0/yjit/src/codegen.rs:7235:13
note: run with RUST_BACKTRACE=1 environment variable to display a backtrace
Failure:
TestRubyOptions#test_enable [/builddir/build/BUILD/ruby-3.2.0/test/ruby/test_rubyoptions.rb:176]:
pid 2482783 killed by SIGABRT (signal 6) (core dumped)
| thread '' panicked at 'assertion failed: (left == right)
| left: 16384,
| right: 0: code page size is not page-aligned', /builddir/build/BUILD/ruby-3.2.0/yjit/src/codegen.rs:7235:13
| note: run with RUST_BACKTRACE=1 environment variable to display a backtrace
.
[1/2] Assertion for "stdout"
| <[]> expected but was
| <["YJIT: rb_yjit_init_rust() panicked. Aborting."]>.
[2/2] Assertion for "stderr"
| <[]> expected but was
| <["thread '' panicked at 'assertion failed: (left == right)",
| " left: 16384,",
| " right: 0: code page size is not page-aligned', /builddir/build/BUILD/ruby-3.2.0/yjit/src/codegen.rs:7235:13",
| "note: run with RUST_BACKTRACE=1 environment variable to display a backtrace"]>.
Failure:
TestYJIT#test_string_interpolation [/builddir/build/BUILD/ruby-3.2.0/test/ruby/test_yjit.rb:457]:
exited with status 134, stderr:
thread '' panicked at 'assertion failed: (left == right)
left: 16384,
right: 0: code page size is not page-aligned', /builddir/build/BUILD/ruby-3.2.0/yjit/src/codegen.rs:7235:13
note: run with RUST_BACKTRACE=1 environment variable to display a backtrace
Failure:
TestYJIT#test_string_then_nil [/builddir/build/BUILD/ruby-3.2.0/test/ruby/test_yjit.rb:302]:
exited with status 134, stderr:
thread '' panicked at 'assertion failed: (left == right)
left: 16384,
right: 0: code page size is not page-aligned', /builddir/build/BUILD/ruby-3.2.0/yjit/src/codegen.rs:7235:13
note: run with RUST_BACKTRACE=1 environment variable to display a backtrace
I run into this problem on armv8 and the pagesize is 64K.
The page_size of CodeBlock is const 16K, which leads to 16K % 64K = 16K.
YJIT: Use the system page size when the code page size is too small (#7267)
Previously on ARM64 Linux systems that use 64 KiB pages
(CONFIG_ARM64_64K_PAGES=y), YJIT was panicking on boot due to a failed
assertion.
The assertion was making sure that code GC can free the last code page
that YJIT manages without freeing unrelated memory. YJIT prefers picking
16 KiB as the granularity at which to free code memory, but when the
system can only free at 64 KiB granularity, that is not possible.
The fix is to use the system page size as the code page size when the
system page size is 64 KiB. Continue to use 16 KiB as the code page size
on common systems that use 16/4 KiB pages.
Add asserts to code_gc() and free_page() about code GC's assumptions.