Skip to content

ZJIT: Panic: index out of bounds: the len is 22 but the index is 28 (x86_64) #646

@st0012

Description

@st0012

Ubuntu panic

thread '<unnamed>' panicked at zjit/src/backend/x86_64/mod.rs:248:43:
  index out of bounds: the len is 22 but the index is 28
  stack backtrace:
     0: rust_begin_unwind
               at /rustc/4d91de4e48198da2e33413efdcd9cd2cc0c46688/library/std/src/panicking.rs:692:5
     1: core::panicking::panic_fmt
               at /rustc/4d91de4e48198da2e33413efdcd9cd2cc0c46688/library/core/src/panicking.rs:75:14
     2: core::panicking::panic_bounds_check
               at /rustc/4d91de4e48198da2e33413efdcd9cd2cc0c46688/library/core/src/panicking.rs:273:5
     3: <usize as core::slice::index::SliceIndex<[T]>>::index
               at /rustc/4d91de4e48198da2e33413efdcd9cd2cc0c46688/library/core/src/slice/index.rs:274:10
     4: core::slice::index::<impl core::ops::index::Index<I> for [T]>::index
               at /rustc/4d91de4e48198da2e33413efdcd9cd2cc0c46688/library/core/src/slice/index.rs:16:9
     5: <alloc::vec::Vec<T,A> as core::ops::index::Index<I>>::index
               at /rustc/4d91de4e48198da2e33413efdcd9cd2cc0c46688/library/alloc/src/vec/mod.rs:3361:9
     6: zjit::backend::x86_64::<impl zjit::backend::lir::Assembler>::x86_split
               at /home/runner/work/ruby/ruby/src/zjit/src/backend/x86_64/mod.rs:248:43
     7: zjit::backend::x86_64::<impl zjit::backend::lir::Assembler>::compile_with_regs
               at /home/runner/work/ruby/ruby/src/zjit/src/backend/x86_64/mod.rs:834:19
     8: zjit::backend::lir::Assembler::compile
               at /home/runner/work/ruby/ruby/src/zjit/src/backend/lir.rs:1784:19
     9: zjit::codegen::gen_function
               at /home/runner/work/ruby/ruby/src/zjit/src/codegen.rs:258:5
    10: zjit::codegen::gen_iseq_entry_point_body
               at /home/runner/work/ruby/ruby/src/zjit/src/codegen.rs:122:47
    11: zjit::codegen::gen_iseq_entry_point
               at /home/runner/work/ruby/ruby/src/zjit/src/codegen.rs:[103](https://github.com/ruby/ruby/actions/runs/16354950926/job/46210883252?pr=13942#step:16:104):20
    12: zjit::codegen::rb_zjit_iseq_gen_entry_point::{{closure}}
               at /home/runner/work/ruby/ruby/src/zjit/src/codegen.rs:87:9
    13: std::panicking::try::do_call

Reproduction (Ubuntu)

(Assuming ruby#13942 is merged)

make test-all RUST_BACKTRACE=1 RUN_OPTS='--zjit-call-threshold=1' TESTS='../test/ruby/test_fixnum.rb'

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions