Skip to content

ICE when compiling smallvec::SmallVecData<[f64; 4]>::heap_mut #61

Description

@LDemetrios

Hi!

So, as promised, I tried to feed your compiler a big project. And here's a panic:

thread '<unnamed>' panicked at src/lib.rs:1649:9:
failed to lower OOMIR shard canonical-types-9 to JVM bytecode: Function smallvec/SmallVecData_f64Array4::heap_mut: Failed to translate function: VerificationError { context: "Function heap_mut, block bb0, OOMIR instruction 5", message: "Failed to translate InvokeVirtual { dest: Some(\"_1_deref_object\"), class_name: \"org/rustlang/runtime/Pointer\", method_name: \"getObjectAs\", method_ty: Signature { params: [(\"self\", Pointer(Class(\"smallvec/SmallVecData_f64Array4\"))), (\"target_class\", Class(\"java/lang/String\"))], ret: Class(\"java/lang/Object\"), is_static: false }, args: [Constant(String(\"smallvec/SmallVecData_f64Array4\"))], operand: Variable { name: \"_1\", ty: Pointer(Class(\"smallvec/SmallVecData_f64Array4\")) } }: VerificationError { context: \"Function heap_mut\", message: \"could not load deferred pointer for operation getObjectAs\" }" }
stack backtrace:
   0:        0x1094ec0d8 - <std[c8fa24e64d9cf078]::backtrace::Backtrace>::create
   1:        0x1070b6bc4 - std[c8fa24e64d9cf078]::panicking::update_hook::<alloc[211306b2149fe892]::boxed::Box<rustc_driver_impl[6ce72ed364af5ef8]::install_ice_hook::{closure#1}>>::{closure#0}
   2:        0x109500418 - std[c8fa24e64d9cf078]::panicking::panic_with_hook
   3:        0x1094e07d4 - std[c8fa24e64d9cf078]::panicking::panic_handler::{closure#0}
   4:        0x1094d8d50 - std[c8fa24e64d9cf078]::sys::backtrace::__rust_end_short_backtrace::<std[c8fa24e64d9cf078]::panicking::panic_handler::{closure#0}, !>
   5:        0x1094e2040 - __rustc[897652c62be20a70]::rust_begin_unwind
   6:        0x1095e5c78 - core[f1ce509e42dc19ff]::panicking::panic_fmt
   7:        0x10c4d4c58 - rustc_codegen_jvm[d89b58a70c509517]::emit_oomir_shard::{closure#0}
   8:        0x10c3a6274 - rustc_codegen_jvm[d89b58a70c509517]::emit_oomir_shard
   9:        0x10c33a144 - std[c8fa24e64d9cf078]::sys::backtrace::__rust_begin_short_backtrace::<<rustc_codegen_jvm[d89b58a70c509517]::MyBackend as rustc_codegen_ssa[603e0dcf5e1902f0]::traits::backend::CodegenBackend>::codegen_crate::{closure#2}::{closure#0}, ()>
  10:        0x10c3c85b4 - <std[c8fa24e64d9cf078]::thread::lifecycle::spawn_unchecked<<rustc_codegen_jvm[d89b58a70c509517]::MyBackend as rustc_codegen_ssa[603e0dcf5e1902f0]::traits::backend::CodegenBackend>::codegen_crate::{closure#2}::{closure#0}, ()>::{closure#1} as core[f1ce509e42dc19ff]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  11:        0x10950adb0 - <std[c8fa24e64d9cf078]::sys::thread::unix::Thread>::new::thread_start
  12:        0x1860d3c08 - __pthread_cond_wait


rustc version: 1.100.0-nightly (1303417c4 2026-09-21)
platform: aarch64-apple-darwinthread 'rustc' panicked at src/lib.rs:1812:30:
OOMIR shard worker stopped without a result: RecvError
stack backtrace:
   0:        0x1094ec0d8 - <std[c8fa24e64d9cf078]::backtrace::Backtrace>::create
   1:        0x1070b6bc4 - std[c8fa24e64d9cf078]::panicking::update_hook::<alloc[211306b2149fe892]::boxed::Box<rustc_driver_impl[6ce72ed364af5ef8]::install_ice_hook::{closure#1}>>::{closure#0}
   2:        0x109500418 - std[c8fa24e64d9cf078]::panicking::panic_with_hook
   3:        0x1094e07d4 - std[c8fa24e64d9cf078]::panicking::panic_handler::{closure#0}
   4:        0x1094d8d50 - std[c8fa24e64d9cf078]::sys::backtrace::__rust_end_short_backtrace::<std[c8fa24e64d9cf078]::panicking::panic_handler::{closure#0}, !>
   5:        0x1094e2040 - __rustc[897652c62be20a70]::rust_begin_unwind
   6:        0x1095e5c78 - core[f1ce509e42dc19ff]::panicking::panic_fmt
   7:        0x1095e59c4 - core[f1ce509e42dc19ff]::result::unwrap_failed
   8:        0x10c283194 - std[c8fa24e64d9cf078]::thread::scoped::scope::<<rustc_codegen_jvm[d89b58a70c509517]::MyBackend as rustc_codegen_ssa[603e0dcf5e1902f0]::traits::backend::CodegenBackend>::codegen_crate::{closure#2}, alloc[211306b2149fe892]::vec::Vec<(alloc[211306b2149fe892]::string::String, std[c8fa24e64d9cf078]::path::PathBuf)>>
   9:        0x10c3bec30 - <rustc_codegen_jvm[d89b58a70c509517]::MyBackend as rustc_codegen_ssa[603e0dcf5e1902f0]::traits::backend::CodegenBackend>::codegen_crate
  10:        0x107a1e36c - <rustc_interface[a9842193f593845c]::queries::Linker>::codegen_and_build_linker
  11:        0x107048ee0 - rustc_interface[a9842193f593845c]::passes::create_and_enter_global_ctxt::<core[f1ce509e42dc19ff]::option::Option<rustc_interface[a9842193f593845c]::queries::Linker>, rustc_driver_impl[6ce72ed364af5ef8]::run_compiler::{closure#0}::{closure#1}>
  12:        0x1070b5560 - rustc_interface[a9842193f593845c]::interface::run_compiler::<(), rustc_driver_impl[6ce72ed364af5ef8]::run_compiler::{closure#0}>::{closure#2}
  13:        0x1070a6b58 - std[c8fa24e64d9cf078]::sys::backtrace::__rust_begin_short_backtrace::<rustc_interface[a9842193f593845c]::util::run_in_thread_with_globals<rustc_interface[a9842193f593845c]::util::run_in_thread_pool_with_globals<rustc_interface[a9842193f593845c]::interface::run_compiler<(), rustc_driver_impl[6ce72ed364af5ef8]::run_compiler::{closure#0}>::{closure#2}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>
  14:        0x1070ba144 - <std[c8fa24e64d9cf078]::thread::lifecycle::spawn_unchecked<rustc_interface[a9842193f593845c]::util::run_in_thread_with_globals<rustc_interface[a9842193f593845c]::util::run_in_thread_pool_with_globals<rustc_interface[a9842193f593845c]::interface::run_compiler<(), rustc_driver_impl[6ce72ed364af5ef8]::run_compiler::{closure#0}>::{closure#2}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>::{closure#1} as core[f1ce509e42dc19ff]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  15:        0x10950adb0 - <std[c8fa24e64d9cf078]::sys::thread::unix::Thread>::new::thread_start
  16:        0x1860d3c08 - __pthread_cond_wait

query stack during panic:
end of query stack

I couldn't understand what really have happened there, as to my understanding the error message isn't really helpful. Additionally, I found out that parking lot itself compiles cleanly, so it's how it used is the issue.

If you need, I tried compiling https://github.com/LDemetrios/typst-shared-library/tree/shared-lib-v2 . I probably will end up later substituting parking lot dependencies with proper JVM synchronization, but that's gonna be when I understand your compiler better xD

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-lower2Involving the 2nd lowering pass (OOMIR -> JVM)C-BugFunctionality that is claimed to be supported isn't working correctly in certain circumstances.I-ICEIssues causing an ICE in the codegen backendS-In DevelopmentIssue with a contributor actively working on the needed development.

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions