Repository navigation
Closed
Labels
A-incr-compArea: Incremental compilationArea: Incremental compilationC-bugCategory: This is a bug.Category: This is a bug.E-needs-testCall for participation: An issue has been fixed and does not reproduce, but no test has been added.Call for participation: An issue has been fixed and does not reproduce, but no test has been added.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️P-mediumMedium priorityMedium 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.glacierICE tracked in rust-lang/glacier.ICE tracked in rust-lang/glacier.
Description
Steps to reproduce:
% mkdir temp
% cd temp
% touch lib.rs
% rustc +nightly lib.rs --crate-type=lib -C incremental=incr
% rustc +nightly lib.rs --crate-type=lib -C incremental=incr -C save-temps
thread '<unnamed>' panicked at 'assertion failed: `(left == right)`
left: `false`,
right: `true`', src/librustc_codegen_ssa/back/write.rs:872:5
note: run with `RUST_BACKTRACE=1` environment variable to display a 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.40.0-nightly (50f8aadd7 2019-11-07) running on x86_64-unknown-linux-gnu
note: compiler flags: -C incremental -C save-temps --crate-type lib
thread '<unnamed>' panicked at 'src/librustc_codegen_ssa/back/write.rs:1488: worker thread panicked', src/librustc/util/bug.rs:37:26
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.40.0-nightly (50f8aadd7 2019-11-07) running on x86_64-unknown-linux-gnu
note: compiler flags: -C incremental -C save-temps --crate-type lib
thread 'rustc' panicked at 'src/librustc_codegen_ssa/back/write.rs:1758: panic during codegen/LLVM phase', src/librustc/util/bug.rs:\
37:26
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.40.0-nightly (50f8aadd7 2019-11-07) running on x86_64-unknown-linux-gnu
note: compiler flags: -C incremental -C save-temps --crate-type lib
Metadata
Metadata
Assignees
Labels
A-incr-compArea: Incremental compilationArea: Incremental compilationC-bugCategory: This is a bug.Category: This is a bug.E-needs-testCall for participation: An issue has been fixed and does not reproduce, but no test has been added.Call for participation: An issue has been fixed and does not reproduce, but no test has been added.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️P-mediumMedium priorityMedium 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.glacierICE tracked in rust-lang/glacier.ICE tracked in rust-lang/glacier.
Activity
pnkfelix commentedon Nov 13, 2019
(the workaround is to make sure you start with
-C save-tempsin your initial command line. I assume you need to subsequently keep it around to avoid another ICE, but I have not verified that.)pnkfelix commentedon Dec 23, 2019
(also, the reported "compiler flags" in the diagnostic says
-C incrementalwhen the actual option was-C incremental=incr. A subtle difference but I bet it would mean the world to some people trying to debug something...)pnkfelix commentedon Dec 23, 2019
The panic is due to this assert failure in
execute_copy_from_cache_work_item:rust/src/librustc_codegen_ssa/back/write.rs
Line 868 in a916ac2
My first instinct was to try to revise the logic so that we would force the code generation of the bytecode when
-C save-tempsis added to the command line.But after thinking about it more, I do not think that is the appropriate fix. Someone adding
-C save-tempsprobably is trying to understand the current compiler invocation. Having-C save-tempscause it to go through significantly new code paths (i.e. generating new code when previously it would have just reused existing object files) does not sound right to me.So the question is, what is the correct fix here?
I can imagine:
@michaelwoerister , any thoughts here? And also cc @alexcrichton, whom I believe is the source for these assertions way back in 8197a0b
alexcrichton commentedon Jan 6, 2020
I would agree that the intention of
save-tempsis "just don't delete temporary files you would otherwise delete" and is really only used for debugging. In that sense I think it's fine to basically get rid of this assert personally.michaelwoerister commentedon Jan 13, 2020
Getting rid of the assertion seems fine.
JohnTitor commentedon May 6, 2020
The assertion was removed by #71754.
Enselic commentedon Aug 24, 2023
Triage: Seems quite easy to add a regression test for this ICE so it can be closed. See
./tests/incrementalfor examples of incremental tests.@rustbot label E-needs-test
zakrad commentedon Aug 8, 2026
@rustbot claim
Rollup merge of rust-lang#160781 - zakrad:regr-test-66367, r=mejrs
Rollup merge of rust-lang#160781 - zakrad:regr-test-66367, r=mejrs
Rollup merge of rust-lang#160781 - zakrad:regr-test-66367, r=mejrs
Unrolled build for #160781