Skip to content

using mold results into panic #123073

Description

@domenkozar

Code

  1. Install Nix: https://devenv.sh/getting-started/#1-install-nix
  2. Install devenv: nix-env -iA devenv -f https://github.com/NixOS/nixpkgs/tarball/476a33c53da66a2a77a89bb9bcf54d5e3c232c3d
  3. git clone https://github.com/cachix/devenv
  4. git checkout rust-mold
  5. devenv shell cargo build

Error output

   Compiling devenv-run-tests v0.1.0 (/home/domen/dev/cachix/devenv/devenv-run-tests)
thread 'rustc' panicked at library/alloc/src/raw_vec.rs:571:5:
capacity overflow
stack backtrace:
   0:     0x7f6e2ef59117 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::hc7227e0e319a0b38
   1:     0x7f6e2ef8f310 - core::fmt::write::hab7a2cb9fb1eea10
   2:     0x7f6e2ef2988f - std::io::Write::write_fmt::h5d9ea37d99fc8ea3
   3:     0x7f6e2ef58ee4 - std::sys_common::backtrace::print::h7ef6b9088506adf3
   4:     0x7f6e2ef59dea - std::panicking::default_hook::{{closure}}::h2be91e085f955e55
   5:     0x7f6e2ef59b13 - std::panicking::default_hook::hd222121dd148ba89
   6:     0x7f6e2f7cc178 - std[6e8b80a297c52f92]::panicking::update_hook::<alloc[994071f8baacd75d]::boxed::Box<rustc_driver_impl[366a67edb31c7905]::install_ice_hook::{closure#0}>>::{closure#0}
   7:     0x7f6e2ef5a548 - std::panicking::rust_panic_with_hook::hcb0f9a863644f6c2
   8:     0x7f6e2ef5a28e - std::panicking::begin_panic_handler::{{closure}}::hb3736c891f535df7
   9:     0x7f6e2ef59346 - std::sys_common::backtrace::__rust_end_short_backtrace::h5c867a2182e2e40a
  10:     0x7f6e2ef5a020 - rust_begin_unwind
  11:     0x7f6e2eefb745 - core::panicking::panic_fmt::h71234a7826c31033
  12:     0x7f6e2ef8463f - alloc::raw_vec::capacity_overflow::h9a6c4730fab6576f
  13:     0x7f6e315fb1cc - <rustc_query_system[66542c44af039fff]::dep_graph::serialized::SerializedDepGraph>::decode::<rustc_middle[8d00abeeb1ff241b]::dep_graph::DepsType>
  14:     0x7f6e315f8c2f - rustc_incremental[eeeac4218b780523]::persist::load::setup_dep_graph
  15:     0x7f6e2f9f8c34 - <rustc_interface[7e6b73ecb68df30f]::queries::Queries>::global_ctxt
  16:     0x7f6e2f79648a - <rustc_interface[7e6b73ecb68df30f]::interface::Compiler>::enter::<rustc_driver_impl[366a67edb31c7905]::run_compiler::{closure#0}::{closure#0}, core[d198b710c259850c]::result::Result<core[d198b710c259850c]::option::Option<rustc_interface[7e6b73ecb68df30f]::queries::Linker>, rustc_span[3e214166d8962b9f]::ErrorGuaranteed>>
  17:     0x7f6e2f77f4cc - rustc_span[3e214166d8962b9f]::set_source_map::<core[d198b710c259850c]::result::Result<(), rustc_span[3e214166d8962b9f]::ErrorGuaranteed>, rustc_interface[7e6b73ecb68df30f]::interface::run_compiler<core[d198b710c259850c]::result::Result<(), rustc_span[3e214166d8962b9f]::ErrorGuaranteed>, rustc_driver_impl[366a67edb31c7905]::run_compiler::{closure#0}>::{closure#0}::{closure#0}>
  18:     0x7f6e2f7bfb9c - <scoped_tls[522fde4e9369c00a]::ScopedKey<rustc_span[3e214166d8962b9f]::SessionGlobals>>::set::<rustc_interface[7e6b73ecb68df30f]::interface::run_compiler<core[d198b710c259850c]::result::Result<(), rustc_span[3e214166d8962b9f]::ErrorGuaranteed>, rustc_driver_impl[366a67edb31c7905]::run_compiler::{closure#0}>::{closure#0}, core[d198b710c259850c]::result::Result<(), rustc_span[3e214166d8962b9f]::ErrorGuaranteed>>
  19:     0x7f6e2f780c61 - rustc_span[3e214166d8962b9f]::create_session_globals_then::<core[d198b710c259850c]::result::Result<(), rustc_span[3e214166d8962b9f]::ErrorGuaranteed>, rustc_interface[7e6b73ecb68df30f]::interface::run_compiler<core[d198b710c259850c]::result::Result<(), rustc_span[3e214166d8962b9f]::ErrorGuaranteed>, rustc_driver_impl[366a67edb31c7905]::run_compiler::{closure#0}>::{closure#0}>
  20:     0x7f6e2f7da290 - std[6e8b80a297c52f92]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[7e6b73ecb68df30f]::util::run_in_thread_with_globals<rustc_interface[7e6b73ecb68df30f]::interface::run_compiler<core[d198b710c259850c]::result::Result<(), rustc_span[3e214166d8962b9f]::ErrorGuaranteed>, rustc_driver_impl[366a67edb31c7905]::run_compiler::{closure#0}>::{closure#0}, core[d198b710c259850c]::result::Result<(), rustc_span[3e214166d8962b9f]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[d198b710c259850c]::result::Result<(), rustc_span[3e214166d8962b9f]::ErrorGuaranteed>>
  21:     0x7f6e2f7cc707 - <<std[6e8b80a297c52f92]::thread::Builder>::spawn_unchecked_<rustc_interface[7e6b73ecb68df30f]::util::run_in_thread_with_globals<rustc_interface[7e6b73ecb68df30f]::interface::run_compiler<core[d198b710c259850c]::result::Result<(), rustc_span[3e214166d8962b9f]::ErrorGuaranteed>, rustc_driver_impl[366a67edb31c7905]::run_compiler::{closure#0}>::{closure#0}, core[d198b710c259850c]::result::Result<(), rustc_span[3e214166d8962b9f]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[d198b710c259850c]::result::Result<(), rustc_span[3e214166d8962b9f]::ErrorGuaranteed>>::{closure#1} as core[d198b710c259850c]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  22:     0x7f6e2ef13f25 - std::sys::unix::thread::Thread::new::thread_start::hdf0ce3dbe0807413
  23:     0x7f6e2ed5a383 - start_thread
  24:     0x7f6e2eddd00c - __clone3
  25:                0x0 - <unknown>

error: the compiler unexpectedly panicked. this is a bug.

note: we would appreciate a bug report: https://github.com/rust-lang/rust/issues/new?labels=C-bug%2C+I-ICE%2C+T-compiler&template=ice.md

note: rustc 1.76.0 (07dca489a 2024-02-04) (built from a source tarball) running on x86_64-unknown-linux-gnu

note: compiler flags: --crate-type bin -C embed-bitcode=no -C debuginfo=2 -C incremental=[REDACTED] -C link-arg=-fuse-ld=/nix/store/6cd7g5a3xr5hgk5304ba05w4j3yf6b6m-mold-wrapper-2.4.1/bin/ld.mold

note: some of the compiler flags provided by cargo are hidden

query stack during panic:
end of query stack
error: could not compile `devenv-run-tests` (bin "devenv-run-tests")
warning: build failed, waiting for other jobs to finish...

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-incr-compArea: Incremental compilationC-bugCategory: This is a bug.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions