-
-
Notifications
You must be signed in to change notification settings - Fork 14.7k
VTable-related miscompilation with incremental compilation #89598
Copy link
Copy link
Closed
Labels
A-incr-compArea: Incremental compilationArea: Incremental compilationC-bugCategory: This is a bug.Category: This is a bug.I-unsoundIssue: A soundness hole (worst kind of bug), see: https://en.wikipedia.org/wiki/SoundnessIssue: A soundness hole (worst kind of bug), see: https://en.wikipedia.org/wiki/SoundnessP-criticalCritical priorityCritical priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.regression-from-stable-to-betaPerformance or correctness regression from stable to beta.Performance or correctness regression from stable to beta.
Milestone
Metadata
Metadata
Assignees
Labels
A-incr-compArea: Incremental compilationArea: Incremental compilationC-bugCategory: This is a bug.Category: This is a bug.I-unsoundIssue: A soundness hole (worst kind of bug), see: https://en.wikipedia.org/wiki/SoundnessIssue: A soundness hole (worst kind of bug), see: https://en.wikipedia.org/wiki/SoundnessP-criticalCritical priorityCritical priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.regression-from-stable-to-betaPerformance or correctness regression from stable to beta.Performance or correctness regression from stable to beta.
Type
Fields
Give feedbackNo fields configured for issues without a type.
PR #86475 introduced a global cache for vtable-layouts into the
tcxwhich 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.