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: found unstable fingerprints on test ui\associated-type-bounds\traits-assoc-type-macros.rs #83311

Closed
petrochenkov opened this issue Mar 20, 2021 · 12 comments
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) ❄️

Comments

@petrochenkov
Copy link
Contributor

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 petrochenkov added the C-bug Category: This is a bug. label Mar 20, 2021
@Aaron1011
Copy link
Member

@petrochenkov: I'm unable to reproduce this locally. Does this happen on the latest master?

@Aaron1011
Copy link
Member

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.

@petrochenkov
Copy link
Contributor Author

petrochenkov commented Mar 20, 2021

I'll try to reproduce this outside of the test suite and with #83314.

@petrochenkov
Copy link
Contributor Author

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.

bors added a commit to rust-lang-ci/rust that referenced this issue Mar 20, 2021
Debug-print result when an unstable fingerprint is detected

Helps with issues like rust-lang#83311

I had previously tried to do this in rust-lang#80692, but it had a significant performance impact (even though the code was never actually run). Hopefully, this will be better now that rust-lang#79100 has been merged.
@petrochenkov petrochenkov reopened this Apr 3, 2021
@petrochenkov
Copy link
Contributor Author

I'm seeing this error again after updating the compiler/library from upstream and rerunning the test suite.

@petrochenkov
Copy link
Contributor Author

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

@Aaron1011
Copy link
Member

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.

@petrochenkov
Copy link
Contributor Author

Status update: I haven't seen these errors recently.

@jyn514 jyn514 added A-incr-comp Area: Incremental compilation I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ labels May 19, 2021
@the8472
Copy link
Member

the8472 commented May 19, 2021

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

@Mark-Simulacrum
Copy link
Member

@pnkfelix
Copy link
Member

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.)

@petrochenkov
Copy link
Contributor Author

I haven't seen this issue for very long time despite still using the test suite regularly.

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) ❄️
Projects
None yet
Development

No branches or pull requests

6 participants