-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Recover when attempting to force a query with unknown DefPathHash. #91741
Conversation
@bors try @rust-timer queue |
Awaiting bors try build completion. @rustbot label: +S-waiting-on-perf |
⌛ Trying commit 732dd13 with merge 7d7dd539439c1a9bcfe84fecb020cae61a1c2561... |
☀️ Try build successful - checks-actions |
Queued 7d7dd539439c1a9bcfe84fecb020cae61a1c2561 with parent 0b42dea, future comparison URL. |
Finished benchmarking commit (7d7dd539439c1a9bcfe84fecb020cae61a1c2561): comparison url. Summary: This benchmark run did not return any relevant changes. If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf. Benchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. While you can manually mark this PR as fit for rollup, we strongly recommend not doing so since this PR led to changes in compiler perf. @bors rollup=never |
Thanks a lot for PR and the investigation, @cjgillot! |
@Aaron1011 does this PR fix the issue you diagnosed in #91696 (comment)? Or is the ice simply moved somewhere else? Should we prefer wrapping try_load_from_on_disk_cache_in_memory in dep_graph.with_ignore? |
@cjgillot: Personally, I think silently suppressing this error is the wrong thing to do. Fixing the issue identified in #91696 (comment) should fix most of the cases of this - any remaining crashes will be a new issue which we'll want to be alerted of.
I think that would work, but I would prefer to avoid creating any new dep graph edges during the loading of queries. |
OK, so the conclusion here is that we should rather fix the (now identified) underlying issue, that is, that queries invoked during cache loading are not handled correctly, right? |
Print a backtrace when query forcing fails. The aim of this PR is to help debugging incremental compilation bugs where query forcing panics. For instance: rust-lang#90682 rust-lang#90697 rust-lang#90715 rust-lang#90739 rust-lang#91401 These bugs happen when the dep-graph attempts to force a dep-node whose fingerprint does not correspond to an actual DefPathHash. PR rust-lang#91741 attempts to hide this bug. I still don't know how to reproduce these bugs, so I sadly could not test this debugging device.
Print a backtrace when query forcing fails. The aim of this PR is to help debugging incremental compilation bugs where query forcing panics. For instance: rust-lang/rust#90682 rust-lang/rust#90697 rust-lang/rust#90715 rust-lang/rust#90739 rust-lang/rust#91401 These bugs happen when the dep-graph attempts to force a dep-node whose fingerprint does not correspond to an actual DefPathHash. PR rust-lang/rust#91741 attempts to hide this bug. I still don't know how to reproduce these bugs, so I sadly could not test this debugging device.
Print a backtrace when query forcing fails. The aim of this PR is to help debugging incremental compilation bugs where query forcing panics. For instance: rust-lang/rust#90682 rust-lang/rust#90697 rust-lang/rust#90715 rust-lang/rust#90739 rust-lang/rust#91401 These bugs happen when the dep-graph attempts to force a dep-node whose fingerprint does not correspond to an actual DefPathHash. PR rust-lang/rust#91741 attempts to hide this bug. I still don't know how to reproduce these bugs, so I sadly could not test this debugging device.
Print a backtrace when query forcing fails. The aim of this PR is to help debugging incremental compilation bugs where query forcing panics. For instance: rust-lang/rust#90682 rust-lang/rust#90697 rust-lang/rust#90715 rust-lang/rust#90739 rust-lang/rust#91401 These bugs happen when the dep-graph attempts to force a dep-node whose fingerprint does not correspond to an actual DefPathHash. PR rust-lang/rust#91741 attempts to hide this bug. I still don't know how to reproduce these bugs, so I sadly could not test this debugging device.
Fixes #90682
Fixes #90697
Fixes #90715
Fixes #90739
Fixes #91401
In the bugs above, the dep-graph attempts to force a dep-node whose DefPathHash is not known to the compiler. This causes an ICE because the query that refers to this DefPathHash should have been marked red.
This PR hides the bug by gracefully failing to force the query when this happens. I think this is the wrong solution to the problem. However, this has the merit of avoiding user-visible ICEs.
The right solution would be to find where the alien DefPathHash come from and to plug the information leak. I believe #85914 it responsible for a part.
r? @michaelwoerister