ICE: found unstable fingerprints on test `ui\associated-type-bounds\traits-assoc-type-macros.rs`
Closed this issue · 12 comments
I tried this code:
Test ui\associated-type-bounds\traits-assoc-type-macros.rs.
<code>I expected to see this happen: test passes.
Instead, this happened:
stdout:
------------------------------------------
------------------------------------------
stderr:
------------------------------------------
thread 'rustc' panicked at 'found unstable fingerprints for proc_macro_decls_static(traits_assoc_type_macros[317d])', C:\msys64\home\we\rust\compiler\rustc_query_system\src\query\plumbing.rs:593: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/issues/new?labels=C-bug%2C+I-ICE%2C+T-compiler&template=ice.md
note: rustc 1.52.0-dev running on x86_64-pc-windows-gnu
note: compiler flags: -Z threads=1 -Z ui-testing -Z deduplicate-diagnostics=no -Z emit-future-incompat-report -Z unstable-options -C prefer-dynamic -C rpath -C debuginfo=0 -C link-args=-fuse-ld=lld -C incremental
query stack during panic:
#0 [proc_macro_decls_static] looking up the derive registrar for a crate
#1 [analysis] running analysis passes on this crate
end of query stack
thread 'rustc' panicked at 'found unstable fingerprints for opt_def_kind(traits_assoc_type_macros[317d]::main)', C:\msys64\home\we\rust\compiler\rustc_query_system\src\query\plumbing.rs:593:5
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.52.0-dev running on x86_64-pc-windows-gnu
note: compiler flags: -Z threads=1 -Z ui-testing -Z deduplicate-diagnostics=no -Z emit-future-incompat-report -Z unstable-options -C prefer-dynamic -C rpath -C debuginfo=0 -C link-args=-fuse-ld=lld -C incremental
query stack during panic:
#0 [opt_def_kind] looking up definition kind of `main`
#1 [codegen_fn_attrs] computing codegen attributes of `main`
end of query stack
------------------------------------------
Meta
rustc --version --verbose:
rustc 1.52.0-dev
binary: rustc
commit-hash: unknown
commit-date: unknown
host: x86_64-pc-windows-gnu
release: 1.52.0-dev
LLVM version: 12.0.0
Backtrace
@petrochenkov: I'm unable to reproduce this locally. Does this happen on the latest master?
That test file isn't even a proc-macro crate, so I have no idea how proc_macro_decls_static could ever return anything other than None.
I'll try to reproduce this outside of the test suite and with #83314.
After clearing incremental cache for this test I cannot reproduce this either.
Although there probably was some legit reason behind the cache being corrupted, the reproduction is now lost so closing the issue.
I'm seeing this error again after updating the compiler/library from upstream and rerunning the test suite.
Another one from src/test/ui/async-await/issues/issue-64964.rs (also disappears after removing the incremental directories):
thread '<unnamed>' panicked at 'Error reading cached dep-graph: "invalid enum variant tag while decoding `DepKind`, expected 0..249"', compiler/rustc_incremental/src/persist/load.rs:186:22
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/issues/new?labels=C-bug%2C+I-ICE%2C+T-compiler&template=ice.md
note: rustc 1.53.0-dev running on x86_64-pc-windows-gnu
note: compiler flags: -Z threads=1 -Z ui-testing -Z deduplicate-diagnostics=no -Z emit-future-incompat-report -Z unstable-options -Z query-dep-graph -C prefer-dynamic -C rpath -C debuginfo=0 -C link-args=-fuse-ld=lld -C incremental
query stack during panic:
end of query stack
warning: could not decode incremental cache: Any
warning: 1 warning emitted
The second issue seems like an issue with the incremental cache not getting invalidated when the compiler version is changed. Normally, that happens because the nightly compiler date changes, but I think it might not be happening with a locally built compiler (since the version suffix is always -dev). I don't think it has anything to do with the original issue.
Status update: I haven't seen these errors recently.
I saw these today after rebasing to f94942d but running ./x.py clean solved it.
ui test errors
---- [ui] ui/associated-type-bounds/traits-assoc-type-macros.rs stdout ----
error: test compilation failed although it shouldn't!
status: exit status: 101
command: "/home/the8472/workspace/rust/build/x86_64-unknown-linux-gnu/stage1/bin/rustc" "/home/the8472/workspace/rust/src/test/ui/associated-type-bounds/traits-assoc-type-macros.rs" "-Zthreads=1" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zemit-future-incompat-report" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/home/the8472/workspace/rust/build/x86_64-unknown-linux-gnu/test/ui/associated-type-bounds/traits-assoc-type-macros" "-A" "unused" "-Crpath" "-O" "-Cdebuginfo=0" "-Zunstable-options" "-Lnative=/home/the8472/workspace/rust/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-Clink-arg=-fuse-ld=lld" "-Clink-arg=-Wl,--threads=1" "-Cincremental=tmp/traits-assoc-type-macros" "-L" "/home/the8472/workspace/rust/build/x86_64-unknown-linux-gnu/test/ui/associated-type-bounds/traits-assoc-type-macros/auxiliary"
stdout:
------------------------------------------
------------------------------------------
stderr:
------------------------------------------
thread 'rustc' panicked at 'try_mark_previous_green() - Forcing the DepNode should have set its color', /home/the8472/workspace/rust/compiler/rustc_query_system/src/dep_graph/graph.rs:597:37
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/issues/new?labels=C-bug%2C+I-ICE%2C+T-compiler&template=ice.md
note: rustc 1.54.0-dev running on x86_64-unknown-linux-gnu
note: compiler flags: -Z threads=1 -Z ui-testing -Z deduplicate-diagnostics=no -Z emit-future-incompat-report -Z unstable-options -C codegen-units=1 -C prefer-dynamic -C rpath -C debuginfo=0 -C link-arg=-fuse-ld=lld -C link-arg=-Wl,--threads=1 -C incremental
query stack during panic:
#0 [analysis] running analysis passes on this crate
end of query stack
------------------------------------------
---- [ui] ui/async-await/issues/issue-64964.rs stdout ----
error: test compilation failed although it shouldn't!
status: exit status: 101
command: "/home/the8472/workspace/rust/build/x86_64-unknown-linux-gnu/stage1/bin/rustc" "/home/the8472/workspace/rust/src/test/ui/async-await/issues/issue-64964.rs" "-Zthreads=1" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zemit-future-incompat-report" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/home/the8472/workspace/rust/build/x86_64-unknown-linux-gnu/test/ui/async-await/issues/issue-64964" "-A" "unused" "-Crpath" "-O" "-Cdebuginfo=0" "-Zunstable-options" "-Lnative=/home/the8472/workspace/rust/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-Clink-arg=-fuse-ld=lld" "-Clink-arg=-Wl,--threads=1" "-Z" "query-dep-graph" "-C" "incremental=tmp/issue-64964" "--edition=2018" "-L" "/home/the8472/workspace/rust/build/x86_64-unknown-linux-gnu/test/ui/async-await/issues/issue-64964/auxiliary"
stdout:
------------------------------------------
------------------------------------------
stderr:
------------------------------------------
thread 'rustc' panicked at 'try_mark_previous_green() - Forcing the DepNode should have set its color', /home/the8472/workspace/rust/compiler/rustc_query_system/src/dep_graph/graph.rs:597:37
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/issues/new?labels=C-bug%2C+I-ICE%2C+T-compiler&template=ice.md
note: rustc 1.54.0-dev running on x86_64-unknown-linux-gnu
note: compiler flags: -Z threads=1 -Z ui-testing -Z deduplicate-diagnostics=no -Z emit-future-incompat-report -Z unstable-options -Z query-dep-graph -C codegen-units=1 -C prefer-dynamic -C rpath -C debuginfo=0 -C link-arg=-fuse-ld=lld -C link-arg=-Wl,--threads=1 -C incremental
query stack during panic:
#0 [analysis] running analysis passes on this crate
end of query stack
------------------------------------------
failures:
[ui] ui/associated-type-bounds/traits-assoc-type-macros.rs
[ui] ui/async-await/issues/issue-64964.rs
Also observed these today - https://gist.github.com/Mark-Simulacrum/00eb855785b8cd9d8a696eb9b8fc1317
A note: This bug has evolved quite a bit from its original filing.
Many of the reported issues are not specifically about fingerprints.
A common theme among them is that they are all problems that arise on the x.py test ui test suite.
A recent discussion with @Mark-Simulacrum leads us to think that this may be very specific to local rustc development, where you are actually changing the rustc binary, but our incremental compilation infrastructure isn't necessarily designed to handle that case with complete fidelity.
I am still trying to tease out the scope of this bug. It is of course not good to have these ICE's affecting our internal tests. But I want to resolve whether the problems witnessed here represent bugs that should be resolved in some way within rustc (such as by versioning the incremental metadata, and ensuring that all source code changes to the compiler force one to disregard past incremental artifacts), or if they should be solely resolved in a manner local to our test suite (i.e. via changes to rustbuild to clear out portions of tmp/ directory more aggressively in response to certain compiler rebuilds.)
I haven't seen this issue for very long time despite still using the test suite regularly.