VTable-related miscompilation with incremental compilation #89598
Labels
A-incr-comp
Area: Incremental compilation
C-bug
Category: This is a bug.
I-unsound
Issue: A soundness hole (worst kind of bug), see: https://en.wikipedia.org/wiki/Soundness
P-critical
Critical priority
regression-from-stable-to-beta
Performance or correctness regression from stable to beta.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Milestone
PR #86475 introduced a global cache for vtable-layouts into the
tcx
which circumvents incremental compilation's dependency tracking. The effect is that object files might not get updated when methods within a trait get shuffled around, thus leading to miscompilations very similar to the one observed in #82920, i.e. trait object method calls will invoke the wrong method.The following test (when added to
src/test/incremental
) shows this behavior:Global caches without dependency tracking are a sure way of introducing subtle incr. comp. bugs. Queries must be used instead.
I'm going to mark this as
P-critical
. We should fix this asap.The text was updated successfully, but these errors were encountered: