[PATCH] D136886: [clang] ASTImporter: Fix importing of va_list types and declarations

Vince Bridgers via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jan 26 18:00:33 PST 2023


vabridgers added a comment.

I've made a very simple reproducer for this crash, clang-tidy executes on an x86 machine. Requires aarch64 and/or arm support compiled in.

crashes - clang-tidy crash.cpp -checks="cert-dcl58-cpp" -- -target arm
crashes - clang-tidy crash.cpp -checks="cert-dcl58-cpp" -- -target aarch64
no crash - clang-tidy crash.cpp -checks="cert-dcl58-cpp" -- -target x86_64

crash.cpp ...

  namespace std {
  } // namespace std

The partial crash stack ...

  $ clang-tidy crash.cpp -checks="cert-dcl58-cpp" --  -target arm 
  clang-tidy: <root>/clang-tools-extra/clang-tidy/ClangTidyDiagnosticConsumer.cpp:178: clang::DiagnosticBuilder clang::tidy::ClangTidyContext::diag(llvm::StringRef, clang::SourceLocation, llvm::StringRef, clang::DiagnosticIDs::Level): Assertion `Loc.isValid()' failed.
  
  Stack dump:
  0.    Program arguments: clang-tidy crash.cpp -checks=cert-dcl58-cpp -- -target arm
  1.    <eof> parser at end of file
  2.    ASTMatcher: Processing 'cert-dcl58-cpp' against:
        CXXRecordDecl std::__va_list : <<invalid sloc>>
  --- Bound Nodes Begin ---
      decl - { CXXRecordDecl std::__va_list : <<invalid sloc>> }
      nmspc - { NamespaceDecl std : <<invalid sloc>> }
  --- Bound Nodes End ---
   #0 0x0000000006dcfe46 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) <root>/llvm/lib/Support/Unix/Signals.inc:567:22
   #1 0x0000000006dd0232 PrintStackTraceSignalHandler(void*) <root>/llvm/lib/Support/Unix/Signals.inc:641:1
   #2 0x0000000006dcde75 llvm::sys::RunSignalHandlers() <root>/llvm/lib/Support/Signals.cpp:104:20
   #3 0x0000000006dcf884 SignalHandler(int) <root>/llvm/lib/Support/Unix/Signals.inc:412:1
   #4 0x00007fa725903630 __restore_rt sigaction.c:0:0
   #5 0x00007fa722aac387 raise (/lib64/libc.so.6+0x36387)
   #6 0x00007fa722aada78 abort (/lib64/libc.so.6+0x37a78)
   #7 0x00007fa722aa51a6 __assert_fail_base (/lib64/libc.so.6+0x2f1a6)
   #8 0x00007fa722aa5252 (/lib64/libc.so.6+0x2f252)
   #9 0x0000000003132a80 clang::tidy::ClangTidyContext::diag(llvm::StringRef, clang::SourceLocation, llvm::StringRef, clang::DiagnosticIDs::Level) <root>/clang-tools-extra/clang-tidy/ClangTidyDiagnosticConsumer.cpp:179:17
  #10 0x000000000312ea92 clang::tidy::ClangTidyCheck::diag(clang::SourceLocation, llvm::StringRef, clang::DiagnosticIDs::Level) <root>/clang-tools-extra/clang-tidy/ClangTidyCheck.cpp:27:54
  #11 0x000000000269e015 clang::tidy::cert::DontModifyStdNamespaceCheck::check(clang::ast_matchers::MatchFinder::MatchResult const&) <root>/clang-tools-extra/clang-tidy/cert/DontModifyStdNamespaceCheck.cpp:121:10
  #12 0x000000000312eb96 clang::tidy::ClangTidyCheck::run(clang::ast_matchers::MatchFinder::MatchResult const&) <root>/clang-tools-extra/clang-tidy/ClangTidyCheck.cpp:46:1
  #13 0x0000000005873615 clang::ast_matchers::internal::(anonymous namespace)::MatchASTVisitor::MatchVisitor::visitMatch(clang::ast_matchers::BoundNodes const&) <root>/clang/lib/ASTMatchers/ASTMatchFinder.cpp:1260:34


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D136886/new/

https://reviews.llvm.org/D136886



More information about the cfe-commits mailing list