Skip to content

Unable to fetch cargo metadata with enabled parallel frontend on 1.76.0-nightly (9fad68599 2023-12-03) #118599

@Gordon-F

Description

@Gordon-F

I tried this code:

  1. Download source https://github.com/NiklasEi/bevy_game_template/tree/5f7dbc2b1fccd3fbc6b6c08eed9b82f6b9a57985
  2. Add cargo config:
[target.x86_64-unknown-linux-gnu]
linker = "clang"
rustflags = [
    "-Clink-arg=-fuse-ld=mold",
    "-Zshare-generics=y",
    "-Zthreads=8"]

[target.x86_64-apple-darwin]
rustflags = [
    "-C",
    "link-arg=-fuse-ld=/usr/local/opt/llvm/bin/ld64.lld",
    "-Zshare-generics=y",
    "-Zthreads=8"
]

[target.aarch64-apple-darwin]
rustflags = [
    "-C",
    "link-arg=-fuse-ld=/opt/homebrew/opt/llvm/bin/ld64.lld",
    "-Zshare-generics=y",
    "-Zthreads=8"
]

[target.x86_64-pc-windows-msvc]
linker = "rust-lld.exe"
rustflags = ["-Zshare-generics=n", "-Zthreads=8"]
  1. Run cargo metadata --verbose --format-version 1 --all-features --filter-platform x86_64-unknown-linux-gnu

I expected to see this happen: metadata json

Instead, this happened: ICE

Meta

rustc --version --verbose:

rustc 1.76.0-nightly (9fad68599 2023-12-03)
binary: rustc
commit-hash: 9fad6859925b34f9a0b1af592a7839ccb1e71f60
commit-date: 2023-12-03
host: x86_64-unknown-linux-gnu
release: 1.76.0-nightly
LLVM version: 17.0.5

Full stacktrace here.

Backtrace

error: failed to run `rustc` to learn about target-specific information

