This is an archive of the discontinued LLVM Phabricator instance.

[AST] Initialized data after TypeSourceInfo
ClosedPublic

Authored by vitalybuka on May 12 2023, 5:07 PM.

Details

Summary

There is no initialization of the data between allocation
and first getBeginLoc call.

allocation: llvm-project/clang/lib/AST/ASTContext.cpp:3022
use: llvm-project/clang/lib/AST/TypeLoc.cpp:222

Msan report https://reviews.llvm.org/P8306

Diff Detail

Event Timeline

vitalybuka created this revision.May 12 2023, 5:07 PM
Herald added a project: Restricted Project. · View Herald TranscriptMay 12 2023, 5:07 PM
vitalybuka requested review of this revision.May 12 2023, 5:07 PM
Herald added a project: Restricted Project. · View Herald TranscriptMay 12 2023, 5:07 PM
Herald added a subscriber: cfe-commits. · View Herald Transcript
vitalybuka edited the summary of this revision. (Show Details)May 12 2023, 5:09 PM
vitalybuka added reviewers: rjmccall, rsmith.

This memory is supposed to be initialized when we copy the TypeLoc. Are you observing that not happening?

This memory is supposed to be initialized when we copy the TypeLoc. Are you observing that not happening?

Yes. There is the msan report in the description.

vitalybuka added a reviewer: Restricted Project.May 18 2023, 1:17 PM

ping, any concerns regarding this patch?
i want to make MSAN stricter on our bot by reducing -O level

Oh, I rerun msan bot locally and it looked like issue dissipated, but I probably checked wrong logs.
So I enabled -Oz on the bot, to catch more bugs, but the issue is still there https://lab.llvm.org/buildbot/#/builders/5/builds/33926

Let's land this trivial fix, and if owners of the AST believe the root-cause is different, we can investigate later.

thurston accepted this revision.May 25 2023, 9:45 AM
This revision is now accepted and ready to land.May 25 2023, 9:45 AM
This revision was automatically updated to reflect the committed changes.