-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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: already have hash for FileMap(DefId {… #42101
Comments
(Do not upgrade yet because of rust-lang/rust#42101)
Same thing compiling clippy
|
Fix warning in a future compiler version. (Do not upgrade yet because of rust-lang/rust#42101) <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/16950) <!-- Reviewable:end -->
same thing happened
rustc 1.19.0-nightly (01951a6 2017-05-20) |
…servo:warn); r=nox (Do not upgrade yet because of rust-lang/rust#42101) Source-Repo: https://github.com/servo/servo Source-Revision: dbd4adf3b266fb8d02cb717bc255c04f0fe41c05 --HG-- extra : subtree_source : https%3A//hg.mozilla.org/projects/converted-servo-linear extra : subtree_revision : b024b9d4b46a80c7c8d69c4473cae0617613d68b
Thanks for the report. I'm looking into it. |
@donhcd @king6cong @CraZySacX could you post the command line and source code which triggers the ICE? |
…servo:warn); r=nox (Do not upgrade yet because of rust-lang/rust#42101) Source-Repo: https://github.com/servo/servo Source-Revision: dbd4adf3b266fb8d02cb717bc255c04f0fe41c05
So the problem here is that the code assumes that the file name uniquely identifies a There are several ways of solving this:
I've implemented a proof of concept of solution (3) and it makes the ICE go away in the case of Servo. But option (1) seems rather attractive, since it would allow for removing quite a bit of infrastructure that might not serve an actual purpose after all. We should try to determine whether including expanded spans into the HIR hash is a sufficient correctness condition (as in (1)) and not just a necessary one (as in (3)). |
I was about to make a PR implementing approach (1) when I found a problem with it: In a cross-crate scenario with crate One way to solve this would be to always include spans into metadata hashes. But that would make them more sensitive than they need to be. But maybe that's still the way to go. |
…x-1, r=nikomatsakis incr.comp.: Track expanded spans instead of FileMaps. This PR removes explicit tracking of FileMaps in response to rust-lang#42101. The reasoning behind being able to just *not* track access to FileMaps is similar to why we don't track access to the `DefId->DefPath` map: 1. One can only get ahold of a `Span` value by accessing the HIR (for local things) or a `metadata::schema::Entry` (for things from external crates). 2. For both of these things we compute a hash that incorporates the *expanded spans*, that is, what we hash is in the (FileMap independent) format `filename:line:col`. 3. Consequently, everything that emits a span should already be tracked via its dependency to something that has the span included in its hash and changes would be detected via that hash. One caveat here is that we have to be conservative when exporting things in metadata. A crate can be built without debuginfo and would thus by default not incorporate most spans into the metadata hashes. However, a downstream crate can make an inline copy of things in the upstream crate and span changes in the upstream crate would then go undetected, even if the downstream uses them (e.g. by emitting debuginfo for an inlined function). For this reason, we always incorporate spans into metadata hashes for now (there might be more efficient ways to handle this safely when red-green tracking is implemented). r? @nikomatsakis
…servo:warn); r=nox (Do not upgrade yet because of rust-lang/rust#42101) Source-Repo: https://github.com/servo/servo Source-Revision: dbd4adf3b266fb8d02cb717bc255c04f0fe41c05
…x-1, r=nikomatsakis incr.comp.: Track expanded spans instead of FileMaps. This PR removes explicit tracking of FileMaps in response to rust-lang#42101. The reasoning behind being able to just *not* track access to FileMaps is similar to why we don't track access to the `DefId->DefPath` map: 1. One can only get ahold of a `Span` value by accessing the HIR (for local things) or a `metadata::schema::Entry` (for things from external crates). 2. For both of these things we compute a hash that incorporates the *expanded spans*, that is, what we hash is in the (FileMap independent) format `filename:line:col`. 3. Consequently, everything that emits a span should already be tracked via its dependency to something that has the span included in its hash and changes would be detected via that hash. One caveat here is that we have to be conservative when exporting things in metadata. A crate can be built without debuginfo and would thus by default not incorporate most spans into the metadata hashes. However, a downstream crate can make an inline copy of things in the upstream crate and span changes in the upstream crate would then go undetected, even if the downstream uses them (e.g. by emitting debuginfo for an inlined function). For this reason, we always incorporate spans into metadata hashes for now (there might be more efficient ways to handle this safely when red-green tracking is implemented). r? @nikomatsakis
…x-1, r=nikomatsakis incr.comp.: Track expanded spans instead of FileMaps. This PR removes explicit tracking of FileMaps in response to rust-lang#42101. The reasoning behind being able to just *not* track access to FileMaps is similar to why we don't track access to the `DefId->DefPath` map: 1. One can only get ahold of a `Span` value by accessing the HIR (for local things) or a `metadata::schema::Entry` (for things from external crates). 2. For both of these things we compute a hash that incorporates the *expanded spans*, that is, what we hash is in the (FileMap independent) format `filename:line:col`. 3. Consequently, everything that emits a span should already be tracked via its dependency to something that has the span included in its hash and changes would be detected via that hash. One caveat here is that we have to be conservative when exporting things in metadata. A crate can be built without debuginfo and would thus by default not incorporate most spans into the metadata hashes. However, a downstream crate can make an inline copy of things in the upstream crate and span changes in the upstream crate would then go undetected, even if the downstream uses them (e.g. by emitting debuginfo for an inlined function). For this reason, we always incorporate spans into metadata hashes for now (there might be more efficient ways to handle this safely when red-green tracking is implemented). r? @nikomatsakis
…x-1, r=nikomatsakis incr.comp.: Track expanded spans instead of FileMaps. This PR removes explicit tracking of FileMaps in response to rust-lang#42101. The reasoning behind being able to just *not* track access to FileMaps is similar to why we don't track access to the `DefId->DefPath` map: 1. One can only get ahold of a `Span` value by accessing the HIR (for local things) or a `metadata::schema::Entry` (for things from external crates). 2. For both of these things we compute a hash that incorporates the *expanded spans*, that is, what we hash is in the (FileMap independent) format `filename:line:col`. 3. Consequently, everything that emits a span should already be tracked via its dependency to something that has the span included in its hash and changes would be detected via that hash. One caveat here is that we have to be conservative when exporting things in metadata. A crate can be built without debuginfo and would thus by default not incorporate most spans into the metadata hashes. However, a downstream crate can make an inline copy of things in the upstream crate and span changes in the upstream crate would then go undetected, even if the downstream uses them (e.g. by emitting debuginfo for an inlined function). For this reason, we always incorporate spans into metadata hashes for now (there might be more efficient ways to handle this safely when red-green tracking is implemented). r? @nikomatsakis
…matsakis incr.comp.: Track expanded spans instead of FileMaps. This PR removes explicit tracking of FileMaps in response to #42101. The reasoning behind being able to just *not* track access to FileMaps is similar to why we don't track access to the `DefId->DefPath` map: 1. One can only get ahold of a `Span` value by accessing the HIR (for local things) or a `metadata::schema::Entry` (for things from external crates). 2. For both of these things we compute a hash that incorporates the *expanded spans*, that is, what we hash is in the (FileMap independent) format `filename:line:col`. 3. Consequently, everything that emits a span should already be tracked via its dependency to something that has the span included in its hash and changes would be detected via that hash. One caveat here is that we have to be conservative when exporting things in metadata. A crate can be built without debuginfo and would thus by default not incorporate most spans into the metadata hashes. However, a downstream crate can make an inline copy of things in the upstream crate and span changes in the upstream crate would then go undetected, even if the downstream uses them (e.g. by emitting debuginfo for an inlined function). For this reason, we always incorporate spans into metadata hashes for now (there might be more efficient ways to handle this safely when red-green tracking is implemented). r? @nikomatsakis
Fixed by #42175, closing. |
…servo:warn); r=nox (Do not upgrade yet because of rust-lang/rust#42101) Source-Repo: https://github.com/servo/servo Source-Revision: dbd4adf3b266fb8d02cb717bc255c04f0fe41c05 UltraBlame original commit: f7050ffdfddb21a4b839f81b05bb356481fc4f7c
…servo:warn); r=nox (Do not upgrade yet because of rust-lang/rust#42101) Source-Repo: https://github.com/servo/servo Source-Revision: dbd4adf3b266fb8d02cb717bc255c04f0fe41c05 UltraBlame original commit: f7050ffdfddb21a4b839f81b05bb356481fc4f7c
…servo:warn); r=nox (Do not upgrade yet because of rust-lang/rust#42101) Source-Repo: https://github.com/servo/servo Source-Revision: dbd4adf3b266fb8d02cb717bc255c04f0fe41c05 UltraBlame original commit: f7050ffdfddb21a4b839f81b05bb356481fc4f7c
In Servo with rustc 1.19.0-nightly (0ed1ec9 2017-05-18), with incremental compilation enabled. (To reproduce, copy
servobuild.example
to.servobuild
and changeincremental = false
toincremental = true
.)The text was updated successfully, but these errors were encountered: