Repository navigation
Closed
softdevteam/ykrustc
#152Labels
A-incr-compArea: Incremental compilationArea: Incremental compilationC-bugCategory: This is a bug.Category: This is a bug.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️P-highHigh priorityHigh priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.regression-from-stable-to-nightlyPerformance or correctness regression from stable to nightly.Performance or correctness regression from stable to nightly.
Description
Code
This happened while working on cg_clif.
Meta
rustc --version --verbose:
rustc 1.50.0-nightly (f4db9ffb2 2020-12-02)
binary: rustc
commit-hash: f4db9ffb22dfcb702dbdb2e0607cb91791866b57
commit-date: 2020-12-02
host: x86_64-unknown-linux-gnu
release: 1.50.0-nightly
Error output
Compiling rustc_codegen_cranelift v0.1.0 (/home/bjorn/Documenten/cg_clif3)
thread 'rustc' panicked at 'called `Option::unwrap()` on a `None` value', compiler/rustc_middle/src/ty/query/mod.rs:235:5
stack backtrace:
0: rust_begin_unwind
at /rustc/f4db9ffb22dfcb702dbdb2e0607cb91791866b57/library/std/src/panicking.rs:493:5
1: core::panicking::panic_fmt
at /rustc/f4db9ffb22dfcb702dbdb2e0607cb91791866b57/library/core/src/panicking.rs:92:14
2: core::panicking::panic
at /rustc/f4db9ffb22dfcb702dbdb2e0607cb91791866b57/library/core/src/panicking.rs:50:5
3: rustc_middle::ty::query::try_load_from_on_disk_cache
4: rustc_query_system::dep_graph::graph::DepGraph<K>::exec_cache_promotions
5: rustc_middle::dep_graph::<impl rustc_query_system::dep_graph::DepKind for rustc_middle::dep_graph::dep_node::DepKind>::with_deps
6: rustc_incremental::persist::save::save_in
7: rustc_data_structures::sync::join
8: rustc_middle::dep_graph::<impl rustc_query_system::dep_graph::DepKind for rustc_middle::dep_graph::dep_node::DepKind>::with_deps
9: rustc_incremental::persist::save::save_dep_graph
10: rustc_codegen_ssa::base::finalize_tcx
11: rustc_codegen_ssa::base::codegen_crate
12: <rustc_codegen_llvm::LlvmCodegenBackend as rustc_codegen_ssa::traits::backend::CodegenBackend>::codegen_crate
13: rustc_interface::queries::Queries::ongoing_codegen
14: rustc_interface::queries::<impl rustc_interface::interface::Compiler>::enter
15: rustc_span::with_source_map
16: scoped_tls::ScopedKey<T>::set
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/issues/new?labels=C-bug%2C+I-ICE%2C+T-compiler&template=ice.md
note: rustc 1.50.0-nightly (f4db9ffb2 2020-12-02) running on x86_64-unknown-linux-gnu
note: compiler flags: -Z run_dsymutil=no -C opt-level=3 -C embed-bitcode=no -C incremental -C link-arg=-Wl,-rpath=$ORIGIN/../lib --crate-type dylib
note: some of the compiler flags provided by cargo are hidden
query stack during panic:
end of query stack
thread '<unnamed>' panicked at 'assertion failed: `(left == right)`
left: `LLVMing`,
right: `Codegenning`', /rustc/f4db9ffb22dfcb702dbdb2e0607cb91791866b57/compiler/rustc_codegen_ssa/src/back/write.rs:1425:21
stack backtrace:
0: rust_begin_unwind
at /rustc/f4db9ffb22dfcb702dbdb2e0607cb91791866b57/library/std/src/panicking.rs:493:5
1: core::panicking::panic_fmt
at /rustc/f4db9ffb22dfcb702dbdb2e0607cb91791866b57/library/core/src/panicking.rs:92:14
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/issues/new?labels=C-bug%2C+I-ICE%2C+T-compiler&template=ice.md
note: rustc 1.50.0-nightly (f4db9ffb2 2020-12-02) running on x86_64-unknown-linux-gnu
note: compiler flags: -Z run_dsymutil=no -C opt-level=3 -C embed-bitcode=no -C incremental -C link-arg=-Wl,-rpath=$ORIGIN/../lib --crate-type dylib
note: some of the compiler flags provided by cargo are hidden
query stack during panic:
end of query stack
error: could not compile `rustc_codegen_cranelift`
To learn more, run the command again with --verbose.
Metadata
Metadata
Assignees
Labels
A-incr-compArea: Incremental compilationArea: Incremental compilationC-bugCategory: This is a bug.Category: This is a bug.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️P-highHigh priorityHigh priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.regression-from-stable-to-nightlyPerformance or correctness regression from stable to nightly.Performance or correctness regression from stable to nightly.
Activity
bjorn3 commentedon Dec 3, 2020
Removing the incremental cache fixed the issue.
bjorn3 commentedon Dec 3, 2020
Just saw this again.
bjorn3 commentedon Dec 3, 2020
I have hit this like 10 times now.
wesleywiser commentedon Dec 3, 2020
Would you be able to push your changes to a branch or tag so we can try to repro? Thanks!
bjorn3 commentedon Dec 3, 2020
This is bjorn3/rustc_codegen_cranelift@d95d03a with the following patch:
The first time I hit this I think it was with just that patch. I have been working on bytecodealliance/wasmtime#2403 though and patched cg_clif to use a local checkout. This is something like bytecodealliance/wasmtime@2fea300. I don't have any clear instructions to reproduce it, but I have seen it quite often today.
poliorcetics commentedon Dec 3, 2020
The line in question is currently
rustc_cached_queries!(try_load_from_on_disk_cache!);, removing cache seems like the recommandable workaround for now, as you said earlier.jyn514 commentedon Dec 3, 2020
I ran into this running
x.py clippyon 0ad3dce with clippy versionclippy 0.0.212 (f4db9ff 2020-12-02).matthiaskrgr commentedon Dec 3, 2020
I see this on ci for my
cargo-cachecrate as well but I didn't manage to reproduce locally yet.EDIT:
rustc 1.50.0-nightly (6645da366 2020-12-01)seems to be the first affected nightly according to my ci-logEDIT2: in the commit range between this one and previous nightly (
git log b7ebc6b0c..6645da366 --merges), #74967 seems suspicious as it touches incremental compilation.vext01 commentedon Dec 4, 2020
I'm getting this on ykrustc too. We last synced with upstream rust on December 3rd.
It only seems to happen on an incremental build (i.e. not on a fresh build). I was able to trigger the error by adding more and more
dbg!("x")lines and rebuilding until it crashed.1 remaining item
Aaron1011 commentedon Dec 4, 2020
I'm not able to reproduce this locally.
@bjorn3 Could you try to write a script that reproduces this crash with
rustc_codegen_cranelift?jyn514 commentedon Dec 4, 2020
@Aaron1011 can you reproduce it using clippy? #79661 (comment)
Aaron1011 commentedon Dec 4, 2020
I managed to reproduce this using cloud-hypervisor/cloud-hypervisor#2032
Aaron1011 commentedon Dec 4, 2020
I've fixed the issue locally, and I'm working on a PR.
Properly re-use def path hash in incremental mode
hameerabbasi commentedon Dec 6, 2020
Labelling
P-highas discussed.Update rust-toolchain