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

make incremental ICEs more informative #119317

Open
matthiaskrgr opened this issue Dec 26, 2023 · 1 comment
Open

make incremental ICEs more informative #119317

matthiaskrgr opened this issue Dec 26, 2023 · 1 comment
Labels
A-diagnostics Area: Messages for errors, warnings, and lints A-incr-comp Area: Incremental compilation T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. WG-incr-comp Working group: Incremental compilation

Comments

@matthiaskrgr
Copy link
Member

We are getting a couple of "compiler crashed spuriously due to incr comp, not reproducible" ICEs every week for years now.
https://github.com/rust-lang/rust/issues?q=is%3Aopen+is%3Aissue+label%3AA-incr-comp

I wonder if we can print more data during/before the ice, if it occurs, to help us track down what the actual problem is.
So far the various stacktraces have not been too helpful without a clear reproducer afaik.
A similar approach made for a parallel compiler deadlock had great success #118169

@matthiaskrgr matthiaskrgr added A-incr-comp Area: Incremental compilation WG-incr-comp Working group: Incremental compilation labels Dec 26, 2023
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Dec 26, 2023
@bjorn3
Copy link
Member

bjorn3 commented Dec 26, 2023

To take a random incr comp ice (#118007), I don't think there is much we can do to make it more informative. The issue here is exactly that rustc doesn't have enough knowledge to turn the fingerprint 7290871ab612167b-16c2654baa403be5 back into a DefId for which we could print something human readable. And for another (#117665) the newly computed query result was different from the cached version even though all deps are identical. We can and do show the newly computed result, but the old result isn't stored anywhere. Only the fingerprint of the result is stored in the query cache. In fact for this specific query we don't even permanently store the result during the current compilation session. It is stolen by one of the passes that transforms MIR before MIR optimization.

In both cases it is likely that we are forgetting to track some state that influences the query result.

And finally for #114640 there is already a PR open to fix it (#109050, but no agreement about if it is the right way to fix it from what I can tell.

There could be incr comp issues where more informative ICE messages are informative though. I haven't looked through the entire list of incr comp issues.

@jieyouxu jieyouxu added A-diagnostics Area: Messages for errors, warnings, and lints T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. and removed needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. labels Feb 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-diagnostics Area: Messages for errors, warnings, and lints A-incr-comp Area: Incremental compilation T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. WG-incr-comp Working group: Incremental compilation
Projects
None yet
Development

No branches or pull requests

4 participants