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

thread '<unnamed>' panicked at 'The offset must be 19 bits or less.' #308

Closed
Willianvdv opened this issue Jan 25, 2023 · 5 comments · Fixed by ruby/ruby#7227
Closed

thread '<unnamed>' panicked at 'The offset must be 19 bits or less.' #308

Willianvdv opened this issue Jan 25, 2023 · 5 comments · Fixed by ruby/ruby#7227
Labels
bug Something isn't working

Comments

@Willianvdv
Copy link

Willianvdv commented Jan 25, 2023

Hello folks,

While trying YJIT on Ruby 3.2, I get the following error when running a test suite in our project.

thread '<unnamed>' panicked at 'The offset must be 19 bits or less.', ./yjit/src/asm/arm64/mod.rs:220:5
stack backtrace:
   0:     0xffffb76b6074 - std::backtrace_rs::backtrace::libunwind::trace::h8e94cda3a371544e
                               at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library/std/src/../../backtrace/src/backtrace/libunwind.rs:93:5
   1:     0xffffb76b6074 - std::backtrace_rs::backtrace::trace_unsynchronized::h813157bbdde28662
                               at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0xffffb76b6074 - std::sys_common::backtrace::_print_fmt::h34887c448c3eb497
                               at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library/std/src/sys_common/backtrace.rs:65:5
   3:     0xffffb76b6074 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::hf93aabc87608898c
                               at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library/std/src/sys_common/backtrace.rs:44:22
   4:     0xffffb770567c - core::fmt::write::hd85235e6dd4a938a
                               at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library/core/src/fmt/mod.rs:1209:17
   5:     0xffffb76a8898 - std::io::Write::write_fmt::hb4554bbda772d72d
                               at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library/std/src/io/mod.rs:1682:15
   6:     0xffffb76b5e80 - std::sys_common::backtrace::_print::h79b720bdee2b231c
                               at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library/std/src/sys_common/backtrace.rs:47:5
   7:     0xffffb76b5e80 - std::sys_common::backtrace::print::h9cf9c4706df49acb
                               at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library/std/src/sys_common/backtrace.rs:34:9
   8:     0xffffb76b88e0 - std::panicking::default_hook::{{closure}}::hc23880dedf49de0f
                               at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library/std/src/panicking.rs:267:22
   9:     0xffffb76b8624 - std::panicking::default_hook::h7fd63ca96b235b7d
                               at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library/std/src/panicking.rs:286:9
  10:     0xffffb76b9020 - std::panicking::rust_panic_with_hook::h5e3e0b54a2bedbd6
                               at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library/std/src/panicking.rs:688:13
  11:     0xffffb76b8dc0 - std::panicking::begin_panic_handler::{{closure}}::habceb6baa9148946
                               at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library/std/src/panicking.rs:577:13
  12:     0xffffb76b6504 - std::sys_common::backtrace::__rust_end_short_backtrace::h346bfd6236afcab4
                               at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library/std/src/sys_common/backtrace.rs:137:18
  13:     0xffffb76b8b44 - rust_begin_unwind
                               at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library/std/src/panicking.rs:575:5
  14:     0xffffb73aff04 - core::panicking::panic_fmt::h8af736328ba90ade
                               at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library/core/src/panicking.rs:65:14
  15:     0xffffb7679698 - yjit::asm::arm64::bcond::he83334167e14e07e
                               at /usr/src/ruby/yjit/src/asm/arm64/mod.rs:220:5
  16:     0xffffb76574c4 - yjit::asm::CodeBlock::link_labels::h58a153a6534787fd
                               at /usr/src/ruby/yjit/src/asm/mod.rs:519:13
  17:     0xffffb7672988 - yjit::backend::arm64::<impl yjit::backend::ir::Assembler>::compile_with_regs::h1798a15df49f5670
                               at /usr/src/ruby/yjit/src/backend/arm64/mod.rs:1084:13
  18:     0xffffb77286f8 - yjit::backend::ir::Assembler::compile::h74d12decca54c86a
                               at /usr/src/ruby/yjit/src/backend/ir.rs:1124:26
  19:     0xffffb77286f8 - yjit::codegen::gen_entry_prologue::h7a630bd4068f4063
                               at /usr/src/ruby/yjit/src/codegen.rs:624:5
  20:     0xffffb7668750 - yjit::core::gen_entry_point::hea7ef24ef5092118
                               at /usr/src/ruby/yjit/src/core.rs:1573:20
  21:     0xffffb764aca0 - rb_yjit_compile_iseq
                               at /usr/src/ruby/yjit.c:1017:25
  22:     0xffffb760ff48 - jit_exec
                               at /usr/src/ruby/vm.c:433:18
  23:     0xffffb76283e0 - vm_sendish
                               at /usr/src/ruby/vm_insnhelper.c:5105:12
  24:     0xffffb76283e0 - vm_exec_core
                               at /usr/src/ruby/insns.def:922:11
  25:     0xffffb762ba30 - rb_vm_exec
                               at /usr/src/ruby/vm.c:2374:22
  26:     0xffffb7633618 - vm_call0_cc
                               at /usr/src/ruby/vm_eval.c:87:12
  27:     0xffffb7633618 - rb_call0
                               at /usr/src/ruby/vm_eval.c:551:12
  28:     0xffffb7633bf8 - send_internal
                               at /usr/src/ruby/vm_eval.c:1262:11
  29:     0xffffb7616ee0 - vm_call_cfunc_with_frame
                               at /usr/src/ruby/vm_insnhelper.c:3252:12
  30:     0xffffb762663c - vm_sendish
                               at /usr/src/ruby/vm_insnhelper.c:5064:15
  31:     0xffffb762663c - vm_exec_core
                               at /usr/src/ruby/insns.def:820:11
  32:     0xffffb762ba30 - rb_vm_exec
                               at /usr/src/ruby/vm.c:2374:22
  33:     0xffffb7478ab8 - each_pair_i_fast
                               at /usr/src/ruby/hash.c:3146:5
  34:     0xffffb7479f78 - hash_foreach_iter
                               at /usr/src/ruby/hash.c:1387:19
  35:     0xffffb75a18a8 - st_general_foreach
                               at /usr/src/ruby/st.c:1484:19
  36:     0xffffb75a18a8 - rb_st_foreach_check
                               at /usr/src/ruby/st.c:1589:12
  37:     0xffffb747c1b4 - hash_foreach_call
                               at /usr/src/ruby/hash.c:1510:15
  38:     0xffffb7450a90 - rb_ensure
                               at /usr/src/ruby/eval.c:1007:19
  39:     0xffffb747f8c0 - rb_hash_foreach
                               at /usr/src/ruby/hash.c:1534:9
  40:     0xffffb747f8c0 - rb_hash_foreach
                               at /usr/src/ruby/hash.c:1520:1
  41:     0xffffb74804d0 - rb_hash_each_pair
                               at /usr/src/ruby/hash.c:3183:9
  42:     0xffffb74804d0 - rb_hash_each_pair
                               at /usr/src/ruby/hash.c:3179:1
  43:     0xffffb8192860 - <unknown>
