r214333 - Add a state variable to the loop hint attribute.

Aaron Ballman aaron at aaronballman.com
Fri Aug 1 05:30:11 PDT 2014


On Fri, Aug 1, 2014 at 8:09 AM, Kostya Serebryany <kcc at google.com> wrote:
> Looks like this change (or the one nearby) broke msan build
> http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-bootstrap/builds/4103/steps/check-clang%20msan/logs/stdio
>
> ==5554== WARNING: MemorySanitizer: use-of-uninitialized-value
>     #0 0x7fe687797e49 in
> clang::Parser::HandlePragmaLoopHint(clang::LoopHint&)
> /home/dtoolsbot/build/sanitizer-x86_64-linux-bootstrap/build/llvm/tools/clang/lib/Parse/ParsePragma.cpp:738:32
>     #1 0x7fe6877c3be6 in
> clang::Parser::ParsePragmaLoopHint(llvm::SmallVector<clang::Stmt*, 32u>&,
> bool, clang::SourceLocation*, clang::Parser::ParsedAttributesWithRange&)
> /home/dtoolsbot/build/sanitizer-x86_64-linux-bootstrap/build/llvm/tools/clang/lib/Parse/ParseStmt.cpp:1821:10
>     #2 0x7fe6877afb8f in
> clang::Parser::ParseStatementOrDeclarationAfterAttributes(llvm::SmallVector<clang::Stmt*,
> 32u>&, bool, clang::SourceLocation*,
> clang::Parser::ParsedAttributesWithRange&)
> /home/dtoolsbot/build/sanitizer-x86_64-linux-bootstrap/build/llvm/tools/clang/lib/Parse/ParseStmt.cpp:362:12
>     #3 0x7fe6877ad95e in
> clang::Parser::ParseStatementOrDeclaration(llvm::SmallVector<clang::Stmt*,
> 32u>&, bool, clang::SourceLocation*)
> /home/dtoolsbot/build/sanitizer-x86_64-linux-bootstrap/build/llvm/tools/clang/lib/Parse/ParseStmt.cpp:106:20
>     #4 0x7fe6877c7558 in clang::Parser::ParseCompoundStatementBody(bool)
> /home/dtoolsbot/build/sanitizer-x86_64-linux-bootstrap/build/llvm/tools/clang/lib/Parse/ParseStmt.cpp:938:11
>     #5 0x7fe6877c95d4 in
> clang::Parser::ParseFunctionStatementBody(clang::Decl*,
> clang::Parser::ParseScope&)
> /home/dtoolsbot/build/sanitizer-x86_64-linux-bootstrap/build/llvm/tools/clang/lib/Parse/ParseStmt.cpp:1857:21
>     #6 0x7fe68763e2a7 in
> clang::Parser::ParseFunctionDefinition(clang::ParsingDeclarator&,
> clang::Parser::ParsedTemplateInfo const&,
> clang::Parser::LateParsedAttrList*)
> /home/dtoolsbot/build/sanitizer-x86_64-linux-bootstrap/build/llvm/tools/clang/lib/Parse/Parser.cpp:1098:10
>     #7 0x7fe6876777de in
> clang::Parser::ParseDeclGroup(clang::ParsingDeclSpec&, unsigned int, bool,
> clang::SourceLocation*, clang::Parser::ForRangeInit*)
> /home/dtoolsbot/build/sanitizer-x86_64-linux-bootstrap/build/llvm/tools/clang/lib/Parse/ParseDecl.cpp:1588:11
>     #8 0x7fe68763bdab in
> clang::Parser::ParseDeclOrFunctionDefInternal(clang::Parser::ParsedAttributesWithRange&,
> clang::ParsingDeclSpec&, clang::AccessSpecifier)
> /home/dtoolsbot/build/sanitizer-x86_64-linux-bootstrap/build/llvm/tools/clang/lib/Parse/Parser.cpp:888:10
>     #9 0x7fe68763a740 in
> clang::Parser::ParseDeclarationOrFunctionDefinition(clang::Parser::ParsedAttributesWithRange&,
> clang::ParsingDeclSpec*, clang::AccessSpecifier)
> /home/dtoolsbot/build/sanitizer-x86_64-linux-bootstrap/build/llvm/tools/clang/lib/Parse/Parser.cpp:904:12
>     #10 0x7fe6876376ab in
> clang::Parser::ParseExternalDeclaration(clang::Parser::ParsedAttributesWithRange&,
> clang::ParsingDeclSpec*)
> /home/dtoolsbot/build/sanitizer-x86_64-linux-bootstrap/build/llvm/tools/clang/lib/Parse/Parser.cpp:762:12
>     #11 0x7fe68763497d in
> clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&)
> /home/dtoolsbot/build/sanitizer-x86_64-linux-bootstrap/build/llvm/tools/clang/lib/Parse/Parser.cpp:559:12
>     #12 0x7fe687625995 in clang::ParseAST(clang::Sema&, bool, bool)
> /home/dtoolsbot/build/sanitizer-x86_64-linux-bootstrap/build/llvm/tools/clang/lib/Parse/ParseAST.cpp:135:7
>     #13 0x7fe685a38c34 in clang::FrontendAction::Execute()
> /home/dtoolsbot/build/sanitizer-x86_64-linux-bootstrap/build/llvm/tools/clang/lib/Frontend/FrontendAction.cpp:415:8
>     #14 0x7fe6859a8f0e in
> clang::CompilerInstance::ExecuteAction(clang::FrontendAction&)
> /home/dtoolsbot/build/sanitizer-x86_64-linux-bootstrap/build/llvm/tools/clang/lib/Frontend/CompilerInstance.cpp:810:7
>     #15 0x7fe685bebc35 in
> clang::ExecuteCompilerInvocation(clang::CompilerInstance*)
> /home/dtoolsbot/build/sanitizer-x86_64-linux-bootstrap/build/llvm/tools/clang/lib/FrontendTool/ExecuteCompilerInvocation.cpp:222:18
>     #16 0x7fe68287db73 in cc1_main(char const**, char const**, char const*,
> void*)
> /home/dtoolsbot/build/sanitizer-x86_64-linux-bootstrap/build/llvm/tools/clang/tools/driver/cc1_main.cpp:112:13
>     #17 0x7fe6828780b2 in main
> /home/dtoolsbot/build/sanitizer-x86_64-linux-bootstrap/build/llvm/tools/clang/tools/driver/driver.cpp:318:14
>     #18 0x7fe680b46ec4 in __libc_start_main
> (/lib/x86_64-linux-gnu/libc.so.6+0x21ec4)
>     #19 0x7fe68287163c in _start
> (/home/dtoolsbot/build/sanitizer-x86_64-linux-bootstrap/build/llvm_build_msan/bin/clang-3.6+0x62163c)
>
>
> valgrind agrees:
>
> valgrind clang -cc1 -internal-isystem lib/clang/3.6.0/include -std=c++11
> -verify ~/llvm/tools/clang/test/Parser/pragma-unroll.cpp
> ==27791== Conditional jump or move depends on uninitialised value(s)
> ==27791==    at 0x1CF89EB:
> clang::Parser::HandlePragmaLoopHint(clang::LoopHint&)
> ==27791==    by 0x1D02AFA:
> clang::Parser::ParsePragmaLoopHint(llvm::SmallVector<clang::Stmt*, 32u>&,
> bool, clang::SourceLocation*, clang::Parser::ParsedAttributesWithRange&)
> ==27791==    by 0x1CFCE3B:
> clang::Parser::ParseStatementOrDeclarationAfterAttributes(llvm::SmallVector<clang::Stmt*,
> 32u>&, bool, clang::SourceLocation*,
> clang::Parser::ParsedAttributesWithRange&)

I don't have access to either a valgrind or a msan build, but I took a
stab in the dark with r214502. I'll see if the msan bot thinks I've
improved anything.

Thank you!

~Aaron



More information about the cfe-commits mailing list