rust-lang / rust

Empowering everyone to build reliable and efficient software.
https://www.rust-lang.org
Other
99.09k stars 12.79k forks source link

dynamically check dep-graph write patterns #40305

Closed nikomatsakis closed 7 years ago

nikomatsakis commented 7 years ago

NB: Part of the roadmap issue on incremental compilation.

We should monitor the dep-graph reads/writes for various bad patterns that may lead to bugs in the output:

I tried this and ran into some problems. It's worth taking another stab. I am marking this as mentor -- I would be happy to work with someone who is interested in pursuing it. This will be a bit of an "exploratory" project, so the best thing would be contact me on IRC (nmatsakis; privmsg me and I'll respond as soon as I see it).

The first steps, however, would be to modify the DepTrackingMap, e.g. to "freeze" a key when get() returns None. I would probably do this tracking only if #[cfg(debug_assertions)] are enabled.

nikomatsakis commented 7 years ago

A previous branch that inserted some tombstones to prevent write-after-read: https://github.com/nikomatsakis/rust/tree/incr-comp-tombstone

nikomatsakis commented 7 years ago

we decided it would be better to just remove the bad methods, see https://github.com/rust-lang/rust/issues/40614