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 compiling burn-import #114017

Closed
Luni-4 opened this issue Jul 24, 2023 · 1 comment
Closed

ICE compiling burn-import #114017

Luni-4 opened this issue Jul 24, 2023 · 1 comment
Assignees
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

@Luni-4
Copy link

Luni-4 commented Jul 24, 2023

Code

This is a spurious issue, so not reproducible anymore after a cargo clean. Give a try the same, perhaps it could happen again: clone the code contained in this branch https://github.com/Luni-4/burn/tree/add-operator, enter burn-import directory and run cargo build

<code>

Meta

rustc --version --verbose:

rustc 1.71.0 (8ede3aae2 2023-07-12)
binary: rustc
commit-hash: 8ede3aae28fe6e4d52b38157d7bfe0d3bceef225
commit-date: 2023-07-12
host: x86_64-unknown-linux-gnu
release: 1.71.0
LLVM version: 16.0.5

Backtrace

thread 'rustc' panicked at 'assertion failed: `(left == right)`
  left: `78`,
 right: `1002111927320821928687967599834759150`', compiler/rustc_middle/src/query/on_disk_cache.rs:529:5
stack backtrace:
   0:     0x7ff4b5d6a071 - std::backtrace_rs::backtrace::libunwind::trace::h6aeaf83abc038fe6
                               at /rustc/8ede3aae28fe6e4d52b38157d7bfe0d3bceef225/library/std/src/../../backtrace/src/backtrace/libunwind.rs:93:5
   1:     0x7ff4b5d6a071 - std::backtrace_rs::backtrace::trace_unsynchronized::h4f9875212db0ad97
                               at /rustc/8ede3aae28fe6e4d52b38157d7bfe0d3bceef225/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x7ff4b5d6a071 - std::sys_common::backtrace::_print_fmt::h3f820027e9c39d3b
                               at /rustc/8ede3aae28fe6e4d52b38157d7bfe0d3bceef225/library/std/src/sys_common/backtrace.rs:65:5
   3:     0x7ff4b5d6a071 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::hded4932df41373b3
                               at /rustc/8ede3aae28fe6e4d52b38157d7bfe0d3bceef225/library/std/src/sys_common/backtrace.rs:44:22
   4:     0x7ff4b5dc9d9f - core::fmt::rt::Argument::fmt::hc8ead7746b2406d6
                               at /rustc/8ede3aae28fe6e4d52b38157d7bfe0d3bceef225/library/core/src/fmt/rt.rs:138:9
   5:     0x7ff4b5dc9d9f - core::fmt::write::hb1cb56105a082ad9
                               at /rustc/8ede3aae28fe6e4d52b38157d7bfe0d3bceef225/library/core/src/fmt/mod.rs:1094:21
   6:     0x7ff4b5d5d271 - std::io::Write::write_fmt::h797fda7085c97e57
                               at /rustc/8ede3aae28fe6e4d52b38157d7bfe0d3bceef225/library/std/src/io/mod.rs:1713:15
   7:     0x7ff4b5d69e85 - std::sys_common::backtrace::_print::h492d3c92d7400346
                               at /rustc/8ede3aae28fe6e4d52b38157d7bfe0d3bceef225/library/std/src/sys_common/backtrace.rs:47:5
   8:     0x7ff4b5d69e85 - std::sys_common::backtrace::print::hf74aa2eef05af215
                               at /rustc/8ede3aae28fe6e4d52b38157d7bfe0d3bceef225/library/std/src/sys_common/backtrace.rs:34:9
   9:     0x7ff4b5d6cb47 - std::panicking::default_hook::{{closure}}::h8cad394227ea3de8
  10:     0x7ff4b5d6c934 - std::panicking::default_hook::h249cc184fec99a8a
                               at /rustc/8ede3aae28fe6e4d52b38157d7bfe0d3bceef225/library/std/src/panicking.rs:288:9
  11:     0x7ff4b8ee9b5b - rustc_driver_impl[55b27a31f76e3fb7]::install_ice_hook::{closure#0}
  12:     0x7ff4b5d6d28d - <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call::h0be7fc2421582b49
                               at /rustc/8ede3aae28fe6e4d52b38157d7bfe0d3bceef225/library/alloc/src/boxed.rs:1999:9
  13:     0x7ff4b5d6d28d - std::panicking::rust_panic_with_hook::h82ebcd5d5ed2fad4
                               at /rustc/8ede3aae28fe6e4d52b38157d7bfe0d3bceef225/library/std/src/panicking.rs:709:13
  14:     0x7ff4b5d6d027 - std::panicking::begin_panic_handler::{{closure}}::h810bed8ecbe66f1a
                               at /rustc/8ede3aae28fe6e4d52b38157d7bfe0d3bceef225/library/std/src/panicking.rs:597:13
  15:     0x7ff4b5d6a4a6 - std::sys_common::backtrace::__rust_end_short_backtrace::h1410008071796261
                               at /rustc/8ede3aae28fe6e4d52b38157d7bfe0d3bceef225/library/std/src/sys_common/backtrace.rs:151:18
  16:     0x7ff4b5d6cd72 - rust_begin_unwind
                               at /rustc/8ede3aae28fe6e4d52b38157d7bfe0d3bceef225/library/std/src/panicking.rs:593:5
  17:     0x7ff4b5dc6023 - core::panicking::panic_fmt::ha0a42a25e0cf258d
                               at /rustc/8ede3aae28fe6e4d52b38157d7bfe0d3bceef225/library/core/src/panicking.rs:67:14
  18:     0x7ff4b5dc64cb - core::panicking::assert_failed_inner::h8de29b2c8e31440f
  19:     0x7ff4b943a1e2 - core[3d2408b9a7974bb]::panicking::assert_failed::<u128, u128>
  20:     0x7ff4b81da421 - <rustc_middle[69e8a450f04f22d]::query::on_disk_cache::OnDiskCache>::new
  21:     0x7ff4b817530b - rustc_incremental[e6c14406f14ae614]::persist::load::load_query_result_cache
  22:     0x7ff4b81749c2 - rustc_interface[2ac6857faa489841]::passes::create_global_ctxt
  23:     0x7ff4b8173c95 - <rustc_interface[2ac6857faa489841]::queries::Queries>::global_ctxt
  24:     0x7ff4b8171d87 - <rustc_interface[2ac6857faa489841]::interface::Compiler>::enter::<rustc_driver_impl[55b27a31f76e3fb7]::run_compiler::{closure#1}::{closure#2}, core[3d2408b9a7974bb]::result::Result<core[3d2408b9a7974bb]::option::Option<rustc_interface[2ac6857faa489841]::queries::Linker>, rustc_span[b25f563e2e6d20a1]::ErrorGuaranteed>>
  25:     0x7ff4b816f683 - std[a2d7a4c8dd6a1366]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[2ac6857faa489841]::util::run_in_thread_pool_with_globals<rustc_interface[2ac6857faa489841]::interface::run_compiler<core[3d2408b9a7974bb]::result::Result<(), rustc_span[b25f563e2e6d20a1]::ErrorGuaranteed>, rustc_driver_impl[55b27a31f76e3fb7]::run_compiler::{closure#1}>::{closure#0}, core[3d2408b9a7974bb]::result::Result<(), rustc_span[b25f563e2e6d20a1]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[3d2408b9a7974bb]::result::Result<(), rustc_span[b25f563e2e6d20a1]::ErrorGuaranteed>>
  26:     0x7ff4b879b165 - <<std[a2d7a4c8dd6a1366]::thread::Builder>::spawn_unchecked_<rustc_interface[2ac6857faa489841]::util::run_in_thread_pool_with_globals<rustc_interface[2ac6857faa489841]::interface::run_compiler<core[3d2408b9a7974bb]::result::Result<(), rustc_span[b25f563e2e6d20a1]::ErrorGuaranteed>, rustc_driver_impl[55b27a31f76e3fb7]::run_compiler::{closure#1}>::{closure#0}, core[3d2408b9a7974bb]::result::Result<(), rustc_span[b25f563e2e6d20a1]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[3d2408b9a7974bb]::result::Result<(), rustc_span[b25f563e2e6d20a1]::ErrorGuaranteed>>::{closure#1} as core[3d2408b9a7974bb]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  27:     0x7ff4b5d777b5 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h9adfc2ae43657457
                               at /rustc/8ede3aae28fe6e4d52b38157d7bfe0d3bceef225/library/alloc/src/boxed.rs:1985:9
  28:     0x7ff4b5d777b5 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h14fefbfa7b574396
                               at /rustc/8ede3aae28fe6e4d52b38157d7bfe0d3bceef225/library/alloc/src/boxed.rs:1985:9
  29:     0x7ff4b5d777b5 - std::sys::unix::thread::Thread::new::thread_start::ha211bb47f6f5cedc
                               at /rustc/8ede3aae28fe6e4d52b38157d7bfe0d3bceef225/library/std/src/sys/unix/thread.rs:108:17
  30:     0x7ff4b5a94b43 - start_thread
                               at ./nptl/pthread_create.c:442:8
  31:     0x7ff4b5b26a00 - clone3
                               at ./misc/../sysdeps/unix/sysv/linux/x86_64/clone3.S:81
  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.71.0 (8ede3aae2 2023-07-12) running on x86_64-unknown-linux-gnu

note: compiler flags: --crate-type lib -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
error: could not compile `burn-core` (lib)

@Luni-4 Luni-4 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 Jul 24, 2023
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Jul 24, 2023
@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 24, 2023
@saethlin saethlin self-assigned this Apr 29, 2024
@saethlin
Copy link
Member

As far as I can tell, the ICE reported in this issue is caused by another process damaging rustc's build artifacts or by a buggy filesystem. That other process could be anything from an IDE running the compiler at the same time as a manual build to a find-and-replace that accidentally edits files in the target directory.

#124686 contains a mitigation for this situation; the compiler now has a crude way to detect and ignore damaged incremental compilation files. You will still get a warning about the damaged file, but the build should proceed normally. That change shipped in Rust 1.80 which released today, so I am closing this issue and a few others which as far as I can tell all have the same root cause. You shouldn't see this ICE anymore, but please file a new issue if you see something like it on 1.80 or later.

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

3 participants