Caused by:
  process didn't exit successfully: `sccache /home/devuser/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/bin/rustc - --crate-name ___ --print=file-names -C link-arg=-fuse-ld=mold -Clink-arg=-fuse-ld=mold -Zshare-generics=y -Zthreads=8 --target x86_64-unknown-linux-gnu --crate-type bin --crate-type rlib --crate-type dylib --crate-type cdylib --crate-type staticlib --crate-type proc-macro --print=sysroot --print=split-debuginfo --print=crate-name --print=cfg` (exit status: 2)
  --- stdout
  sccache: Compile terminated by signal 6

  --- stderr
  thread 'thread 'rustcrustc' panicked at ' panicked at compiler/rustc_data_structures/src/jobserver.rscompiler/rustc_data_structures/src/jobserver.rs::7373::3333:
  :
  jobserver check should have been called earlierjobserver check should have been called earlier

  stack backtrace:
  thread 'rustc' panicked at compiler/rustc_data_structures/src/jobserver.rs:73:33:
  jobserver check should have been called earlier
  thread 'rustc' panicked at compiler/rustc_data_structures/src/jobserver.rs:73:33:
  jobserver check should have been called earlier
  thread 'rustc' panicked at compiler/rustc_data_structures/src/jobserver.rs:73:33:
  jobserver check should have been called earlier
  thread 'main' panicked at compiler/rustc_data_structures/src/jobserver.rs:77:33:
  jobserver check should have been called earlier
  thread 'rustc' panicked at compiler/rustc_data_structures/src/jobserver.rs:73:33:
  jobserver check should have been called earlier
  thread 'rustc' panicked at compiler/rustc_data_structures/src/jobserver.rs:73:33:
  jobserver check should have been called earlier
  thread 'rustc' panicked at compiler/rustc_data_structures/src/jobserver.rs:73:33:
  jobserver check should have been called earlier
     0:     0x7fbe35f7050c - std::backtrace_rs::backtrace::libunwind::trace::h6061033325ca8d5f
                                 at /rustc/9fad6859925b34f9a0b1af592a7839ccb1e71f60/library/std/src/../../backtrace/src/backtrace/libunwind.rs:104:5
     1:     0x7fbe35f7050c - std::backtrace_rs::backtrace::trace_unsynchronized::h3e9a48c0c4a79b3a
                                 at /rustc/9fad6859925b34f9a0b1af592a7839ccb1e71f60/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
     2:     0x7fbe35f7050c - std::sys_common::backtrace::_print_fmt::h985d7a9b6e153b96
                                 at /rustc/9fad6859925b34f9a0b1af592a7839ccb1e71f60/library/std/src/sys_common/backtrace.rs:68:5
     3:     0x7fbe35f7050c - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::hcaf5c0187bbeca0c
                                 at /rustc/9fad6859925b34f9a0b1af592a7839ccb1e71f60/library/std/src/sys_common/backtrace.rs:44:22
     4:     0x7fbe35fc3540 - core::fmt::rt::Argument::fmt::h5f37de5ff02bcb40
                                 at /rustc/9fad6859925b34f9a0b1af592a7839ccb1e71f60/library/core/src/fmt/rt.rs:142:9
     5:     0x7fbe35fc3540 - core::fmt::write::hc8bf769fed76ea64
                                 at /rustc/9fad6859925b34f9a0b1af592a7839ccb1e71f60/library/core/src/fmt/mod.rs:1120:17
     6:     0x7fbe35f6436f - std::io::Write::write_fmt::h114ebebf8c9b16a9
                                 at /rustc/9fad6859925b34f9a0b1af592a7839ccb1e71f60/library/std/src/io/mod.rs:1810:15
     7:     0x7fbe35f702f4 - std::sys_common::backtrace::_print::h898ca07f2a79c2cd
                                 at /rustc/9fad6859925b34f9a0b1af592a7839ccb1e71f60/library/std/src/sys_common/backtrace.rs:47:5
     8:     0x7fbe35f702f4 - std::sys_common::backtrace::print::h4b2c3082b37331f3
                                 at /rustc/9fad6859925b34f9a0b1af592a7839ccb1e71f60/library/std/src/sys_common/backtrace.rs:34:9
     9:     0x7fbe35f72f87 - std::panicking::default_hook::{{closure}}::hc9ef7d8adff7b1f3
    10:     0x7fbe35f72cef - std::panicking::default_hook::h0b53001e401c6ada
                                 at /rustc/9fad6859925b34f9a0b1af592a7839ccb1e71f60/library/std/src/panicking.rs:292:9
    11:     0x7fbe32ceaf90 - std[ca116cedd296397e]::panicking::update_hook::<alloc[f7f5c0c53ccdabe6]::boxed::Box<rustc_driver_impl[4e1279a210f875d1]::install_ice_hook::{closure#0}>>::{closure#0}
    12:     0x7fbe35f736c8 - <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call::h2e3061dd490aba0e
                                 at /rustc/9fad6859925b34f9a0b1af592a7839ccb1e71f60/library/alloc/src/boxed.rs:2021:9
    13:     0x7fbe35f736c8 - std::panicking::rust_panic_with_hook::ha3012055304d5173
                                 at /rustc/9fad6859925b34f9a0b1af592a7839ccb1e71f60/library/std/src/panicking.rs:783:13
    14:     0x7fbe35f7341e - std::panicking::begin_panic_handler::{{closure}}::h02b6031bba5f51a7
                                 at /rustc/9fad6859925b34f9a0b1af592a7839ccb1e71f60/library/std/src/panicking.rs:657:13
    15:     0x7fbe35f709d6 - std::sys_common::backtrace::__rust_end_short_backtrace::hbe288a9d366b23ce
                                 at /rustc/9fad6859925b34f9a0b1af592a7839ccb1e71f60/library/std/src/sys_common/backtrace.rs:171:18
    16:     0x7fbe35f73182 - rust_begin_unwind
                                 at /rustc/9fad6859925b34f9a0b1af592a7839ccb1e71f60/library/std/src/panicking.rs:645:5
    17:     0x7fbe35fbfc15 - core::panicking::panic_fmt::h52558bfe023b0e56
                                 at /rustc/9fad6859925b34f9a0b1af592a7839ccb1e71f60/library/core/src/panicking.rs:72:14
    18:     0x7fbe35fbf9c3 - core::panicking::panic_display::hef3841c9df83bc38
                                 at /rustc/9fad6859925b34f9a0b1af592a7839ccb1e71f60/library/core/src/panicking.rs:193:5
    19:     0x7fbe35fbf9c3 - core::panicking::panic_str::h8fb4c8aeec0299be
                                 at /rustc/9fad6859925b34f9a0b1af592a7839ccb1e71f60/library/core/src/panicking.rs:168:5
    20:     0x7fbe35fbf9c3 - core::option::expect_failed::hd60cb7c60936bb3a
                                 at /rustc/9fad6859925b34f9a0b1af592a7839ccb1e71f60/library/core/src/option.rs:1980:5
    21:     0x7fbe32cc65fb - rustc_data_structures[352089fef12d5cf6]::jobserver::acquire_thread
    22:     0x7fbe328ee582 - <rayon_core[387b610b1c020375]::registry::ThreadBuilder>::run
    23:     0x7fbe32ced3b7 - <<crossbeam_utils[96c2e0db14eff34e]::thread::ScopedThreadBuilder>::spawn<<rayon_core[387b610b1c020375]::ThreadPoolBuilder>::build_scoped<rustc_interface[de342c667529d873]::util::run_in_thread_pool_with_globals<rustc_interface[de342c667529d873]::interface::run_compiler<core[c0bc3e49ab39a50c]::result::Result<(), rustc_span[eae331e1b7d19547]::ErrorGuaranteed>, rustc_driver_impl[4e1279a210f875d1]::run_compiler::{closure#0}>::{closure#0}, core[c0bc3e49ab39a50c]::result::Result<(), rustc_span[eae331e1b7d19547]::ErrorGuaranteed>>::{closure#3}::{closure#0}::{closure#0}, rustc_interface[de342c667529d873]::util::run_in_thread_pool_with_globals<rustc_interface[de342c667529d873]::interface::run_compiler<core[c0bc3e49ab39a50c]::result::Result<(), rustc_span[eae331e1b7d19547]::ErrorGuaranteed>, rustc_driver_impl[4e1279a210f875d1]::run_compiler::{closure#0}>::{closure#0}, core[c0bc3e49ab39a50c]::result::Result<(), rustc_span[eae331e1b7d19547]::ErrorGuaranteed>>::{closure#3}::{closure#0}::{closure#1}, core[c0bc3e49ab39a50c]::result::Result<(), rustc_span[eae331e1b7d19547]::ErrorGuaranteed>>::{closure#0}::{closure#0}::{closure#0}, ()>::{closure#0} as core[c0bc3e49ab39a50c]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
    24:     0x7fbe32ce66be - std[ca116cedd296397e]::sys_common::backtrace::__rust_begin_short_backtrace::<alloc[f7f5c0c53ccdabe6]::boxed::Box<dyn core[c0bc3e49ab39a50c]::ops::function::FnOnce<(), Output = ()> + core[c0bc3e49ab39a50c]::marker::Send>, ()>
    25:     0x7fbe32ced043 - <<std[ca116cedd296397e]::thread::Builder>::spawn_unchecked_<alloc[f7f5c0c53ccdabe6]::boxed::Box<dyn core[c0bc3e49ab39a50c]::ops::function::FnOnce<(), Output = ()> + core[c0bc3e49ab39a50c]::marker::Send>, ()>::{closure#1} as core[c0bc3e49ab39a50c]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
    26:     0x7fbe35f7d555 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::hd1c6f093d833cd0b
                                 at /rustc/9fad6859925b34f9a0b1af592a7839ccb1e71f60/library/alloc/src/boxed.rs:2007:9
    27:     0x7fbe35f7d555 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::hc0da20453235ce5e
                                 at /rustc/9fad6859925b34f9a0b1af592a7839ccb1e71f60/library/alloc/src/boxed.rs:2007:9
    28:     0x7fbe35f7d555 - std::sys::unix::thread::Thread::new::thread_start::he4d6253d6192e596
                                 at /rustc/9fad6859925b34f9a0b1af592a7839ccb1e71f60/library/std/src/sys/unix/thread.rs:108:17
    29:     0x7fbe2feaa9eb - <unknown>
    30:     0x7fbe2ff2e7cc - <unknown>
    31:                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: please attach the file at `/home/devuser/Dev/RustProjects/bevy_game_template/rustc-ice-2023-12-04T10_43_06-21190.txt` to your bug report

  note: compiler flags: -C link-arg=-fuse-ld=mold -C link-arg=-fuse-ld=mold -Z share-generics=y -Z threads=8 --crate-type bin --crate-type rlib --crate-type dylib --crate-type cdylib --crate-type staticlib --crate-type proc-macro

  query stack during panic:
  end of query stack
  Rayon: detected unexpected panic; aborting

If you comment out the parallel front end setting in config.tom, everything will work as expected:

[target.x86_64-unknown-linux-gnu]
linker = "clang"
rustflags = [
    "-Clink-arg=-fuse-ld=mold",
    "-Zshare-generics=y",
    #"-Zthreads=8"
]

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: This is a bug.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions