rust-lang / rust

Empowering everyone to build reliable and efficient software.
https://www.rust-lang.org
Other
96.77k stars 12.5k forks source link

Attempted to read from stolen value error #111319

Open jthulhu opened 1 year ago

jthulhu commented 1 year ago

Code

The code can be found at https://git.eleves.ens.fr/jcaspar/nicos/-/tree/filesystem, at commit 7d450c48843ca9978f2ea60a77bec88211381677, however I couldn't reproduce after removing the target directory, so I guess this is related to incremental compilation and not to the code itself.

I have kept the target directory as an archive, but it's quite heavy (~100M) so I didn't upload it on the git repo. If you are interested in that archive, tell me and I'll find a way to upload it somewhere else and give you a link.

Also note that, even with the right target directory, I could only trigger this bug with a normal build, not with a release build.

Meta

rustc --version --verbose:

rustc 1.68.0-nightly (d6f99e535 2023-01-02)
binary: rustc
commit-hash: d6f99e535a301a421dfee52a7c25bb4bdf420344
commit-date: 2023-01-02
host: x86_64-unknown-linux-gnu
release: 1.68.0-nightly
LLVM version: 15.0.6

Error output

thread 'rustc' panicked at 'attempted to read from stolen value: rustc_middle::mir::Body', compiler/rustc_mir_transform/src/check_unsafety.rs:501:36
stack backtrace:
   0:     0x7f16287652ba - std::backtrace_rs::backtrace::libunwind::trace::h63336ecdb3bad04b
                               at /rustc/d6f99e535a301a421dfee52a7c25bb4bdf420344/library/std/src/../../backtrace/src/backtrace/libunwind.rs:93:5
   1:     0x7f16287652ba - std::backtrace_rs::backtrace::trace_unsynchronized::he3a8c5861faa8ce5
                               at /rustc/d6f99e535a301a421dfee52a7c25bb4bdf420344/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x7f16287652ba - std::sys_common::backtrace::_print_fmt::h6720fb1a10e43309
                               at /rustc/d6f99e535a301a421dfee52a7c25bb4bdf420344/library/std/src/sys_common/backtrace.rs:65:5
   3:     0x7f16287652ba - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h48bca0897c339d00
                               at /rustc/d6f99e535a301a421dfee52a7c25bb4bdf420344/library/std/src/sys_common/backtrace.rs:44:22
   4:     0x7f16287c83be - core::fmt::write::hf9f58db26479ade9
                               at /rustc/d6f99e535a301a421dfee52a7c25bb4bdf420344/library/core/src/fmt/mod.rs:1208:17
   5:     0x7f1628755765 - std::io::Write::write_fmt::h12a31f1c80b570e7
                               at /rustc/d6f99e535a301a421dfee52a7c25bb4bdf420344/library/std/src/io/mod.rs:1682:15
   6:     0x7f1628765085 - std::sys_common::backtrace::_print::hdbaa477a95e75642
                               at /rustc/d6f99e535a301a421dfee52a7c25bb4bdf420344/library/std/src/sys_common/backtrace.rs:47:5
   7:     0x7f1628765085 - std::sys_common::backtrace::print::h7c8b0abb49f271cd
                               at /rustc/d6f99e535a301a421dfee52a7c25bb4bdf420344/library/std/src/sys_common/backtrace.rs:34:9
   8:     0x7f1628767e4f - std::panicking::default_hook::{{closure}}::h1797033e1ed70a4e
                               at /rustc/d6f99e535a301a421dfee52a7c25bb4bdf420344/library/std/src/panicking.rs:267:22
   9:     0x7f1628767b8b - std::panicking::default_hook::hb3d6fe26ba7504d8
                               at /rustc/d6f99e535a301a421dfee52a7c25bb4bdf420344/library/std/src/panicking.rs:286:9
  10:     0x7f162ba3fd44 - <rustc_driver[8be1598210413b33]::DEFAULT_HOOK::{closure#0}::{closure#0} as core[7ff1f80559238851]::ops::function::FnOnce<(&core[7ff1f80559238851]::panic::panic_info::PanicInfo,)>>::call_once::{shim:vtable#0}
  11:     0x7f162876868d - <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call::h4a6520846f8dc7bd
                               at /rustc/d6f99e535a301a421dfee52a7c25bb4bdf420344/library/alloc/src/boxed.rs:2002:9
  12:     0x7f162876868d - std::panicking::rust_panic_with_hook::h6977f8300f810150
                               at /rustc/d6f99e535a301a421dfee52a7c25bb4bdf420344/library/std/src/panicking.rs:692:13
  13:     0x7f1628768409 - std::panicking::begin_panic_handler::{{closure}}::h2998430db00ab632
                               at /rustc/d6f99e535a301a421dfee52a7c25bb4bdf420344/library/std/src/panicking.rs:579:13
  14:     0x7f162876576c - std::sys_common::backtrace::__rust_end_short_backtrace::hb91fb6f55cc300a4
                               at /rustc/d6f99e535a301a421dfee52a7c25bb4bdf420344/library/std/src/sys_common/backtrace.rs:137:18
  15:     0x7f1628768112 - rust_begin_unwind
                               at /rustc/d6f99e535a301a421dfee52a7c25bb4bdf420344/library/std/src/panicking.rs:575:5
  16:     0x7f16287c4da3 - core::panicking::panic_fmt::h4d2929ac8958f22d
                               at /rustc/d6f99e535a301a421dfee52a7c25bb4bdf420344/library/core/src/panicking.rs:64:14
  17:     0x7f162a294164 - rustc_mir_transform[e0ceb31cae4d126]::check_unsafety::unsafety_check_result
  18:     0x7f162a293735 - <rustc_mir_transform[e0ceb31cae4d126]::check_unsafety::provide::{closure#0} as core[7ff1f80559238851]::ops::function::FnOnce<(rustc_middle[826004897f5d0702]::ty::context::TyCtxt, rustc_span[eee94698d303490b]::def_id::LocalDefId)>>::call_once
  19:     0x7f162c3cbcb4 - <rustc_middle[826004897f5d0702]::dep_graph::dep_node::DepKind as rustc_query_system[f966af2134b81d67]::dep_graph::DepKind>::with_deps::<rustc_query_system[f966af2134b81d67]::query::plumbing::try_load_from_disk_and_cache_in_memory<rustc_query_impl[949cbd89f0df975a]::queries::unsafety_check_result, rustc_query_impl[949cbd89f0df975a]::plumbing::QueryCtxt>::{closure#1}, &rustc_middle[826004897f5d0702]::mir::query::UnsafetyCheckResult>
  20:     0x7f162a714ade - rustc_query_system[f966af2134b81d67]::query::plumbing::try_load_from_disk_and_cache_in_memory::<rustc_query_impl[949cbd89f0df975a]::queries::unsafety_check_result, rustc_query_impl[949cbd89f0df975a]::plumbing::QueryCtxt>
  21:     0x7f162a713b0d - rustc_query_system[f966af2134b81d67]::query::plumbing::try_execute_query::<rustc_query_impl[949cbd89f0df975a]::queries::unsafety_check_result, rustc_query_impl[949cbd89f0df975a]::plumbing::QueryCtxt>
  22:     0x7f162b409f04 - <rustc_query_impl[949cbd89f0df975a]::Queries as rustc_middle[826004897f5d0702]::ty::query::QueryEngine>::unsafety_check_result
  23:     0x7f1629f0ba82 - rustc_mir_transform[e0ceb31cae4d126]::check_unsafety::check_unsafety
  24:     0x7f1629f0adb4 - <rustc_session[f986e2fc2eb399bc]::session::Session>::time::<(), rustc_interface[1f30c620a2179fec]::passes::analysis::{closure#3}>
  25:     0x7f1629f06abe - rustc_interface[1f30c620a2179fec]::passes::analysis
  26:     0x7f162b19bee6 - <rustc_query_system[f966af2134b81d67]::dep_graph::graph::DepGraph<rustc_middle[826004897f5d0702]::dep_graph::dep_node::DepKind>>::with_task::<rustc_middle[826004897f5d0702]::ty::context::TyCtxt, (), core[7ff1f80559238851]::result::Result<(), rustc_errors[354c2efffe60ff2a]::ErrorGuaranteed>>
  27:     0x7f162b19b0a1 - rustc_query_system[f966af2134b81d67]::query::plumbing::try_execute_query::<rustc_query_impl[949cbd89f0df975a]::queries::analysis, rustc_query_impl[949cbd89f0df975a]::plumbing::QueryCtxt>
  28:     0x7f162b40631a - <rustc_query_impl[949cbd89f0df975a]::Queries as rustc_middle[826004897f5d0702]::ty::query::QueryEngine>::analysis
  29:     0x7f162accc703 - <rustc_interface[1f30c620a2179fec]::passes::QueryContext>::enter::<rustc_driver[8be1598210413b33]::run_compiler::{closure#1}::{closure#2}::{closure#2}, core[7ff1f80559238851]::result::Result<(), rustc_errors[354c2efffe60ff2a]::ErrorGuaranteed>>
  30:     0x7f162acc77f4 - rustc_span[eee94698d303490b]::with_source_map::<core[7ff1f80559238851]::result::Result<(), rustc_errors[354c2efffe60ff2a]::ErrorGuaranteed>, rustc_interface[1f30c620a2179fec]::interface::run_compiler<core[7ff1f80559238851]::result::Result<(), rustc_errors[354c2efffe60ff2a]::ErrorGuaranteed>, rustc_driver[8be1598210413b33]::run_compiler::{closure#1}>::{closure#0}::{closure#0}>
  31:     0x7f162acbfb25 - <scoped_tls[5561f9902316343e]::ScopedKey<rustc_span[eee94698d303490b]::SessionGlobals>>::set::<rustc_interface[1f30c620a2179fec]::interface::run_compiler<core[7ff1f80559238851]::result::Result<(), rustc_errors[354c2efffe60ff2a]::ErrorGuaranteed>, rustc_driver[8be1598210413b33]::run_compiler::{closure#1}>::{closure#0}, core[7ff1f80559238851]::result::Result<(), rustc_errors[354c2efffe60ff2a]::ErrorGuaranteed>>
  32:     0x7f162acbf112 - std[5af4ca9a55fdc83a]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[1f30c620a2179fec]::util::run_in_thread_pool_with_globals<rustc_interface[1f30c620a2179fec]::interface::run_compiler<core[7ff1f80559238851]::result::Result<(), rustc_errors[354c2efffe60ff2a]::ErrorGuaranteed>, rustc_driver[8be1598210413b33]::run_compiler::{closure#1}>::{closure#0}, core[7ff1f80559238851]::result::Result<(), rustc_errors[354c2efffe60ff2a]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[7ff1f80559238851]::result::Result<(), rustc_errors[354c2efffe60ff2a]::ErrorGuaranteed>>
  33:     0x7f162acbeeba - <<std[5af4ca9a55fdc83a]::thread::Builder>::spawn_unchecked_<rustc_interface[1f30c620a2179fec]::util::run_in_thread_pool_with_globals<rustc_interface[1f30c620a2179fec]::interface::run_compiler<core[7ff1f80559238851]::result::Result<(), rustc_errors[354c2efffe60ff2a]::ErrorGuaranteed>, rustc_driver[8be1598210413b33]::run_compiler::{closure#1}>::{closure#0}, core[7ff1f80559238851]::result::Result<(), rustc_errors[354c2efffe60ff2a]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[7ff1f80559238851]::result::Result<(), rustc_errors[354c2efffe60ff2a]::ErrorGuaranteed>>::{closure#1} as core[7ff1f80559238851]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  34:     0x7f1628772b43 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h61f61231edf9a6d9
                               at /rustc/d6f99e535a301a421dfee52a7c25bb4bdf420344/library/alloc/src/boxed.rs:1988:9
  35:     0x7f1628772b43 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h1c78fbbf2ddb4167
                               at /rustc/d6f99e535a301a421dfee52a7c25bb4bdf420344/library/alloc/src/boxed.rs:1988:9
  36:     0x7f1628772b43 - std::sys::unix::thread::Thread::new::thread_start::hd8b08a93cd21b34f
                               at /rustc/d6f99e535a301a421dfee52a7c25bb4bdf420344/library/std/src/sys/unix/thread.rs:108:17
  37:     0x7f1628488e86 - start_thread
  38:     0x7f162850fce0 - clone3
  39:                0x0 - <unknown>

error: internal compiler error: unexpected panic

note: 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.68.0-nightly (d6f99e535 2023-01-02) running on x86_64-unknown-linux-gnu

note: compiler flags: --crate-type bin -C embed-bitcode=no -C debuginfo=2 -C incremental=[REDACTED]

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

query stack during panic:
#0 [unsafety_check_result] unsafety-checking `_::__BOOTLOADER_CONFIG::{constant#0}`
#1 [analysis] running analysis passes on this crate
end of query stack
Backtrace

```thread 'rustc' panicked at 'attempted to read from stolen value: rustc_middle::mir::Body', compiler/rustc_mir_transform/src/check_unsafety.rs:501:36 stack backtrace: 0: rust_begin_unwind at /rustc/d6f99e535a301a421dfee52a7c25bb4bdf420344/library/std/src/panicking.rs:575:5 1: core::panicking::panic_fmt at /rustc/d6f99e535a301a421dfee52a7c25bb4bdf420344/library/core/src/panicking.rs:64:14 2: rustc_mir_transform::check_unsafety::unsafety_check_result 3: >::call_once 4: ::with_deps::::{closure#1}, &rustc_middle::mir::query::UnsafetyCheckResult> 5: rustc_query_system::query::plumbing::try_load_from_disk_and_cache_in_memory:: 6: rustc_query_system::query::plumbing::try_execute_query:: 7: ::unsafety_check_result 8: rustc_mir_transform::check_unsafety::check_unsafety 9: ::time::<(), rustc_interface::passes::analysis::{closure#3}> 10: rustc_interface::passes::analysis 11: >::with_task::> 12: rustc_query_system::query::plumbing::try_execute_query:: 13: ::analysis 14: ::enter::> 15: rustc_span::with_source_map::, rustc_interface::interface::run_compiler, rustc_driver::run_compiler::{closure#1}>::{closure#0}::{closure#0}> 16: >::set::, rustc_driver::run_compiler::{closure#1}>::{closure#0}, core::result::Result<(), rustc_errors::ErrorGuaranteed>> note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace. ```

mtsoltan commented 1 year ago

I'm not sure this is relevant (I hope it is), I tried cloning and building this specific commit on 1.71.0-nightly and got a different ICE:

cargo --version --verbose
cargo 1.71.0-nightly (569b648b5 2023-05-05)
release: 1.71.0-nightly
commit-hash: 569b648b5831ae8a515e90c80843a5287c3304ef
commit-date: 2023-05-05
host: x86_64-unknown-linux-gnu
libgit2: 1.6.3 (sys:0.17.0 vendored)
libcurl: 8.0.1-DEV (sys:0.4.61+curl-8.0.1 vendored ssl:OpenSSL/1.1.1t)
ssl: OpenSSL 1.1.1t  7 Feb 2023
os: Ubuntu 20.04 (focal) [64-bit]
rustc --version --verbose
rustc 1.71.0-nightly (2f2c438dc 2023-05-08)
binary: rustc
commit-hash: 2f2c438dce75d8cc532c3baa849eeddc0901802c
commit-date: 2023-05-08
host: x86_64-unknown-linux-gnu
release: 1.71.0-nightly
LLVM version: 16.0.2
RUST_BACKTRACE=full cargo build
Command output with ICE ``` Compiling bootloader v0.11.0 warning: unused import: `println` --> kernel/src/hardware/harddisk.rs:11:29 | 11 | use crate::{serial_println, println, error::{Result, err}}; | ^^^^^^^ | = note: `#[warn(unused_imports)]` on by default warning: unused import: `println` --> kernel/src/process.rs:6:13 | 6 | use crate::{println, serial_println}; | ^^^^^^^ warning: unused imports: `BiosParameterBlock`, `Metadata` --> kernel/src/fs/fat.rs:3:15 | 3 | raw_fat::{BiosParameterBlock, Metadata, Name}, | ^^^^^^^^^^^^^^^^^^ ^^^^^^^^ warning: unused import: `Readable` --> kernel/src/fs/fat.rs:8:24 | 8 | hardware::{Device, Readable}, | ^^^^^^^^ warning: unused import: `boxed::Box` --> kernel/src/fs/fat.rs:11:13 | 11 | use alloc::{boxed::Box, vec::Vec}; | ^^^^^^^^^^ warning: unreachable statement --> kernel/src/process.rs:144:13 | 140 | / todo!( 141 | | "rax contains an int pointer, 142 | | and the kernel should dereferenced the value" 143 | | ); | |_____________- any code following this expression is unreachable 144 | saved_registers.rdi = self.curr_pid.0 as u64; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unreachable statement | = note: `#[warn(unreachable_code)]` on by default warning: unused variable: `regs` --> kernel/src/process.rs:125:24 | 125 | fn exit(&mut self, regs: &mut Registers, ret_code: u64) { | ^^^^ help: if this is intentional, prefix it with an underscore: `_regs` | = note: `#[warn(unused_variables)]` on by default warning: variable does not need to be mutable --> kernel/src/process.rs:138:17 | 138 | let mut saved_registers = &mut parent_proc.saved_registers; | ----^^^^^^^^^^^^^^^ | | | help: remove this `mut` | = note: `#[warn(unused_mut)]` on by default warning: unused variable: `regs` --> kernel/src/process.rs:153:24 | 153 | fn kill(&mut self, regs: &mut Registers, pid: isize, signal_name: isize) { | ^^^^ help: if this is intentional, prefix it with an underscore: `_regs` warning: unused variable: `pid` --> kernel/src/process.rs:153:46 | 153 | fn kill(&mut self, regs: &mut Registers, pid: isize, signal_name: isize) { | ^^^ help: if this is intentional, prefix it with an underscore: `_pid` warning: unused variable: `signal_name` --> kernel/src/process.rs:153:58 | 153 | fn kill(&mut self, regs: &mut Registers, pid: isize, signal_name: isize) { | ^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_signal_name` warning: field `channels` is never read --> kernel/src/process.rs:54:5 | 50 | pub struct KernelState { | ----------- field in this struct ... 54 | channels: Vec, | ^^^^^^^^ | = note: `#[warn(dead_code)]` on by default warning: fields `free_clusters` and `free_clusters_start_at` are never read --> kernel/src/fs/raw_fat.rs:288:5 | 282 | struct FileSystemInfo { | -------------- fields in this struct ... 288 | free_clusters: u32, | ^^^^^^^^^^^^^ ... 293 | free_clusters_start_at: u32, | ^^^^^^^^^^^^^^^^^^^^^^ warning: fields `deci_sec`, `second`, `minute`, and `hour` are never read --> kernel/src/fs/raw_fat.rs:327:5 | 326 | pub struct Timestamp { | --------- fields in this struct 327 | deci_sec: u8, | ^^^^^^^^ 328 | second: u8, | ^^^^^^ 329 | minute: u8, | ^^^^^^ 330 | hour: u8, | ^^^^ | = note: `Timestamp` has derived impls for the traits `Clone` and `Debug`, but these are intentionally ignored during dead code analysis warning: fields `year`, `month`, and `day` are never read --> kernel/src/fs/raw_fat.rs:350:5 | 349 | pub struct Date { | ---- fields in this struct 350 | year: u8, | ^^^^ 351 | month: u8, | ^^^^^ 352 | day: u8, | ^^^ | = note: `Date` has derived impls for the traits `Clone` and `Debug`, but these are intentionally ignored during dead code analysis warning: fields `creation_time`, `creation_date`, `access_date`, `modification_date`, and `modification_time` are never read --> kernel/src/fs/raw_fat.rs:393:16 | 390 | pub struct Metadata { | -------- fields in this struct ... 393 | pub(super) creation_time: Timestamp, | ^^^^^^^^^^^^^ 394 | pub(super) creation_date: Date, | ^^^^^^^^^^^^^ 395 | pub(super) access_date: Date, | ^^^^^^^^^^^ 396 | pub(super) chain_head: u32, 397 | pub(super) modification_date: Date, | ^^^^^^^^^^^^^^^^^ 398 | pub(super) modification_time: Timestamp, | ^^^^^^^^^^^^^^^^^ | = note: `Metadata` has derived impls for the traits `Clone` and `Debug`, but these are intentionally ignored during dead code analysis warning: `kernel` (lib) generated 16 warnings (run `cargo fix --lib -p kernel` to apply 10 suggestions) warning: unused imports: `mutex::Mutex`, `yield_now` --> kernel/src/main.rs:13:54 | 13 | ...eyboard::KeycodeStream, mutex::Mutex, utils::{yield_now, sleep}, Task, | ^^^^^^^^^^^^ ^^^^^^^^^ | = note: `#[warn(unused_imports)]` on by default warning: `kernel` (bin "kernel") generated 1 warning (run `cargo fix --bin "kernel"` to apply 1 suggestion) error: failed to run custom build command for `bootloader v0.11.0` note: To improve backtraces for build dependencies, set the CARGO_PROFILE_DEV_BUILD_OVERRIDE_DEBUG=true environment variable to enable debug information generation. Caused by: process didn't exit successfully: `/home/mm/mm/rust/nicos/target/debug/build/bootloader-ce00a0df52972587/build-script-build` (exit status: 101) --- stderr Updating crates.io index Installing bootloader-x86_64-uefi v0.11.0 Updating crates.io index Updating crates.io index Compiling compiler_builtins v0.1.91 Compiling core v0.0.0 (/home/mm/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core) Compiling proc-macro2 v1.0.47 Compiling quote v1.0.21 Compiling autocfg v1.1.0 Compiling unicode-ident v1.0.5 Compiling rustversion v1.0.9 Compiling syn v1.0.105 Compiling log v0.4.17 Compiling bootloader_api v0.11.0 Compiling lock_api v0.4.9 Compiling uefi-macros v0.7.1 Compiling rustc-std-workspace-core v1.99.0 (/home/mm/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/rustc-std-workspace-core) Compiling bit_field v0.10.1 Compiling bitflags v1.3.2 Compiling scopeguard v1.1.0 Compiling cfg-if v1.0.0 Compiling rand_core v0.6.4 Compiling zero v0.1.3 Compiling conquer-util v0.3.0 Compiling volatile v0.4.5 Compiling usize_conversions v0.2.0 Compiling noto-sans-mono-bitmap v0.2.0 Compiling raw-cpuid v10.6.0 Compiling xmas-elf v0.8.0 Compiling conquer-once v0.3.2 Compiling rand_hc v0.3.1 Compiling rand v0.8.5 Compiling ucs2 v0.3.2 Compiling x86_64 v0.14.10 Compiling uefi v0.16.1 Compiling spinning_top v0.2.4 Compiling bootloader-x86_64-common v0.11.0 Compiling bootloader-x86_64-uefi v0.11.0 error: internal compiler error: compiler/rustc_monomorphize/src/collector.rs:1038:9: no MIR available for DefId(25:1196 ~ uefi[1c2c]::proto::media::file::info::{impl#3}::name_offset) thread 'rustc' panicked at 'Box', /rustc/2f2c438dce75d8cc532c3baa849eeddc0901802c/compiler/rustc_errors/src/lib.rs:1650:9 stack backtrace: 0: 0x7f53fa7dd361 - std::backtrace_rs::backtrace::libunwind::trace::he9e9030cf5bcddaa at /rustc/2f2c438dce75d8cc532c3baa849eeddc0901802c/library/std/src/../../backtrace/src/backtrace/libunwind.rs:93:5 1: 0x7f53fa7dd361 - std::backtrace_rs::backtrace::trace_unsynchronized::hb5e44a77ff0586eb at /rustc/2f2c438dce75d8cc532c3baa849eeddc0901802c/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5 2: 0x7f53fa7dd361 - std::sys_common::backtrace::_print_fmt::h38e8723c5d83f22f at /rustc/2f2c438dce75d8cc532c3baa849eeddc0901802c/library/std/src/sys_common/backtrace.rs:65:5 3: 0x7f53fa7dd361 - ::fmt::h5e394c4b1f1cb045 at /rustc/2f2c438dce75d8cc532c3baa849eeddc0901802c/library/std/src/sys_common/backtrace.rs:44:22 4: 0x7f53fa83d6ff - core::fmt::rt::Argument::fmt::ha5dde4cb71578cc2 at /rustc/2f2c438dce75d8cc532c3baa849eeddc0901802c/library/core/src/fmt/rt.rs:138:9 5: 0x7f53fa83d6ff - core::fmt::write::hb1413899fd777907 at /rustc/2f2c438dce75d8cc532c3baa849eeddc0901802c/library/core/src/fmt/mod.rs:1094:21 6: 0x7f53fa7d05c1 - std::io::Write::write_fmt::h08b4eac68313bb0d at /rustc/2f2c438dce75d8cc532c3baa849eeddc0901802c/library/std/src/io/mod.rs:1712:15 7: 0x7f53fa7dd175 - std::sys_common::backtrace::_print::h2bb25f41b1777226 at /rustc/2f2c438dce75d8cc532c3baa849eeddc0901802c/library/std/src/sys_common/backtrace.rs:47:5 8: 0x7f53fa7dd175 - std::sys_common::backtrace::print::ha21981aa5a1c5802 at /rustc/2f2c438dce75d8cc532c3baa849eeddc0901802c/library/std/src/sys_common/backtrace.rs:34:9 9: 0x7f53fa7dfe07 - std::panicking::default_hook::{{closure}}::h603ce04329232051 10: 0x7f53fa7dfbf4 - std::panicking::default_hook::hd4285764fbdb24e1 at /rustc/2f2c438dce75d8cc532c3baa849eeddc0901802c/library/std/src/panicking.rs:288:9 11: 0x7f53fda3294b - >::call_once::{shim:vtable#0} 12: 0x7f53fa7e0527 - as core::ops::function::Fn>::call::h401f21a7538313bc at /rustc/2f2c438dce75d8cc532c3baa849eeddc0901802c/library/alloc/src/boxed.rs:1999:9 13: 0x7f53fa7e0527 - std::panicking::rust_panic_with_hook::h2322eda2481f33bc at /rustc/2f2c438dce75d8cc532c3baa849eeddc0901802c/library/std/src/panicking.rs:695:13 14: 0x7f53fdf21031 - std[53b54636b4f52653]::panicking::begin_panic::::{closure#0} 15: 0x7f53fdf1d7e6 - std[53b54636b4f52653]::sys_common::backtrace::__rust_end_short_backtrace::::{closure#0}, !> 16: 0x7f53fdf1d6d6 - std[53b54636b4f52653]::panicking::begin_panic:: 17: 0x7f53fdf18264 - ::bug:: 18: 0x7f53fdf17d76 - ::bug:: 19: 0x7f53fdfa4bac - rustc_middle[232bd29a687eeda3]::util::bug::opt_span_bug_fmt::::{closure#0} 20: 0x7f53fdfa437a - rustc_middle[232bd29a687eeda3]::ty::context::tls::with_opt::::{closure#0}, !>::{closure#0} 21: 0x7f53fdfa434a - rustc_middle[232bd29a687eeda3]::ty::context::tls::with_context_opt::::{closure#0}, !>::{closure#0}, !> 22: 0x7f53fbc3bf8d - rustc_middle[232bd29a687eeda3]::util::bug::bug_fmt 23: 0x7f53fc8b4845 - rustc_monomorphize[6a4925edab24b3f4]::collector::collect_neighbours 24: 0x7f53fc8a4676 - rustc_monomorphize[6a4925edab24b3f4]::collector::collect_items_rec 25: 0x7f53fc8a4ae7 - rustc_monomorphize[6a4925edab24b3f4]::collector::collect_items_rec 26: 0x7f53fc8a4ae7 - rustc_monomorphize[6a4925edab24b3f4]::collector::collect_items_rec 27: 0x7f53fc8a4ae7 - rustc_monomorphize[6a4925edab24b3f4]::collector::collect_items_rec 28: 0x7f53fc8a4ae7 - rustc_monomorphize[6a4925edab24b3f4]::collector::collect_items_rec 29: 0x7f53fc8a4ae7 - rustc_monomorphize[6a4925edab24b3f4]::collector::collect_items_rec 30: 0x7f53fc8a4ae7 - rustc_monomorphize[6a4925edab24b3f4]::collector::collect_items_rec 31: 0x7f53fc8a4ae7 - rustc_monomorphize[6a4925edab24b3f4]::collector::collect_items_rec 32: 0x7f53fc8a4ae7 - rustc_monomorphize[6a4925edab24b3f4]::collector::collect_items_rec 33: 0x7f53fc8a4ae7 - rustc_monomorphize[6a4925edab24b3f4]::collector::collect_items_rec 34: 0x7f53fce8e250 - rustc_data_structures[fba7df231146955e]::sync::par_for_each_in::, rustc_monomorphize[6a4925edab24b3f4]::collector::collect_crate_mono_items::{closure#1}::{closure#0}> 35: 0x7f53fce8df74 - ::time::<(), rustc_monomorphize[6a4925edab24b3f4]::collector::collect_crate_mono_items::{closure#1}> 36: 0x7f53fce8d050 - rustc_monomorphize[6a4925edab24b3f4]::collector::collect_crate_mono_items 37: 0x7f53fce8b8f7 - rustc_monomorphize[6a4925edab24b3f4]::partitioning::collect_and_partition_mono_items 38: 0x7f53fd24f5dc - rustc_query_system[8be5ea0cc4c28ea6]::query::plumbing::try_execute_query:: 39: 0x7f53fd24f2bd - rustc_query_impl[94005537e54250be]::get_query::collect_and_partition_mono_items 40: 0x7f53fcef439c - rustc_codegen_ssa[4e498a107e2a3c27]::base::codegen_crate:: 41: 0x7f53fcef4182 - ::codegen_crate 42: 0x7f53fcc44590 - rustc_interface[1005215f39c21569]::passes::start_codegen 43: 0x7f53fcc400d7 - ::enter::<::ongoing_codegen::{closure#0}::{closure#0}, core[3afeaedfb140cde7]::result::Result, rustc_span[811089187935bcb6]::ErrorGuaranteed>> 44: 0x7f53fcc3f84d - ::ongoing_codegen 45: 0x7f53fcc3ece3 - ::enter::, rustc_span[811089187935bcb6]::ErrorGuaranteed>> 46: 0x7f53fcc3c33b - std[53b54636b4f52653]::sys_common::backtrace::__rust_begin_short_backtrace::, rustc_driver_impl[27c68de0ac55b06a]::run_compiler::{closure#1}>::{closure#0}, core[3afeaedfb140cde7]::result::Result<(), rustc_span[811089187935bcb6]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[3afeaedfb140cde7]::result::Result<(), rustc_span[811089187935bcb6]::ErrorGuaranteed>> 47: 0x7f53fd30bf55 - <::spawn_unchecked_, rustc_driver_impl[27c68de0ac55b06a]::run_compiler::{closure#1}>::{closure#0}, core[3afeaedfb140cde7]::result::Result<(), rustc_span[811089187935bcb6]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[3afeaedfb140cde7]::result::Result<(), rustc_span[811089187935bcb6]::ErrorGuaranteed>>::{closure#1} as core[3afeaedfb140cde7]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0} 48: 0x7f53fa7ea9d5 - as core::ops::function::FnOnce>::call_once::h20fe0a24dda744f1 at /rustc/2f2c438dce75d8cc532c3baa849eeddc0901802c/library/alloc/src/boxed.rs:1985:9 49: 0x7f53fa7ea9d5 - as core::ops::function::FnOnce>::call_once::hb11b4529d66356f4 at /rustc/2f2c438dce75d8cc532c3baa849eeddc0901802c/library/alloc/src/boxed.rs:1985:9 50: 0x7f53fa7ea9d5 - std::sys::unix::thread::Thread::new::thread_start::h896be1b4ceadbc98 at /rustc/2f2c438dce75d8cc532c3baa849eeddc0901802c/library/std/src/sys/unix/thread.rs:108:17 51: 0x7f53fa68e609 - start_thread at /build/glibc-SzIz7B/glibc-2.31/nptl/pthread_create.c:477:8 52: 0x7f53fa5b1133 - clone at /build/glibc-SzIz7B/glibc-2.31/misc/../sysdeps/unix/sysv/linux/x86_64/clone.S:95 53: 0x0 - 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.71.0-nightly (2f2c438dc 2023-05-08) running on x86_64-unknown-linux-gnu note: compiler flags: --crate-type bin -C opt-level=3 -C embed-bitcode=no -Z unstable-options note: some of the compiler flags provided by cargo are hidden query stack during panic: #0 [collect_and_partition_mono_items] collect_and_partition_mono_items end of query stack error: could not compile `bootloader-x86_64-uefi` (bin "bootloader-x86_64-uefi") error: failed to compile `bootloader-x86_64-uefi v0.11.0`, intermediate artifacts can be found at `/tmp/cargo-installih7YZw` thread 'main' panicked at 'failed to build uefi bootloader', /home/mm/.cargo/registry/src/index.crates.io-6f17d22bba15001f/bootloader-0.11.0/build.rs:76:9 stack backtrace: 0: 0x564d1ad665a1 - std::backtrace_rs::backtrace::libunwind::trace::he9e9030cf5bcddaa at /rustc/2f2c438dce75d8cc532c3baa849eeddc0901802c/library/std/src/../../backtrace/src/backtrace/libunwind.rs:93:5 1: 0x564d1ad665a1 - std::backtrace_rs::backtrace::trace_unsynchronized::hb5e44a77ff0586eb at /rustc/2f2c438dce75d8cc532c3baa849eeddc0901802c/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5 2: 0x564d1ad665a1 - std::sys_common::backtrace::_print_fmt::h38e8723c5d83f22f at /rustc/2f2c438dce75d8cc532c3baa849eeddc0901802c/library/std/src/sys_common/backtrace.rs:65:5 3: 0x564d1ad665a1 - ::fmt::h5e394c4b1f1cb045 at /rustc/2f2c438dce75d8cc532c3baa849eeddc0901802c/library/std/src/sys_common/backtrace.rs:44:22 4: 0x564d1ad8704f - core::fmt::rt::Argument::fmt::ha5dde4cb71578cc2 at /rustc/2f2c438dce75d8cc532c3baa849eeddc0901802c/library/core/src/fmt/rt.rs:138:9 5: 0x564d1ad8704f - core::fmt::write::hb1413899fd777907 at /rustc/2f2c438dce75d8cc532c3baa849eeddc0901802c/library/core/src/fmt/mod.rs:1094:21 6: 0x564d1ad63d81 - std::io::Write::write_fmt::h08b4eac68313bb0d at /rustc/2f2c438dce75d8cc532c3baa849eeddc0901802c/library/std/src/io/mod.rs:1712:15 7: 0x564d1ad663b5 - std::sys_common::backtrace::_print::h2bb25f41b1777226 at /rustc/2f2c438dce75d8cc532c3baa849eeddc0901802c/library/std/src/sys_common/backtrace.rs:47:5 8: 0x564d1ad663b5 - std::sys_common::backtrace::print::ha21981aa5a1c5802 at /rustc/2f2c438dce75d8cc532c3baa849eeddc0901802c/library/std/src/sys_common/backtrace.rs:34:9 9: 0x564d1ad67e57 - std::panicking::default_hook::{{closure}}::h603ce04329232051 10: 0x564d1ad67c44 - std::panicking::default_hook::hd4285764fbdb24e1 at /rustc/2f2c438dce75d8cc532c3baa849eeddc0901802c/library/std/src/panicking.rs:288:9 11: 0x564d1ad682f1 - std::panicking::rust_panic_with_hook::h2322eda2481f33bc at /rustc/2f2c438dce75d8cc532c3baa849eeddc0901802c/library/std/src/panicking.rs:691:13 12: 0x564d1ad681a1 - std::panicking::begin_panic_handler::{{closure}}::h3c6baee49f38de13 at /rustc/2f2c438dce75d8cc532c3baa849eeddc0901802c/library/std/src/panicking.rs:580:13 13: 0x564d1ad669e6 - std::sys_common::backtrace::__rust_end_short_backtrace::he4c32e2cde881fbf at /rustc/2f2c438dce75d8cc532c3baa849eeddc0901802c/library/std/src/sys_common/backtrace.rs:150:18 14: 0x564d1ad67f52 - rust_begin_unwind at /rustc/2f2c438dce75d8cc532c3baa849eeddc0901802c/library/std/src/panicking.rs:578:5 15: 0x564d1ad3a283 - core::panicking::panic_fmt::hbd6b294c82b9b3dd at /rustc/2f2c438dce75d8cc532c3baa849eeddc0901802c/library/core/src/panicking.rs:67:14 16: 0x564d1ad3b8a4 - build_script_build::build_uefi_bootloader::ha64e41b8f0bcb115 17: 0x564d1ad3ac51 - build_script_build::main::ha5edc8c5ccfa7ea8 18: 0x564d1ad3ef43 - core::ops::function::FnOnce::call_once::h668ae0fb8cb7d0b8 19: 0x564d1ad3e916 - std::sys_common::backtrace::__rust_begin_short_backtrace::ha27587cb3abe07a4 20: 0x564d1ad3eea9 - std::rt::lang_start::{{closure}}::h4784aefd3aad7ab1 21: 0x564d1ad60a25 - core::ops::function::impls:: for &F>::call_once::h0e92181d85ba76c5 at /rustc/2f2c438dce75d8cc532c3baa849eeddc0901802c/library/core/src/ops/function.rs:284:13 22: 0x564d1ad60a25 - std::panicking::try::do_call::h944df4f4fbb6020c at /rustc/2f2c438dce75d8cc532c3baa849eeddc0901802c/library/std/src/panicking.rs:485:40 23: 0x564d1ad60a25 - std::panicking::try::h7f6c068eda6ae039 at /rustc/2f2c438dce75d8cc532c3baa849eeddc0901802c/library/std/src/panicking.rs:449:19 24: 0x564d1ad60a25 - std::panic::catch_unwind::hf8faebd1c590a761 at /rustc/2f2c438dce75d8cc532c3baa849eeddc0901802c/library/std/src/panic.rs:140:14 25: 0x564d1ad60a25 - std::rt::lang_start_internal::{{closure}}::he97ac956f184b101 at /rustc/2f2c438dce75d8cc532c3baa849eeddc0901802c/library/std/src/rt.rs:148:48 26: 0x564d1ad60a25 - std::panicking::try::do_call::h9b14e7fc2cfcb97a at /rustc/2f2c438dce75d8cc532c3baa849eeddc0901802c/library/std/src/panicking.rs:485:40 27: 0x564d1ad60a25 - std::panicking::try::heca3ee258815924e at /rustc/2f2c438dce75d8cc532c3baa849eeddc0901802c/library/std/src/panicking.rs:449:19 28: 0x564d1ad60a25 - std::panic::catch_unwind::h6e7e553c0a3c470a at /rustc/2f2c438dce75d8cc532c3baa849eeddc0901802c/library/std/src/panic.rs:140:14 29: 0x564d1ad60a25 - std::rt::lang_start_internal::h3117708736c316f3 at /rustc/2f2c438dce75d8cc532c3baa849eeddc0901802c/library/std/src/rt.rs:148:20 30: 0x564d1ad3ee87 - std::rt::lang_start::h4fa2b67ca858ac4f 31: 0x564d1ad3df95 - main 32: 0x7fe86254d083 - __libc_start_main at /build/glibc-SzIz7B/glibc-2.31/csu/../csu/libc-start.c:308:16 33: 0x564d1ad3a8ee - _start 34: 0x0 - ```

Same error is exhibited even with --release.