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

ICE because of a bad file on disk? #127167

Open
minirop opened this issue Jun 30, 2024 · 7 comments
Open

ICE because of a bad file on disk? #127167

minirop opened this issue Jun 30, 2024 · 7 comments
Labels
A-incr-comp Area: Incremental compilation C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@minirop
Copy link

minirop commented Jun 30, 2024

Code

Structurally it's a workspace with 2 binaries and a lib. I got the issue whilst compiling bin1 which only depends on serde, clap and zip.
The code isn't special, just reading a zip file and writing a few text files. After cargo clean everything was back to normal, hence why my code isn't the culprit here.

Meta

rustc --version --verbose:

rustc 1.78.0 (9b00956e5 2024-04-29)
binary: rustc
commit-hash: 9b00956e56009bab2aa15d7bff10916599e3d6d6
commit-date: 2024-04-29
host: x86_64-unknown-linux-gnu
release: 1.78.0
LLVM version: 18.1.2

Error output

I first noticed the issue when Enhanced Rust on Sublime Text told me to check the error logs and I saw the backtrace, which was different from the one I had when just calling cargo build.

Enhanced Rust Backtrace

+0.000 Running: cargo metadata --no-deps
+0.071 Running: rustc --version
+0.032 Running: cargo check --bin c3compiler --message-format=json
+0.101     Checking c3compiler v0.1.0 (/home/minirop/rust/contruct3/c3compiler)
+0.012 thread 'rustc' panicked at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/compiler/rustc_query_system/src/dep_graph/serialized.rs:190:9:
+0.001 assertion `left == right` failed
+0.001   left: 2404352
+0.000  right: 6725756553635079914
+0.000 stack backtrace:
+0.002    0:     0x727736558892 - std::backtrace_rs::backtrace::libunwind::trace::he4ee80166a02c846
+0.000                                at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library/std/src/../../backtrace/src/backtrace/libunwind.rs:105:5
+0.000    1:     0x727736558892 - std::backtrace_rs::backtrace::trace_unsynchronized::h476faccf57e88641
+0.000                                at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
+0.000    2:     0x727736558892 - std::sys_common::backtrace::_print_fmt::h430c922a77e7a59c
+0.000                                at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library/std/src/sys_common/backtrace.rs:68:5
+0.000    3:     0x727736558892 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::hffecb437d922f988
+0.000                                at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library/std/src/sys_common/backtrace.rs:44:22
+0.000    4:     0x7277365a9a6c - core::fmt::rt::Argument::fmt::hf3df69369399bfa9
+0.000                                at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library/core/src/fmt/rt.rs:142:9
+0.000    5:     0x7277365a9a6c - core::fmt::write::hd9a8d7d029f9ea1a
+0.000                                at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library/core/src/fmt/mod.rs:1153:17
+0.000    6:     0x72773654d78f - std::io::Write::write_fmt::h0e1226b2b8d973fe
+0.000                                at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library/std/src/io/mod.rs:1843:15
+0.000    7:     0x727736558664 - std::sys_common::backtrace::_print::hd2df4a083f6e69b8
+0.000                                at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library/std/src/sys_common/backtrace.rs:47:5
+0.000    8:     0x727736558664 - std::sys_common::backtrace::print::he907f6ad7eee41cb
+0.000                                at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library/std/src/sys_common/backtrace.rs:34:9
+0.000    9:     0x72773655b35b - std::panicking::default_hook::{{closure}}::h3926193b61c9ca9b
+0.000   10:     0x72773655b0b3 - std::panicking::default_hook::h25ba2457dea68e65
+0.000                                at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library/std/src/panicking.rs:292:9
+0.001   11:     0x72773322845d - std[e4dfbc2c3f4b09f1]::panicking::update_hook::<alloc[1adba907b9db1888]::boxed::Box<rustc_driver_impl[24a943716c49befe]::install_ice_hook::{closure#0}>>::{closure#0}
+0.000   12:     0x72773655bac0 - <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call::h022ca2c0d8c21c9e
+0.000                                at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library/alloc/src/boxed.rs:2034:9
+0.000   13:     0x72773655bac0 - std::panicking::rust_panic_with_hook::h0ad14d90dcf5224f
+0.000                                at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library/std/src/panicking.rs:783:13
+0.000   14:     0x72773655b802 - std::panicking::begin_panic_handler::{{closure}}::h4a1838a06f542647
+0.000                                at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library/std/src/panicking.rs:657:13
+0.000   15:     0x727736558d66 - std::sys_common::backtrace::__rust_end_short_backtrace::h77cc4dc3567ca904
+0.000                                at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library/std/src/sys_common/backtrace.rs:171:18
+0.000   16:     0x72773655b534 - rust_begin_unwind
+0.000                                at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library/std/src/panicking.rs:645:5
+0.000   17:     0x7277365a5f85 - core::panicking::panic_fmt::h940d4fd01a4b4fd1
+0.000                                at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library/core/src/panicking.rs:72:14
+0.000   18:     0x7277365a64cb - core::panicking::assert_failed_inner::h3fa4c4749ee29c1d
+0.000                                at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library/core/src/panicking.rs:343:17
+0.000   19:     0x727733450573 - core[836963c7c1decc11]::panicking::assert_failed::<usize, usize>
+0.000   20:     0x7277353028b2 - rustc_incremental[83ca8b7354e96499]::persist::load::setup_dep_graph
+0.000   21:     0x7277351b0a03 - <rustc_interface[ba2b6dc4c96cb491]::queries::Queries>::global_ctxt
+0.000   22:     0x727734ffc640 - rustc_interface[ba2b6dc4c96cb491]::interface::run_compiler::<core[836963c7c1decc11]::result::Result<(), rustc_span[a4517f2b2e65298c]::ErrorGuaranteed>, rustc_driver_impl[24a943716c49befe]::run_compiler::{closure#0}>::{closure#0}
+0.000   23:     0x72773533eb6e - std[e4dfbc2c3f4b09f1]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[ba2b6dc4c96cb491]::util::run_in_thread_with_globals<rustc_interface[ba2b6dc4c96cb491]::interface::run_compiler<core[836963c7c1decc11]::result::Result<(), rustc_span[a4517f2b2e65298c]::ErrorGuaranteed>, rustc_driver_impl[24a943716c49befe]::run_compiler::{closure#0}>::{closure#0}, core[836963c7c1decc11]::result::Result<(), rustc_span[a4517f2b2e65298c]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[836963c7c1decc11]::result::Result<(), rustc_span[a4517f2b2e65298c]::ErrorGuaranteed>>
+0.000   24:     0x72773533e9ca - <<std[e4dfbc2c3f4b09f1]::thread::Builder>::spawn_unchecked_<rustc_interface[ba2b6dc4c96cb491]::util::run_in_thread_with_globals<rustc_interface[ba2b6dc4c96cb491]::interface::run_compiler<core[836963c7c1decc11]::result::Result<(), rustc_span[a4517f2b2e65298c]::ErrorGuaranteed>, rustc_driver_impl[24a943716c49befe]::run_compiler::{closure#0}>::{closure#0}, core[836963c7c1decc11]::result::Result<(), rustc_span[a4517f2b2e65298c]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[836963c7c1decc11]::result::Result<(), rustc_span[a4517f2b2e65298c]::ErrorGuaranteed>>::{closure#1} as core[836963c7c1decc11]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
+0.000   25:     0x727736565145 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h19b9e642d37e7272
+0.000                                at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library/alloc/src/boxed.rs:2020:9
+0.000   26:     0x727736565145 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h97265befc434d3ae
+0.000                                at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library/alloc/src/boxed.rs:2020:9
+0.000   27:     0x727736565145 - std::sys::pal::unix::thread::Thread::new::thread_start::h420dad5cf01a9f35
+0.000                                at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library/std/src/sys/pal/unix/thread.rs:108:17
+0.000   28:     0x7277302a6ded - <unknown>
+0.000   29:     0x72773032a0dc - <unknown>
+0.000   30:                0x0 - <unknown>
+0.000 
+0.000 error: the compiler unexpectedly panicked. this is a bug.
+0.000 
+0.000 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
+0.000 
+0.000 note: rustc 1.78.0 (9b00956e5 2024-04-29) running on x86_64-unknown-linux-gnu
+0.000 
+0.000 note: compiler flags: --crate-type bin -C embed-bitcode=no -C debuginfo=2 -C linker=/usr/bin/clang -C incremental=[REDACTED] -C link-arg=--ld-path=/usr/bin/mold
+0.000 
+0.000 note: some of the compiler flags provided by cargo are hidden
+0.000 
+0.000 query stack during panic:
+0.000 end of query stack
+0.000 error: could not compile `c3compiler` (bin "c3compiler")
+0.000 On-save check finished.

Cargo build Backtrace

thread 'rustc' panicked at compiler/rustc_middle/src/query/on_disk_cache.rs:519:5:
assertion `left == right` failed
  left: 82
 right: 1002111927320821928687967599834759150
stack backtrace:
   0:     0x7da197ef9892 - std::backtrace_rs::backtrace::libunwind::trace::he4ee80166a02c846
                               at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library/std/src/../../backtrace/src/backtrace/libunwind.rs:105:5
   1:     0x7da197ef9892 - std::backtrace_rs::backtrace::trace_unsynchronized::h476faccf57e88641
                               at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x7da197ef9892 - std::sys_common::backtrace::_print_fmt::h430c922a77e7a59c
                               at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library/std/src/sys_common/backtrace.rs:68:5
   3:     0x7da197ef9892 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::hffecb437d922f988
                               at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library/std/src/sys_common/backtrace.rs:44:22
   4:     0x7da197f4aa6c - core::fmt::rt::Argument::fmt::hf3df69369399bfa9
                               at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library/core/src/fmt/rt.rs:142:9
   5:     0x7da197f4aa6c - core::fmt::write::hd9a8d7d029f9ea1a
                               at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library/core/src/fmt/mod.rs:1153:17
   6:     0x7da197eee78f - std::io::Write::write_fmt::h0e1226b2b8d973fe
                               at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library/std/src/io/mod.rs:1843:15
   7:     0x7da197ef9664 - std::sys_common::backtrace::_print::hd2df4a083f6e69b8
                               at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library/std/src/sys_common/backtrace.rs:47:5
   8:     0x7da197ef9664 - std::sys_common::backtrace::print::he907f6ad7eee41cb
                               at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library/std/src/sys_common/backtrace.rs:34:9
   9:     0x7da197efc35b - std::panicking::default_hook::{{closure}}::h3926193b61c9ca9b
  10:     0x7da197efc0b3 - std::panicking::default_hook::h25ba2457dea68e65
                               at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library/std/src/panicking.rs:292:9
  11:     0x7da194c2845d - std[e4dfbc2c3f4b09f1]::panicking::update_hook::<alloc[1adba907b9db1888]::boxed::Box<rustc_driver_impl[24a943716c49befe]::install_ice_hook::{closure#0}>>::{closure#0}
  12:     0x7da197efcac0 - <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call::h022ca2c0d8c21c9e
                               at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library/alloc/src/boxed.rs:2034:9
  13:     0x7da197efcac0 - std::panicking::rust_panic_with_hook::h0ad14d90dcf5224f
                               at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library/std/src/panicking.rs:783:13
  14:     0x7da197efc802 - std::panicking::begin_panic_handler::{{closure}}::h4a1838a06f542647
                               at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library/std/src/panicking.rs:657:13
  15:     0x7da197ef9d66 - std::sys_common::backtrace::__rust_end_short_backtrace::h77cc4dc3567ca904
                               at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library/std/src/sys_common/backtrace.rs:171:18
  16:     0x7da197efc534 - rust_begin_unwind
                               at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library/std/src/panicking.rs:645:5
  17:     0x7da197f46f85 - core::panicking::panic_fmt::h940d4fd01a4b4fd1
                               at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library/core/src/panicking.rs:72:14
  18:     0x7da197f474cb - core::panicking::assert_failed_inner::h3fa4c4749ee29c1d
                               at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library/core/src/panicking.rs:343:17
  19:     0x7da195024407 - core[836963c7c1decc11]::panicking::assert_failed::<u128, u128>
  20:     0x7da196d15a7e - <rustc_middle[fda44fdb505d3e7f]::query::on_disk_cache::OnDiskCache>::new
  21:     0x7da196d18642 - rustc_incremental[83ca8b7354e96499]::persist::load::load_query_result_cache
  22:     0x7da196d18868 - rustc_interface[ba2b6dc4c96cb491]::passes::create_global_ctxt
  23:     0x7da196bb0b37 - <rustc_interface[ba2b6dc4c96cb491]::queries::Queries>::global_ctxt
  24:     0x7da1969fc640 - rustc_interface[ba2b6dc4c96cb491]::interface::run_compiler::<core[836963c7c1decc11]::result::Result<(), rustc_span[a4517f2b2e65298c]::ErrorGuaranteed>, rustc_driver_impl[24a943716c49befe]::run_compiler::{closure#0}>::{closure#0}
  25:     0x7da196d3eb6e - std[e4dfbc2c3f4b09f1]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[ba2b6dc4c96cb491]::util::run_in_thread_with_globals<rustc_interface[ba2b6dc4c96cb491]::interface::run_compiler<core[836963c7c1decc11]::result::Result<(), rustc_span[a4517f2b2e65298c]::ErrorGuaranteed>, rustc_driver_impl[24a943716c49befe]::run_compiler::{closure#0}>::{closure#0}, core[836963c7c1decc11]::result::Result<(), rustc_span[a4517f2b2e65298c]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[836963c7c1decc11]::result::Result<(), rustc_span[a4517f2b2e65298c]::ErrorGuaranteed>>
  26:     0x7da196d3e9ca - <<std[e4dfbc2c3f4b09f1]::thread::Builder>::spawn_unchecked_<rustc_interface[ba2b6dc4c96cb491]::util::run_in_thread_with_globals<rustc_interface[ba2b6dc4c96cb491]::interface::run_compiler<core[836963c7c1decc11]::result::Result<(), rustc_span[a4517f2b2e65298c]::ErrorGuaranteed>, rustc_driver_impl[24a943716c49befe]::run_compiler::{closure#0}>::{closure#0}, core[836963c7c1decc11]::result::Result<(), rustc_span[a4517f2b2e65298c]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[836963c7c1decc11]::result::Result<(), rustc_span[a4517f2b2e65298c]::ErrorGuaranteed>>::{closure#1} as core[836963c7c1decc11]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  27:     0x7da197f06145 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h19b9e642d37e7272
                               at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library/alloc/src/boxed.rs:2020:9
  28:     0x7da197f06145 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h97265befc434d3ae
                               at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library/alloc/src/boxed.rs:2020:9
  29:     0x7da197f06145 - std::sys::pal::unix::thread::Thread::new::thread_start::h420dad5cf01a9f35
                               at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library/std/src/sys/pal/unix/thread.rs:108:17
  30:     0x7da191ca6ded - <unknown>
  31:     0x7da191d2a0dc - <unknown>
  32:                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.78.0 (9b00956e5 2024-04-29) running on x86_64-unknown-linux-gnu

note: compiler flags: --crate-type bin -C embed-bitcode=no -C debuginfo=2 -C linker=/usr/bin/clang -C incremental=[REDACTED] -C link-arg=--ld-path=/usr/bin/mold

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

query stack during panic:
end of query stack
error: could not compile `c3compiler` (bin "c3compiler")

@minirop minirop added C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Jun 30, 2024
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Jun 30, 2024
@ethus3h
Copy link

ethus3h commented Jul 1, 2024

I'm on chapter 3 of the Rust book (Brown.edu version) as a complete beginner and tried adding a comment (without knowing the correct syntax, though I looked it up and it looks like this should be right?) and it exploded, I suspect it's the same as this issue?

EDIT: It seems like running cargo run multiple times works fine, until I edit the file (even just whitespace), which makes it start crashing (on stable) or reporting "corrupt incremental compilation artifact" (on beta).

EDIT 2: It occured to me, this possibly because I'm using fuse filesystem for /home. I haven't noticed any other issues with it (for general desktop computing purposes for a few months) but mentioning in case.

Possible similar issues: #126794 #126982

Code

fn main() {
    println!("Hello, world!");
    // test
}

Meta

rustc --version --verbose:

rustc 1.79.0 (129f3b996 2024-06-10)
binary: rustc
commit-hash: 129f3b9964af4d4a709d1383930ade12dfe7c081
commit-date: 2024-06-10
host: x86_64-unknown-linux-gnu
release: 1.79.0
LLVM version: 18.1.7

Switching to the beta version with rustup default beta got it to run, with this message:

RUST_BACKTRACE=1 cargo run
warning: corrupt incremental compilation artifact found at `/home/[redacted]/[redacted]/target/debug/incremental/[redacted]-3lhggnl9lly0o/s-gxm6nsdsu8-1a2mto6-working/work-products.bin`. This file will automatically be ignored and deleted. If you see this message repeatedly or can provoke it without manually manipulating the compiler's artifacts, please file an issue. The incremental compilation system relies on hardlinks and filesystem locks behaving correctly, and may not deal well with OS crashes, so whatever information you can provide about your filesystem or other state may be very relevant.

warning: `[redacted]` (bin "[redacted]") generated 1 warning
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.04s
     Running `target/debug/[redacted]`
Hello, world!

Error output

Click to expand
thread 'rustc' panicked at /rustc/129f3b9964af4d4a709d1383930ade12dfe7c081/compiler/rustc_query_system/src/dep_graph/serialized.rs:192:9:
assertion `left == right` failed
  left: 72374
 right: 0
stack backtrace:
   0:     0x7f2add931035 - std::backtrace_rs::backtrace::libunwind::trace::h1a07e5dba0da0cd2
                               at /rustc/129f3b9964af4d4a709d1383930ade12dfe7c081/library/std/src/../../backtrace/src/backtrace/libunwind.rs:105:5
   1:     0x7f2add931035 - std::backtrace_rs::backtrace::trace_unsynchronized::h61b9b8394328c0bc
                               at /rustc/129f3b9964af4d4a709d1383930ade12dfe7c081/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x7f2add931035 - std::sys_common::backtrace::_print_fmt::h1c5e18b460934cff
                               at /rustc/129f3b9964af4d4a709d1383930ade12dfe7c081/library/std/src/sys_common/backtrace.rs:68:5
   3:     0x7f2add931035 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h1e1a1972118942ad
                               at /rustc/129f3b9964af4d4a709d1383930ade12dfe7c081/library/std/src/sys_common/backtrace.rs:44:22
   4:     0x7f2add98029b - core::fmt::rt::Argument::fmt::h07af2b4071d536cd
                               at /rustc/129f3b9964af4d4a709d1383930ade12dfe7c081/library/core/src/fmt/rt.rs:165:63
   5:     0x7f2add98029b - core::fmt::write::hc090a2ffd6b28c4a
                               at /rustc/129f3b9964af4d4a709d1383930ade12dfe7c081/library/core/src/fmt/mod.rs:1157:21
   6:     0x7f2add925bdf - std::io::Write::write_fmt::h8898bac6ff039a23
                               at /rustc/129f3b9964af4d4a709d1383930ade12dfe7c081/library/std/src/io/mod.rs:1832:15
   7:     0x7f2add930e0e - std::sys_common::backtrace::_print::h4e80c5803d4ee35b
                               at /rustc/129f3b9964af4d4a709d1383930ade12dfe7c081/library/std/src/sys_common/backtrace.rs:47:5
   8:     0x7f2add930e0e - std::sys_common::backtrace::print::ha96650907276675e
                               at /rustc/129f3b9964af4d4a709d1383930ade12dfe7c081/library/std/src/sys_common/backtrace.rs:34:9
   9:     0x7f2add933779 - std::panicking::default_hook::{{closure}}::h215c2a0a8346e0e0
  10:     0x7f2add9334bd - std::panicking::default_hook::h207342be97478370
                               at /rustc/129f3b9964af4d4a709d1383930ade12dfe7c081/library/std/src/panicking.rs:298:9
  11:     0x7f2ada6891b7 - std[3c8ba8ebcf555201]::panicking::update_hook::<alloc[bfbae7e348dce413]::boxed::Box<rustc_driver_impl[c88438ade88661f4]::install_ice_hook::{closure#0}>>::{closure#0}
  12:     0x7f2add933e76 - <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call::ha9c3bc81d312fd83
                               at /rustc/129f3b9964af4d4a709d1383930ade12dfe7c081/library/alloc/src/boxed.rs:2036:9
  13:     0x7f2add933e76 - std::panicking::rust_panic_with_hook::hac8bdceee1e4fe2c
                               at /rustc/129f3b9964af4d4a709d1383930ade12dfe7c081/library/std/src/panicking.rs:799:13
  14:     0x7f2add933c24 - std::panicking::begin_panic_handler::{{closure}}::h00d785e82757ce3c
                               at /rustc/129f3b9964af4d4a709d1383930ade12dfe7c081/library/std/src/panicking.rs:664:13
  15:     0x7f2add9314f9 - std::sys_common::backtrace::__rust_end_short_backtrace::h1628d957bcd06996
                               at /rustc/129f3b9964af4d4a709d1383930ade12dfe7c081/library/std/src/sys_common/backtrace.rs:171:18
  16:     0x7f2add933957 - rust_begin_unwind
                               at /rustc/129f3b9964af4d4a709d1383930ade12dfe7c081/library/std/src/panicking.rs:652:5
  17:     0x7f2add97c763 - core::panicking::panic_fmt::hdc63834ffaaefae5
                               at /rustc/129f3b9964af4d4a709d1383930ade12dfe7c081/library/core/src/panicking.rs:72:14
  18:     0x7f2add97cc5e - core::panicking::assert_failed_inner::hda4754f94c1c1cb1
                               at /rustc/129f3b9964af4d4a709d1383930ade12dfe7c081/library/core/src/panicking.rs:409:17
  19:     0x7f2ada8d1963 - core[868bc93c3f2beb33]::panicking::assert_failed::<usize, usize>
  20:     0x7f2adc85b9d4 - rustc_incremental[8ea5e04d9752f988]::persist::load::setup_dep_graph
  21:     0x7f2adc826d52 - <rustc_interface[640972162e3c086f]::queries::Queries>::global_ctxt
  22:     0x7f2adc582ef0 - rustc_interface[640972162e3c086f]::interface::run_compiler::<core[868bc93c3f2beb33]::result::Result<(), rustc_span[8c7415e9d33ddd75]::ErrorGuaranteed>, rustc_driver_impl[c88438ade88661f4]::run_compiler::{closure#0}>::{closure#1}
  23:     0x7f2adc540f8b - std[3c8ba8ebcf555201]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[640972162e3c086f]::util::run_in_thread_with_globals<rustc_interface[640972162e3c086f]::interface::run_compiler<core[868bc93c3f2beb33]::result::Result<(), rustc_span[8c7415e9d33ddd75]::ErrorGuaranteed>, rustc_driver_impl[c88438ade88661f4]::run_compiler::{closure#0}>::{closure#1}, core[868bc93c3f2beb33]::result::Result<(), rustc_span[8c7415e9d33ddd75]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[868bc93c3f2beb33]::result::Result<(), rustc_span[8c7415e9d33ddd75]::ErrorGuaranteed>>
  24:     0x7f2adc540d80 - <<std[3c8ba8ebcf555201]::thread::Builder>::spawn_unchecked_<rustc_interface[640972162e3c086f]::util::run_in_thread_with_globals<rustc_interface[640972162e3c086f]::interface::run_compiler<core[868bc93c3f2beb33]::result::Result<(), rustc_span[8c7415e9d33ddd75]::ErrorGuaranteed>, rustc_driver_impl[c88438ade88661f4]::run_compiler::{closure#0}>::{closure#1}, core[868bc93c3f2beb33]::result::Result<(), rustc_span[8c7415e9d33ddd75]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[868bc93c3f2beb33]::result::Result<(), rustc_span[8c7415e9d33ddd75]::ErrorGuaranteed>>::{closure#2} as core[868bc93c3f2beb33]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  25:     0x7f2add93dcab - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h09e5a4c541afa800
                               at /rustc/129f3b9964af4d4a709d1383930ade12dfe7c081/library/alloc/src/boxed.rs:2022:9
  26:     0x7f2add93dcab - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h9c8b03c22f4e7026
                               at /rustc/129f3b9964af4d4a709d1383930ade12dfe7c081/library/alloc/src/boxed.rs:2022:9
  27:     0x7f2add93dcab - std::sys::pal::unix::thread::Thread::new::thread_start::h522bc89a54da820a
                               at /rustc/129f3b9964af4d4a709d1383930ade12dfe7c081/library/std/src/sys/pal/unix/thread.rs:108:17
  28:     0x7f2ad7697134 - <unknown>
  29:     0x7f2ad77177dc - <unknown>
  30:                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.79.0 (129f3b996 2024-06-10) 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:
end of query stack

Backtrace

thread 'rustc' panicked at /rustc/129f3b9964af4d4a709d1383930ade12dfe7c081/compiler/rustc_query_system/src/dep_graph/serialized.rs:192:9:
assertion `left == right` failed
  left: 72374
 right: 0
stack backtrace:
   0: rust_begin_unwind
             at /rustc/129f3b9964af4d4a709d1383930ade12dfe7c081/library/std/src/panicking.rs:652:5
   1: core::panicking::panic_fmt
             at /rustc/129f3b9964af4d4a709d1383930ade12dfe7c081/library/core/src/panicking.rs:72:14
   2: core::panicking::assert_failed_inner
             at /rustc/129f3b9964af4d4a709d1383930ade12dfe7c081/library/core/src/panicking.rs:409:17
   3: core::panicking::assert_failed::<usize, usize>
   4: rustc_incremental::persist::load::setup_dep_graph
   5: <rustc_interface::queries::Queries>::global_ctxt
   6: rustc_interface::interface::run_compiler::<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#0}>::{closure#1}
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

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.79.0 (129f3b996 2024-06-10) 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:
end of query stack

@saethlin
Copy link
Member

saethlin commented Jul 1, 2024

@ethus3h You are running into a different problem, unless you have the exact same error message please file a separate issue.

The original issue here is about

thread 'rustc' panicked at compiler/rustc_middle/src/query/on_disk_cache.rs:519:5:
assertion `left == right` failed
  left: 82
 right: 1002111927320821928687967599834759150

But you are reporting

thread 'rustc' panicked at /rustc/129f3b9964af4d4a709d1383930ade12dfe7c081/compiler/rustc_query_system/src/dep_graph/serialized.rs:192:9:
assertion `left == right` failed
 left: 72374
right: 0

@saethlin saethlin added A-incr-comp Area: Incremental compilation and removed needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. labels Jul 1, 2024
@saethlin
Copy link
Member

saethlin commented Jul 1, 2024

As far as I'm aware, the original issue here is indeed a corrupt file on disk. I added code that should work around such corruption in #124686, but it lands in 1.80 which is not stable yet. As that PR description states, that PR is likely to eliminate ICEs that mention 1002111927320821928687967599834759150. Those crashes are due to something truncating the compiler's output on disk without returning an I/O error. As far as I can tell, that's just another way to say "a broken filesystem".

Incremental compilation ICEs mentioning other values will not be affected.

@saethlin
Copy link
Member

saethlin commented Jul 1, 2024

this possibly because I'm using fuse filesystem for /home. I haven't noticed any other issues with it (for general desktop computing purposes for a few months) but mentioning in case.

The incremental compilation system that rustc uses really needs both hardlinks and filesystem locks to behave correctly. It wouldn't surprise me if you are using a fuse-based filesystem that is subtly buggy. You wouldn't be the first.

@ethus3h
Copy link

ethus3h commented Jul 1, 2024

this possibly because I'm using fuse filesystem for /home. I haven't noticed any other issues with it (for general desktop computing purposes for a few months) but mentioning in case.

The incremental compilation system that rustc uses really needs both hardlinks and filesystem locks to behave correctly. It wouldn't surprise me if you are using a fuse-based filesystem that is subtly buggy. You wouldn't be the first.

I see, good to know. I'll just use cargo clean before running to work around it then rather than opening a new issue here, since it sounds like it's probably not a Rust problem. Thank you!

@saethlin
Copy link
Member

saethlin commented Jul 1, 2024

The specific ICE that mentions 1002111927320821928687967599834759150 is most likely a filesystem bug, other ICEs are more likely to be bugs in the compiler.

@eggyal
Copy link
Contributor

eggyal commented Jul 2, 2024

I'll just use cargo clean before running to work around it

In that case, you might as well just disable incremental compilation, ie without -C incremental (or equivalently incremental = false in the relevant Cargo profile).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-incr-comp Area: Incremental compilation C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

5 participants