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: Assert at src/librustc_middle/ty/query/on_disk_cache.rs:491:5 - Uncertain of cause (unreproducable) #73108

Closed
AldaronLau opened this issue Jun 7, 2020 · 4 comments
Assignees
Labels
A-incr-comp Area: Incremental compilation C-bug Category: This is a bug. E-needs-bisection Call for participation: This issue needs bisection: /~https://github.com/rust-lang/cargo-bisect-rustc E-needs-mcve Call for participation: This issue has a repro, but needs a Minimal Complete and Verifiable Example 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

@AldaronLau
Copy link
Contributor

ICE when running cargo build. Running cargo clean makes the ICE go away.

I tried this code: /~https://github.com/libcala/stick/

git checkout c62fba3ab591d77177a5de4c36493ce8ecbb487b

Previous commands

I don't know how helpful this is, considering that I can't reproduce now that I have ran cargo clean, even though I was able to reproduce the error before.

cargo tree
cargo run --example readme --release
git diff
tig
ls pad_db/pad/mapping/
cargo doc --open

Meta

RUST_BACKTRACE=1 cargo build --verbose:

Backtrace:

   Fresh unicode-xid v0.2.0
   Fresh smelling_salts v0.1.0
   Fresh proc-macro2 v1.0.18
   Fresh quote v1.0.6
   Fresh serde v1.0.111
   Fresh syn v1.0.30
   Fresh toml v0.5.6
   Fresh serde_derive v1.0.111

Compiling stick v0.9.0 (/home/aldaronlau/devel/stick)
Running rustc --crate-name stick --edition=2018 src/lib.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type lib --emit=dep-info,metadata,link -C debuginfo=2 --cfg 'feature="default"' -C metadata=1889ceb89eb5ce80 -C extra-filename=-1889ceb89eb5ce80 --out-dir /home/aldaronlau/devel/stick/target/debug/deps -C incremental=/home/aldaronlau/devel/stick/target/debug/incremental -L dependency=/home/aldaronlau/devel/stick/target/debug/deps --extern smelling_salts=/home/aldaronlau/devel/stick/target/debug/deps/libsmelling_salts-51ee0fa6c978ca0c.rmeta
warning: unnecessary parentheses around assigned value
--> src/ffi/linux.rs:771:20
|
771 | let norm = (range * 0.5);
| ^^^^^^^^^^^^^ help: remove these parentheses
|
= note: #[warn(unused_parens)] on by default

thread 'rustc' panicked at 'assertion failed: (left == right)
left: 7505659740231074721,
right: 1002111927320821928687967599834759150', src/librustc_middle/ty/query/on_disk_cache.rs:491:5
stack backtrace:
0: backtrace::backtrace::libunwind::trace
at /cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.46/src/backtrace/libunwind.rs:86
1: backtrace::backtrace::trace_unsynchronized
at /cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.46/src/backtrace/mod.rs:66
2: std::sys_common::backtrace::_print_fmt
at src/libstd/sys_common/backtrace.rs:78
3: <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt
at src/libstd/sys_common/backtrace.rs:59
4: core::fmt::write
at src/libcore/fmt/mod.rs:1069
5: std::io::Write::write_fmt
at src/libstd/io/mod.rs:1504
6: std::sys_common::backtrace::_print
at src/libstd/sys_common/backtrace.rs:62
7: std::sys_common::backtrace::print
at src/libstd/sys_common/backtrace.rs:49
8: std::panicking::default_hook::{{closure}}
at src/libstd/panicking.rs:198
9: std::panicking::default_hook
at src/libstd/panicking.rs:218
10: rustc_driver::report_ice
11: std::panicking::rust_panic_with_hook
at src/libstd/panicking.rs:515
12: rust_begin_unwind
at src/libstd/panicking.rs:419
13: std::panicking::begin_panic_fmt
at src/libstd/panicking.rs:373
14: rustc_middle::ty::query::on_disk_cache::OnDiskCache::new
15: rustc_incremental::persist::load::load_query_result_cache
16: rustc_interface::passes::create_global_ctxt
17: rustc_interface::queries::Queries::global_ctxt
18: rustc_interface::interface::run_compiler_in_existing_thread_pool
19: scoped_tls::ScopedKey::set
20: rustc_ast::attr::with_globals
note: Some details are omitted, run with RUST_BACKTRACE=full for a verbose backtrace.

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/blob/master/CONTRIBUTING.md#bug-reports

note: rustc 1.44.0 (49cae55 2020-06-01) running on x86_64-unknown-linux-gnu

note: compiler flags: -C debuginfo=2 -C incremental --crate-type lib

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

query stack during panic:
end of query stack
warning: 1 warning emitted

error: could not compile stick.

Caused by:
process didn't exit successfully: rustc --crate-name stick --edition=2018 src/lib.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type lib --emit=dep-info,metadata,link -C debuginfo=2 --cfg 'feature="default"' -C metadata=1889ceb89eb5ce80 -C extra-filename=-1889ceb89eb5ce80 --out-dir /home/aldaronlau/devel/stick/target/debug/deps -C incremental=/home/aldaronlau/devel/stick/target/debug/incremental -L dependency=/home/aldaronlau/devel/stick/target/debug/deps --extern smelling_salts=/home/aldaronlau/devel/stick/target/debug/deps/libsmelling_salts-51ee0fa6c978ca0c.rmeta (exit code: 101)

@AldaronLau AldaronLau changed the title ICE: ICE: Assert at src/librustc_middle/ty/query/on_disk_cache.rs:491:5 - Uncertain of cause (unreproducable) Jun 7, 2020
@LeSeulArtichaut LeSeulArtichaut added A-incr-comp Area: Incremental compilation E-needs-bisection Call for participation: This issue needs bisection: /~https://github.com/rust-lang/cargo-bisect-rustc E-needs-mcve Call for participation: This issue has a repro, but needs a Minimal Complete and Verifiable Example 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. C-bug Category: This is a bug. labels Jun 8, 2020
@Enselic
Copy link
Member

Enselic commented Aug 27, 2023

Triage: Without a way to reproduce, there is not much that can be done. Feel free to reopen if a way to reproduce is found.

@Enselic Enselic closed this as not planned Won't fix, can't repro, duplicate, stale Aug 27, 2023
@saethlin saethlin self-assigned this Apr 29, 2024
@saethlin saethlin reopened 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.

@AldaronLau
Copy link
Contributor Author

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.

In this specific case

a. There was no IDE used
b. Either Ext4 or BTRFS on most recent Fedora Linux in 2020 (I don't remember if I had switched to BTRFS yet)

@saethlin
Copy link
Member

Hm. Noted.

I should really get around to adding a system to snapshot the previous state of all source files so all incr comp bugs at least have a reproducer locally.

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. E-needs-bisection Call for participation: This issue needs bisection: /~https://github.com/rust-lang/cargo-bisect-rustc E-needs-mcve Call for participation: This issue has a repro, but needs a Minimal Complete and Verifiable Example 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

4 participants