fatal runtime error: failed to initiate panic, error 498925120

I only get this issue when running a big set of specs (which takes a while). I tried to reproduce with a smaller test set but the same error is not raised.

Can you advise me on how to debug this issue?

@Willianvdv Willianvdv changed the title thread '<unnamed>' panicked at 'The offset must be 19 bits or less.', ./yjit/src/asm/arm64/mod.rs:220:5 thread '<unnamed>' panicked at 'The offset must be 19 bits or less.' Jan 25, 2023
@maximecb maximecb added the bug Something isn't working label Jan 30, 2023
@maximecb
Copy link
Contributor

maximecb commented Jan 31, 2023

Hi William. Apologies for the delayed response. Just wanted to say that we've seen this issue.

It may be slightly difficult for us to debug since we don't have access to your tests though. Do you have access to gdb or lldb, and is there any chance you'd be willing to pair program with one of our developers if possible?

@Willianvdv
Copy link
Author

@maximecb no problem, I'm happy to pair on this issue! Feel free to send me an email at willian@hackerone.com to plan something.

@maximecb
Copy link
Contributor

Good news. Alan Wu found a repro for the bug and we'll be working on a fix. Should hopefully be resolved in the next couple of days :)

@Willianvdv
Copy link
Author

Thanks @XrXr and @maximecb for getting this fixed! If I want to try this, should I be building Ruby 3.2 from source? Or wait for a 3.2.1 release?

@XrXr
Copy link
Contributor

XrXr commented Feb 6, 2023

If I want to try this, should I be building Ruby 3.2 from source? Or wait for a 3.2.1 release?

Both are valid options :). The 3.2 branch is here: https://github.com/ruby/ruby/tree/ruby_3_2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants