Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Support] Validate number of arguments passed to formatv() #105745

Merged
merged 1 commit into from
Aug 29, 2024

Conversation

jurahul
Copy link
Contributor

@jurahul jurahul commented Aug 22, 2024

Change formatv() to validate that the number of arguments passed matches number of
replacement fields in the format string, and that the replacement indices do not contain
holes.

To support cases where this cannot be guaranteed, introduce a formatv() variant that does not
do this validation (called formatvv()).

Fixed existing issues found by this validation.

@jurahul jurahul force-pushed the formatv_errorcheck branch 5 times, most recently from d834ebb to 9ae8a03 Compare August 27, 2024 15:21
@jurahul jurahul requested review from d0k and joker-eph August 27, 2024 19:51
@jurahul jurahul marked this pull request as ready for review August 27, 2024 19:52
@llvmbot llvmbot added clang Clang issues not falling into any other category lldb clang:static analyzer mlir:core MLIR Core Infrastructure debuginfo mlir:llvm mlir:spirv mlir llvm:support labels Aug 27, 2024
@joker-eph
Copy link
Collaborator

CI failed FYI.

@llvmbot
Copy link
Collaborator

llvmbot commented Aug 27, 2024

@llvm/pr-subscribers-llvm-support
@llvm/pr-subscribers-mlir-core
@llvm/pr-subscribers-mlir
@llvm/pr-subscribers-clang
@llvm/pr-subscribers-clang-static-analyzer-1
@llvm/pr-subscribers-debuginfo

@llvm/pr-subscribers-lldb

Author: Rahul Joshi (jurahul)

Changes
  • Change formatv() to validate that the number of arguments passed matches number of
    replacement fields in the format string.
  • When the format string is a literal, this failure can be easily fixed, but when it's dynamically
    generated, it may not be as straightforward.
  • So changed existing formatv() to only accept literal strings as a format string and enable
    argument count validation for that case only.
  • Add a formatvv variant that allows non-literal format strings and disables argument count
    verification (the additional v will stand for "variable format string").

Patch is 39.55 KiB, truncated to 20.00 KiB below, full version: https://github.com/llvm/llvm-project/pull/105745.diff

15 Files Affected:

  • (modified) clang/lib/StaticAnalyzer/Checkers/CheckPlacementNew.cpp (+1-1)
  • (modified) clang/lib/StaticAnalyzer/Checkers/StdLibraryFunctionsChecker.cpp (+1-1)
  • (modified) lldb/source/Plugins/SymbolFile/DWARF/DWARFUnit.cpp (+1-1)
  • (modified) llvm/include/llvm/Support/FormatVariadic.h (+37-17)
  • (modified) llvm/lib/DebugInfo/DWARF/DWARFVerifier.cpp (+1-2)
  • (modified) llvm/lib/ExecutionEngine/Orc/CompileOnDemandLayer.cpp (+4-4)
  • (modified) llvm/lib/Support/FormatVariadic.cpp (+102-70)
  • (modified) llvm/tools/llvm-pdbutil/ExplainOutputStyle.cpp (+2-2)
  • (modified) llvm/unittests/Support/FormatVariadicTest.cpp (+86-29)
  • (modified) llvm/utils/TableGen/IntrinsicEmitter.cpp (+2-2)
  • (modified) mlir/tools/mlir-linalg-ods-gen/mlir-linalg-ods-yaml-gen.cpp (+2-2)
  • (modified) mlir/tools/mlir-tblgen/LLVMIRConversionGen.cpp (+1-1)
  • (modified) mlir/tools/mlir-tblgen/OpDefinitionsGen.cpp (+6-7)
  • (modified) mlir/tools/mlir-tblgen/OpFormatGen.cpp (+6-8)
  • (modified) mlir/tools/mlir-tblgen/SPIRVUtilsGen.cpp (+1-2)
diff --git a/clang/lib/StaticAnalyzer/Checkers/CheckPlacementNew.cpp b/clang/lib/StaticAnalyzer/Checkers/CheckPlacementNew.cpp
index 99e11a15c08dc2..1b89951397cfb1 100644
--- a/clang/lib/StaticAnalyzer/Checkers/CheckPlacementNew.cpp
+++ b/clang/lib/StaticAnalyzer/Checkers/CheckPlacementNew.cpp
@@ -131,7 +131,7 @@ bool PlacementNewChecker::checkPlaceCapacityIsSufficient(
             "Storage provided to placement new is only {0} bytes, "
             "whereas the allocated array type requires more space for "
             "internal needs",
-            SizeOfPlaceCI->getValue(), SizeOfTargetCI->getValue()));
+            SizeOfPlaceCI->getValue()));
       else
         Msg = std::string(llvm::formatv(
             "Storage provided to placement new is only {0} bytes, "
diff --git a/clang/lib/StaticAnalyzer/Checkers/StdLibraryFunctionsChecker.cpp b/clang/lib/StaticAnalyzer/Checkers/StdLibraryFunctionsChecker.cpp
index 8f4bd17afc8581..60c035612dcd44 100644
--- a/clang/lib/StaticAnalyzer/Checkers/StdLibraryFunctionsChecker.cpp
+++ b/clang/lib/StaticAnalyzer/Checkers/StdLibraryFunctionsChecker.cpp
@@ -1401,7 +1401,7 @@ void StdLibraryFunctionsChecker::checkPostCall(const CallEvent &Call,
         ErrnoNote =
             llvm::formatv("After calling '{0}' {1}", FunctionName, ErrnoNote);
     } else {
-      CaseNote = llvm::formatv(Case.getNote().str().c_str(), FunctionName);
+      CaseNote = llvm::formatvv(Case.getNote().str().c_str(), FunctionName);
     }
     const SVal RV = Call.getReturnValue();
 
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFUnit.cpp b/lldb/source/Plugins/SymbolFile/DWARF/DWARFUnit.cpp
index feb72f6244a18c..cdb266f70f0e3e 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFUnit.cpp
+++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFUnit.cpp
@@ -655,7 +655,7 @@ DWARFUnit::GetDIE(dw_offset_t die_offset) {
 
   if (!ContainsDIEOffset(die_offset)) {
     GetSymbolFileDWARF().GetObjectFile()->GetModule()->ReportError(
-        "GetDIE for DIE {0:x16} is outside of its CU {0:x16}", die_offset,
+        "GetDIE for DIE {0:x16} is outside of its CU {1:x16}", die_offset,
         GetOffset());
     return DWARFDIE(); // Not found
   }
diff --git a/llvm/include/llvm/Support/FormatVariadic.h b/llvm/include/llvm/Support/FormatVariadic.h
index 595f2cf559a428..b42e24646b31b5 100644
--- a/llvm/include/llvm/Support/FormatVariadic.h
+++ b/llvm/include/llvm/Support/FormatVariadic.h
@@ -66,24 +66,24 @@ struct ReplacementItem {
 class formatv_object_base {
 protected:
   StringRef Fmt;
+  bool Validate;
   ArrayRef<support::detail::format_adapter *> Adapters;
 
-  static bool consumeFieldLayout(StringRef &Spec, AlignStyle &Where,
-                                 size_t &Align, char &Pad);
-
-  static std::pair<ReplacementItem, StringRef>
-  splitLiteralAndReplacement(StringRef Fmt);
-
-  formatv_object_base(StringRef Fmt,
+  formatv_object_base(StringRef Fmt, bool Validate,
                       ArrayRef<support::detail::format_adapter *> Adapters)
-      : Fmt(Fmt), Adapters(Adapters) {}
+      : Fmt(Fmt), Validate(Validate), Adapters(Adapters) {}
 
   formatv_object_base(formatv_object_base const &rhs) = delete;
   formatv_object_base(formatv_object_base &&rhs) = default;
 
 public:
   void format(raw_ostream &S) const {
-    for (auto &R : parseFormatString(Fmt)) {
+    const auto [Replacements, IsValid] =
+        parseFormatString(S, Fmt, Adapters.size(), Validate);
+    if (!IsValid)
+      return;
+
+    for (const auto &R : Replacements) {
       if (R.Type == ReplacementType::Empty)
         continue;
       if (R.Type == ReplacementType::Literal) {
@@ -101,9 +101,13 @@ class formatv_object_base {
       Align.format(S, R.Options);
     }
   }
-  static SmallVector<ReplacementItem, 2> parseFormatString(StringRef Fmt);
 
-  static std::optional<ReplacementItem> parseReplacementItem(StringRef Spec);
+  // Parse format string and return the array of replacement items. If there is
+  // an error in the format string, return false for the second member of the
+  // pair, and print the error message to `S`.
+  static std::pair<SmallVector<ReplacementItem, 2>, bool>
+  parseFormatString(raw_ostream &S, StringRef Fmt, size_t NumArgs,
+                    bool Validate);
 
   std::string str() const {
     std::string Result;
@@ -149,8 +153,8 @@ template <typename Tuple> class formatv_object : public formatv_object_base {
   };
 
 public:
-  formatv_object(StringRef Fmt, Tuple &&Params)
-      : formatv_object_base(Fmt, ParameterPointers),
+  formatv_object(StringRef Fmt, bool ValidateNumArgs, Tuple &&Params)
+      : formatv_object_base(Fmt, ValidateNumArgs, ParameterPointers),
         Parameters(std::move(Params)) {
     ParameterPointers = std::apply(create_adapters(), Parameters);
   }
@@ -174,7 +178,7 @@ template <typename Tuple> class formatv_object : public formatv_object_base {
 //
 // rep_field ::= "{" index ["," layout] [":" format] "}"
 // index     ::= <non-negative integer>
-// layout    ::= [[[char]loc]width]
+// layout    ::= [[[pad]loc]width]
 // format    ::= <any string not containing "{" or "}">
 // char      ::= <any character except "{" or "}">
 // loc       ::= "-" | "=" | "+"
@@ -187,7 +191,7 @@ template <typename Tuple> class formatv_object : public formatv_object_base {
 // format  - A type-dependent string used to provide additional options to
 //           the formatting operation.  Refer to the documentation of the
 //           various individual format providers for per-type options.
-// char    - The padding character.  Defaults to ' ' (space).  Only valid if
+// pad    - The padding character.  Defaults to ' ' (space).  Only valid if
 //           `loc` is also specified.
 // loc     - Where to print the formatted text within the field.  Only valid if
 //           `width` is also specified.
@@ -247,6 +251,8 @@ template <typename Tuple> class formatv_object : public formatv_object_base {
 // assertion.  Otherwise, it will try to do something reasonable, but in general
 // the details of what that is are undefined.
 //
+
+// formatv() with validation enabled.
 template <typename... Ts>
 inline auto formatv(const char *Fmt, Ts &&...Vals)
     -> formatv_object<decltype(std::make_tuple(
@@ -254,8 +260,22 @@ inline auto formatv(const char *Fmt, Ts &&...Vals)
   using ParamTuple = decltype(std::make_tuple(
       support::detail::build_format_adapter(std::forward<Ts>(Vals))...));
   return formatv_object<ParamTuple>(
-      Fmt, std::make_tuple(support::detail::build_format_adapter(
-               std::forward<Ts>(Vals))...));
+      Fmt, /*Validate=*/true,
+      std::make_tuple(
+          support::detail::build_format_adapter(std::forward<Ts>(Vals))...));
+}
+
+// formatvv() perform no argument/format string validation.
+template <typename... Ts>
+inline auto formatvv(const char *Fmt, Ts &&...Vals)
+    -> formatv_object<decltype(std::make_tuple(
+        support::detail::build_format_adapter(std::forward<Ts>(Vals))...))> {
+  using ParamTuple = decltype(std::make_tuple(
+      support::detail::build_format_adapter(std::forward<Ts>(Vals))...));
+  return formatv_object<ParamTuple>(
+      Fmt, /*Validate=*/false,
+      std::make_tuple(
+          support::detail::build_format_adapter(std::forward<Ts>(Vals))...));
 }
 
 } // end namespace llvm
diff --git a/llvm/lib/DebugInfo/DWARF/DWARFVerifier.cpp b/llvm/lib/DebugInfo/DWARF/DWARFVerifier.cpp
index 77e8ece9439cf9..eb2751ab30ac50 100644
--- a/llvm/lib/DebugInfo/DWARF/DWARFVerifier.cpp
+++ b/llvm/lib/DebugInfo/DWARF/DWARFVerifier.cpp
@@ -1518,8 +1518,7 @@ DWARFVerifier::verifyNameIndexAbbrevs(const DWARFDebugNames::NameIndex &NI) {
         error() << formatv("NameIndex @ {0:x}: Indexing multiple compile units "
                            "and abbreviation {1:x} has no DW_IDX_compile_unit "
                            "or DW_IDX_type_unit attribute.\n",
-                           NI.getUnitOffset(), Abbrev.Code,
-                           dwarf::DW_IDX_compile_unit);
+                           NI.getUnitOffset(), Abbrev.Code);
       });
       ++NumErrors;
     }
diff --git a/llvm/lib/ExecutionEngine/Orc/CompileOnDemandLayer.cpp b/llvm/lib/ExecutionEngine/Orc/CompileOnDemandLayer.cpp
index 6448adaa0ceb36..49f239b73e8a01 100644
--- a/llvm/lib/ExecutionEngine/Orc/CompileOnDemandLayer.cpp
+++ b/llvm/lib/ExecutionEngine/Orc/CompileOnDemandLayer.cpp
@@ -348,10 +348,10 @@ void CompileOnDemandLayer::emitPartition(
             HC = hash_combine(HC, hash_combine_range(GVName.begin(), GVName.end()));
           }
           raw_string_ostream(SubModuleName)
-            << ".submodule."
-            << formatv(sizeof(size_t) == 8 ? "{0:x16}" : "{0:x8}",
-                       static_cast<size_t>(HC))
-            << ".ll";
+              << ".submodule."
+              << formatv(sizeof(size_t) == 8 ? "{0:x16}" : "{0:x8}",
+                         static_cast<size_t>(HC))
+              << ".ll";
         }
 
         // Extract the requested partiton (plus any necessary aliases) and
diff --git a/llvm/lib/Support/FormatVariadic.cpp b/llvm/lib/Support/FormatVariadic.cpp
index e25d036cdf1e8c..f86c0d05b5d6b3 100644
--- a/llvm/lib/Support/FormatVariadic.cpp
+++ b/llvm/lib/Support/FormatVariadic.cpp
@@ -6,8 +6,10 @@
 //===----------------------------------------------------------------------===//
 
 #include "llvm/Support/FormatVariadic.h"
+#include "llvm/ADT/SmallSet.h"
 #include <cassert>
 #include <optional>
+#include <variant>
 
 using namespace llvm;
 
@@ -25,8 +27,8 @@ static std::optional<AlignStyle> translateLocChar(char C) {
   LLVM_BUILTIN_UNREACHABLE;
 }
 
-bool formatv_object_base::consumeFieldLayout(StringRef &Spec, AlignStyle &Where,
-                                             size_t &Align, char &Pad) {
+static bool consumeFieldLayout(StringRef &Spec, AlignStyle &Where,
+                               size_t &Align, char &Pad) {
   Where = AlignStyle::Right;
   Align = 0;
   Pad = ' ';
@@ -35,8 +37,7 @@ bool formatv_object_base::consumeFieldLayout(StringRef &Spec, AlignStyle &Where,
 
   if (Spec.size() > 1) {
     // A maximum of 2 characters at the beginning can be used for something
-    // other
-    // than the width.
+    // other than the width.
     // If Spec[1] is a loc char, then Spec[0] is a pad char and Spec[2:...]
     // contains the width.
     // Otherwise, if Spec[0] is a loc char, then Spec[1:...] contains the width.
@@ -55,8 +56,8 @@ bool formatv_object_base::consumeFieldLayout(StringRef &Spec, AlignStyle &Where,
   return !Failed;
 }
 
-std::optional<ReplacementItem>
-formatv_object_base::parseReplacementItem(StringRef Spec) {
+static std::variant<ReplacementItem, StringRef>
+parseReplacementItem(StringRef Spec) {
   StringRef RepString = Spec.trim("{}");
 
   // If the replacement sequence does not start with a non-negative integer,
@@ -67,14 +68,12 @@ formatv_object_base::parseReplacementItem(StringRef Spec) {
   StringRef Options;
   size_t Index = 0;
   RepString = RepString.trim();
-  if (RepString.consumeInteger(0, Index)) {
-    assert(false && "Invalid replacement sequence index!");
-    return ReplacementItem{};
-  }
+  if (RepString.consumeInteger(0, Index))
+    return "Invalid replacement sequence index!";
   RepString = RepString.trim();
   if (RepString.consume_front(",")) {
     if (!consumeFieldLayout(RepString, Where, Align, Pad))
-      assert(false && "Invalid replacement field layout specification!");
+      return "Invalid replacement field layout specification!";
   }
   RepString = RepString.trim();
   if (RepString.consume_front(":")) {
@@ -82,77 +81,110 @@ formatv_object_base::parseReplacementItem(StringRef Spec) {
     RepString = StringRef();
   }
   RepString = RepString.trim();
-  if (!RepString.empty()) {
-    assert(false && "Unexpected characters found in replacement string!");
-  }
-
+  if (!RepString.empty())
+    return "Unexpected character found in replacement string!";
   return ReplacementItem{Spec, Index, Align, Where, Pad, Options};
 }
 
-std::pair<ReplacementItem, StringRef>
-formatv_object_base::splitLiteralAndReplacement(StringRef Fmt) {
-  while (!Fmt.empty()) {
-    // Everything up until the first brace is a literal.
-    if (Fmt.front() != '{') {
-      std::size_t BO = Fmt.find_first_of('{');
-      return std::make_pair(ReplacementItem{Fmt.substr(0, BO)}, Fmt.substr(BO));
-    }
-
-    StringRef Braces = Fmt.take_while([](char C) { return C == '{'; });
-    // If there is more than one brace, then some of them are escaped.  Treat
-    // these as replacements.
-    if (Braces.size() > 1) {
-      size_t NumEscapedBraces = Braces.size() / 2;
-      StringRef Middle = Fmt.take_front(NumEscapedBraces);
-      StringRef Right = Fmt.drop_front(NumEscapedBraces * 2);
-      return std::make_pair(ReplacementItem{Middle}, Right);
-    }
-    // An unterminated open brace is undefined. Assert to indicate that this is
-    // undefined and that we consider it an error. When asserts are disabled,
-    // build a replacement item with an error message.
-    std::size_t BC = Fmt.find_first_of('}');
-    if (BC == StringRef::npos) {
-      assert(
-          false &&
-          "Unterminated brace sequence. Escape with {{ for a literal brace.");
-      return std::make_pair(
-          ReplacementItem{"Unterminated brace sequence. Escape with {{ for a "
-                          "literal brace."},
-          StringRef());
-    }
-
-    // Even if there is a closing brace, if there is another open brace before
-    // this closing brace, treat this portion as literal, and try again with the
-    // next one.
-    std::size_t BO2 = Fmt.find_first_of('{', 1);
-    if (BO2 < BC)
-      return std::make_pair(ReplacementItem{Fmt.substr(0, BO2)},
-                            Fmt.substr(BO2));
-
-    StringRef Spec = Fmt.slice(1, BC);
-    StringRef Right = Fmt.substr(BC + 1);
-
-    auto RI = parseReplacementItem(Spec);
-    if (RI)
-      return std::make_pair(*RI, Right);
+static std::variant<std::pair<ReplacementItem, StringRef>, StringRef>
+splitLiteralAndReplacement(StringRef Fmt) {
+  // Everything up until the first brace is a literal.
+  if (Fmt.front() != '{') {
+    std::size_t BO = Fmt.find_first_of('{');
+    return std::make_pair(ReplacementItem(Fmt.substr(0, BO)), Fmt.substr(BO));
+  }
 
-    // If there was an error parsing the replacement item, treat it as an
-    // invalid replacement spec, and just continue.
-    Fmt = Fmt.drop_front(BC + 1);
+  StringRef Braces = Fmt.take_while([](char C) { return C == '{'; });
+  // If there is more than one brace, then some of them are escaped.  Treat
+  // these as replacements.
+  if (Braces.size() > 1) {
+    size_t NumEscapedBraces = Braces.size() / 2;
+    StringRef Middle = Fmt.take_front(NumEscapedBraces);
+    StringRef Right = Fmt.drop_front(NumEscapedBraces * 2);
+    return std::make_pair(ReplacementItem(Middle), Right);
   }
-  return std::make_pair(ReplacementItem{Fmt}, StringRef());
+  // An unterminated open brace is undefined. Assert to indicate that this is
+  // undefined and that we consider it an error. When asserts are disabled,
+  // build a replacement item with an error message.
+  std::size_t BC = Fmt.find_first_of('}');
+  if (BC == StringRef::npos)
+    return "Unterminated brace sequence. Escape with {{ for a literal brace.";
+
+  // Even if there is a closing brace, if there is another open brace before
+  // this closing brace, treat this portion as literal, and try again with the
+  // next one.
+  std::size_t BO2 = Fmt.find_first_of('{', 1);
+  if (BO2 < BC)
+    return std::make_pair(ReplacementItem{Fmt.substr(0, BO2)}, Fmt.substr(BO2));
+
+  StringRef Spec = Fmt.slice(1, BC);
+  StringRef Right = Fmt.substr(BC + 1);
+
+  auto RI = parseReplacementItem(Spec);
+  if (const StringRef *ErrMsg = std::get_if<1>(&RI))
+    return *ErrMsg;
+
+  return std::make_pair(std::get<0>(RI), Right);
 }
 
-SmallVector<ReplacementItem, 2>
-formatv_object_base::parseFormatString(StringRef Fmt) {
+std::pair<SmallVector<ReplacementItem, 2>, bool>
+formatv_object_base::parseFormatString(raw_ostream &S, const StringRef Fmt,
+                                       size_t NumArgs, bool Validate) {
   SmallVector<ReplacementItem, 2> Replacements;
   ReplacementItem I;
-  while (!Fmt.empty()) {
-    std::tie(I, Fmt) = splitLiteralAndReplacement(Fmt);
+  size_t NumExpectedArgs = 0;
+
+  // Make a copy for pasring as it updates it.
+  StringRef ParseFmt = Fmt;
+  while (!ParseFmt.empty()) {
+    auto RI = splitLiteralAndReplacement(ParseFmt);
+    if (const StringRef *ErrMsg = std::get_if<1>(&RI)) {
+      // If there was an error parsing the format string, write the error to the
+      // stream, and return false as second member of the pair.
+      errs() << "Invalid format string: " << Fmt << "\n";
+      assert(0 && "Invalid format string");
+      S << *ErrMsg;
+      return {{}, false};
+    }
+    std::tie(I, ParseFmt) = std::get<0>(RI);
     if (I.Type != ReplacementType::Empty)
       Replacements.push_back(I);
+    if (I.Type == ReplacementType::Format)
+      NumExpectedArgs = std::max(NumExpectedArgs, I.Index + 1);
   }
-  return Replacements;
+  if (!Validate)
+    return {Replacements, true};
+
+  // Perform additional validation. Verify that the number of arguments matches
+  // the number of replacement indices and that there are no holes in the
+  // replacement indexes.
+  if (NumExpectedArgs != NumArgs) {
+    errs() << "Expected " << NumExpectedArgs << " Args, but got " << NumArgs
+           << " for format string '" << Fmt << "'\n";
+    assert(0 && "Invalid formatv() call");
+    S << "Expected " << NumExpectedArgs << " Args, but got " << NumArgs
+      << " for format string '" << Fmt << "'\n";
+    return {{}, false};
+  }
+
+  SmallSet<size_t, 2> Indices;
+  for (const ReplacementItem &R : Replacements) {
+    if (R.Type != ReplacementType::Format)
+      continue;
+    Indices.insert(R.Index);
+  }
+
+  if (Indices.size() != NumExpectedArgs) {
+    errs() << "Invalid format string: Replacement field indices "
+              "cannot have holes for format string '"
+           << Fmt << "'\n";
+    assert(0 && "Invalid format string");
+    S << "Replacement field indices cannot have holes for format string '"
+      << Fmt << "'\n";
+    return {{}, false};
+  }
+
+  return {Replacements, true};
 }
 
 void support::detail::format_adapter::anchor() {}
diff --git a/llvm/tools/llvm-pdbutil/ExplainOutputStyle.cpp b/llvm/tools/llvm-pdbutil/ExplainOutputStyle.cpp
index ce9d659335b30b..200e9037de3cbe 100644
--- a/llvm/tools/llvm-pdbutil/ExplainOutputStyle.cpp
+++ b/llvm/tools/llvm-pdbutil/ExplainOutputStyle.cpp
@@ -139,8 +139,8 @@ bool ExplainOutputStyle::explainPdbBlockStatus() {
                  FileOffset, File.pdb().getFileSize());
     return false;
   }
-  P.formatLine("Block:Offset = {2:X-}:{1:X-4}.", FileOffset, pdbBlockOffset(),
-               pdbBlockIndex());
+  P.formatLine("Block:Offset = {0:X-}:{1:X-4}.", pdbBlockIndex(),
+               pdbBlockOffset());
 
   bool IsFree = File.pdb().getMsfLayout().FreePageMap[pdbBlockIndex()];
   P.formatLine("Address is in block {0} ({1}allocated).", pdbBlockIndex(),
diff --git a/llvm/unittests/Support/FormatVariadicTest.cpp b/llvm/unittests/Support/FormatVariadicTest.cpp
index a78b25c53d7e43..23399babe7337e 100644
--- a/llvm/unittests/Support/FormatVariadicTest.cpp
+++ b/llvm/unittests/Support/FormatVariadicTest.cpp
@@ -9,9 +9,11 @@
 #include "llvm/Support/FormatVariadic.h"
 #include "llvm/Support/Error.h"
 #include "llvm/Support/FormatAdapters.h"
+#include "gmock/gmock.h"
 #include "gtest/gtest.h"
 
 using namespace llvm;
+using ::testing::HasSubstr;
 
 // Compile-time tests templates in the detail namespace.
 namespace {
@@ -35,14 +37,38 @@ struct NoFormat {};
 static_assert(uses_missing_provider<NoFormat>::value, "");
 }
 
+// Helper to parse format string with no validation.
+static SmallVector<ReplacementItem, 2> parseFormatString(StringRef Fmt) {
+  std::string Error;
+  raw_string_ostream ErrorStream(Error);
+  auto [Replacements, IsValid] =
+      formatv_object_base::parseFormatString(ErrorStream, Fmt, 0, false);
+  ErrorStream.flush();
+  assert(IsValid && Error.empty());
+  return Replacements;
+}
+
+#if NDEBUG
+// Helper for parse format string with errors.
+static std::string parseFormatStringError(StringRef Fmt) {
+  std::string Error;
+  raw_string_ostream ErrorStream(Error);
+  auto [...
[truncated]

@jurahul
Copy link
Contributor Author

jurahul commented Aug 27, 2024

Hi all, this is related to https://discourse.llvm.org/t/adding-argument-count-validation-for-formatv/80876/1

I still have formatv() and formatvv() functions in the code, but only a handful instances. So, if this looks ok overall, I will go ahead and rename formatvv() to formatv_unchecked() (or if there are other better suggestions for that version). Also, let me know if it would make sense to split this into 2 changes, one NFC one that fixes formatv() current uses that are invalid, and then the next one that adds validation and changes the handful few that need to be to formatvv().

@jurahul
Copy link
Contributor Author

jurahul commented Aug 27, 2024

CI failed FYI.

Yeah, it looked like an unrelated failure. Windows CI passed.

Copy link
Collaborator

@joker-eph joker-eph left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, I'm wondering about the cost of this: what does it do to some compile-time tests with clang for example?

llvm/lib/Support/FormatVariadic.cpp Outdated Show resolved Hide resolved
@jurahul
Copy link
Contributor Author

jurahul commented Aug 27, 2024

compile-time tests with clang for example

I can check. How do I run them?

@jurahul
Copy link
Contributor Author

jurahul commented Aug 27, 2024

compile-time tests with clang for example

I can check. How do I run them?

I am wondering if running mlir-tblgen is a better benchmark, given that formatv() is widely used there (as opposed to clang), in case this measurement has to be done manually.

@joker-eph
Copy link
Collaborator

Possible, let's try it there then

@jurahul
Copy link
Contributor Author

jurahul commented Aug 27, 2024

I did 2 sets of experiments, but data wise I am inconclusive if this causes a real compile time regression.

  1. Build MLIR verbose and capture all mlir-tblgen command lines to a file:
    ninja -C build check-mlir --verbose | tee build_log.txt
    grep "NATIVE/bin/mlir-tblgen " build_log.txt | cut -d ' ' -f 2- > mlir-tablegen-commands.txt

  2. Build both baseline and new versions of LLVM/MLIR in 2 different paths "upstream_clean" and "upstream_llvm"

  3. Use attached script to run these captured commands with --time-phases and measure total time.

  4. Establish baseline variance, by running the script comparing baseline to itself.

    Total time 4.2302 4.2573 0.6406

    So baseline variance is 0.6%, with each command running 20 times. Note that for individual targets,
    the variance is quite high for some of them, upto 100%.

  5. Establish "new" variance, by running script to compare new to itself
    Total time 4.2829 4.2531 -0.6958
    Again, 0.6% variance.

  6. Run baseline against new:
    Total time 4.1745 4.2864 2.6806
    So this seems to give 2.6% regression. However, the individual data is quite noisy. For example, for individual samples,
    the variance can be quite high, upto 100%.

  7. Add a FormatVariadic benchmark to test format() with 1-5 substitutions (which covers the common usage in LLVM), and run baseline and new:
    ./build/benchmarks/FormatVariadic --benchmark_repetitions=20

Baseline:
BM_FormatVariadic_mean 1063 ns 1063 ns 20
New:
BM_FormatVariadic_mean 1097 ns 1097 ns 20

This is ~3.2% regression in just formatv.

The benchmark I added was:

#include "benchmark/benchmark.h"
#include "llvm/Support/FormatVariadic.h"

using namespace llvm;

// Benchmark intrinsic lookup from a variety of targets.
static void BM_FormatVariadic(benchmark::State &state) {
  for (auto _ : state) {
    // Exercise formatv() with several valid replacement options.
    formatv("{0}", 1).str();
    formatv("{0}{1}", 1, 1).str();
    formatv("{0}{1}{2}", 1, 1, 1).str();
    formatv("{0}{1}{2}{3}", 1, 1, 1, 1).str();
    formatv("{0}{1}{2}{3}{4}", 1, 1, 1, 1, 1).str();

  }
}

BENCHMARK(BM_FormatVariadic);

BENCHMARK_MAIN();

The compile time data collected from mlir-tblgen runs is quite noisy for individual targets, though the aggregated results seem stable, but I wonder if that means that its not really capturing small compile time delta correctly. As an example:

lir/Dialect/MemRef/IR/MemRefOps.cpp.inc  0.0106     0.0119     12.2642%
mlir/include/mlir/IR/BuiltinOps.cpp.inc  0.0048     0.0042     -12.5000%

So within the same run, for one target its +12% and for another its -12%.

The other line of thinking is that this validation is an aid to developers, so enabling it just in Debug builds may be good enough to catch issues. I am attaching the script and the capture mlir-tblgen commands used in the script below

mlir-tablegen-commands.txt
ct_formatv.txt

@jurahul
Copy link
Contributor Author

jurahul commented Aug 28, 2024

LGTM

Thanks. I'll split out an additional PR for the independent fixes, and then in this one I'll change ENABLE_VALIDATION back to 0 and also remove the formatvv() and use formatv(false instead so we just have one function name.

@jurahul
Copy link
Contributor Author

jurahul commented Aug 28, 2024

Started #106454 for the independent fixes.

- Detect formatv() calls where the number of replacement parameters
  expected after parsing the format string does not match the number
  provides in the formatv() call.
- assert() in debug builds, and fail the formatv() call in release
  builds by just emitting an error message in the stream.
@jurahul
Copy link
Contributor Author

jurahul commented Aug 29, 2024

The final version is good to go @joker-eph if you want to take another look. Nothing significant changed, just formatvv() is now gone and replaced with formatv(false,...).

@joker-eph
Copy link
Collaborator

LG!

Copy link
Member

@jpienaar jpienaar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

mlir/tools/mlir-tblgen/OpFormatGen.cpp Show resolved Hide resolved
@jurahul jurahul merged commit fc11020 into llvm:main Aug 29, 2024
8 checks passed
@jurahul jurahul deleted the formatv_errorcheck branch August 29, 2024 15:00
@llvm-ci
Copy link
Collaborator

llvm-ci commented Aug 29, 2024

LLVM Buildbot has detected a new failure on builder llvm-clang-x86_64-win-fast running on as-builder-3 while building clang,llvm,mlir at step 7 "test-build-unified-tree-check-llvm-unit".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/2/builds/5504

Here is the relevant piece of the build log for the reference
Step 7 (test-build-unified-tree-check-llvm-unit) failure: test (failure)
******************** TEST 'LLVM-Unit :: Support/./SupportTests.exe/56/85' FAILED ********************
Script(shard):
--
GTEST_OUTPUT=json:C:\buildbot\as-builder-3\llvm-clang-x86_64-win-fast\build\unittests\Support\.\SupportTests.exe-LLVM-Unit-11744-56-85.json GTEST_SHUFFLE=0 GTEST_TOTAL_SHARDS=85 GTEST_SHARD_INDEX=56 C:\buildbot\as-builder-3\llvm-clang-x86_64-win-fast\build\unittests\Support\.\SupportTests.exe
--

Script:
--
C:\buildbot\as-builder-3\llvm-clang-x86_64-win-fast\build\unittests\Support\.\SupportTests.exe --gtest_filter=FormatVariadicTest.Validate
--
C:\buildbot\as-builder-3\llvm-clang-x86_64-win-fast\llvm-project\llvm\unittests\Support\FormatVariadicTest.cpp(716): error: Value of: Str
Expected: has substring "Unexpected number of arguments"
  Actual: "1"

C:\buildbot\as-builder-3\llvm-clang-x86_64-win-fast\llvm-project\llvm\unittests\Support\FormatVariadicTest.cpp(719): error: Value of: Str
Expected: has substring "eplacement indices have holes"
  Actual: "1 3"


C:\buildbot\as-builder-3\llvm-clang-x86_64-win-fast\llvm-project\llvm\unittests\Support\FormatVariadicTest.cpp:716
Value of: Str
Expected: has substring "Unexpected number of arguments"
  Actual: "1"

C:\buildbot\as-builder-3\llvm-clang-x86_64-win-fast\llvm-project\llvm\unittests\Support\FormatVariadicTest.cpp:719
Value of: Str
Expected: has substring "eplacement indices have holes"
  Actual: "1 3"



********************


@llvm-ci
Copy link
Collaborator

llvm-ci commented Aug 29, 2024

LLVM Buildbot has detected a new failure on builder clang-ve-ninja running on hpce-ve-main while building clang,llvm,mlir at step 4 "annotate".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/12/builds/4733

Here is the relevant piece of the build log for the reference
Step 4 (annotate) failure: 'python ../llvm-zorg/zorg/buildbot/builders/annotated/ve-linux.py ...' (failure)
...
[647/648] Running the LLVM regression tests
Unknown option: -C
usage: git [--version] [--help] [-c name=value]
           [--exec-path[=<path>]] [--html-path] [--man-path] [--info-path]
           [-p|--paginate|--no-pager] [--no-replace-objects] [--bare]
           [--git-dir=<path>] [--work-tree=<path>] [--namespace=<name>]
           <command> [<args>]
An error occurred retrieving the git revision: Command '['git', '-C', '/scratch/buildbot/bothome/clang-ve-ninja/llvm-project/llvm', 'rev-parse', 'HEAD']' returned non-zero exit status 129.
-- Testing: 55052 tests, 48 workers --
Testing:  0.. 10.. 20.. 30.. 40.. 50.. 60.. 70.. 80.. 90..
FAIL: LLVM-Unit :: Support/./SupportTests/54/85 (54480 of 55052)
******************** TEST 'LLVM-Unit :: Support/./SupportTests/54/85' FAILED ********************
Script(shard):
--
GTEST_OUTPUT=json:/scratch/buildbot/bothome/clang-ve-ninja/build/build_llvm/unittests/Support/./SupportTests-LLVM-Unit-264608-54-85.json GTEST_SHUFFLE=0 GTEST_TOTAL_SHARDS=85 GTEST_SHARD_INDEX=54 /scratch/buildbot/bothome/clang-ve-ninja/build/build_llvm/unittests/Support/./SupportTests
--

Script:
--
/scratch/buildbot/bothome/clang-ve-ninja/build/build_llvm/unittests/Support/./SupportTests --gtest_filter=FormatVariadicTest.Validate
--
/scratch/buildbot/bothome/clang-ve-ninja/llvm-project/llvm/unittests/Support/FormatVariadicTest.cpp:716: Failure
Value of: Str
Expected: has substring "Unexpected number of arguments"
  Actual: "1"

/scratch/buildbot/bothome/clang-ve-ninja/llvm-project/llvm/unittests/Support/FormatVariadicTest.cpp:719: Failure
Value of: Str
Expected: has substring "eplacement indices have holes"
  Actual: "1 3"


/scratch/buildbot/bothome/clang-ve-ninja/llvm-project/llvm/unittests/Support/FormatVariadicTest.cpp:716
Value of: Str
Expected: has substring "Unexpected number of arguments"
  Actual: "1"

/scratch/buildbot/bothome/clang-ve-ninja/llvm-project/llvm/unittests/Support/FormatVariadicTest.cpp:719
Value of: Str
Expected: has substring "eplacement indices have holes"
  Actual: "1 3"



********************
Testing:  0.. 10.. 20.. 30.. 40.. 50.. 60.. 70.. 80.. 90.. 
********************
Failed Tests (1):
  LLVM-Unit :: Support/./SupportTests/FormatVariadicTest/Validate
Step 8 (check-llvm) failure: check-llvm (failure)
...
[647/648] Running the LLVM regression tests
Unknown option: -C
usage: git [--version] [--help] [-c name=value]
           [--exec-path[=<path>]] [--html-path] [--man-path] [--info-path]
           [-p|--paginate|--no-pager] [--no-replace-objects] [--bare]
           [--git-dir=<path>] [--work-tree=<path>] [--namespace=<name>]
           <command> [<args>]
An error occurred retrieving the git revision: Command '['git', '-C', '/scratch/buildbot/bothome/clang-ve-ninja/llvm-project/llvm', 'rev-parse', 'HEAD']' returned non-zero exit status 129.
-- Testing: 55052 tests, 48 workers --
Testing:  0.. 10.. 20.. 30.. 40.. 50.. 60.. 70.. 80.. 90..
FAIL: LLVM-Unit :: Support/./SupportTests/54/85 (54480 of 55052)
******************** TEST 'LLVM-Unit :: Support/./SupportTests/54/85' FAILED ********************
Script(shard):
--
GTEST_OUTPUT=json:/scratch/buildbot/bothome/clang-ve-ninja/build/build_llvm/unittests/Support/./SupportTests-LLVM-Unit-264608-54-85.json GTEST_SHUFFLE=0 GTEST_TOTAL_SHARDS=85 GTEST_SHARD_INDEX=54 /scratch/buildbot/bothome/clang-ve-ninja/build/build_llvm/unittests/Support/./SupportTests
--

Script:
--
/scratch/buildbot/bothome/clang-ve-ninja/build/build_llvm/unittests/Support/./SupportTests --gtest_filter=FormatVariadicTest.Validate
--
/scratch/buildbot/bothome/clang-ve-ninja/llvm-project/llvm/unittests/Support/FormatVariadicTest.cpp:716: Failure
Value of: Str
Expected: has substring "Unexpected number of arguments"
  Actual: "1"

/scratch/buildbot/bothome/clang-ve-ninja/llvm-project/llvm/unittests/Support/FormatVariadicTest.cpp:719: Failure
Value of: Str
Expected: has substring "eplacement indices have holes"
  Actual: "1 3"


/scratch/buildbot/bothome/clang-ve-ninja/llvm-project/llvm/unittests/Support/FormatVariadicTest.cpp:716
Value of: Str
Expected: has substring "Unexpected number of arguments"
  Actual: "1"

/scratch/buildbot/bothome/clang-ve-ninja/llvm-project/llvm/unittests/Support/FormatVariadicTest.cpp:719
Value of: Str
Expected: has substring "eplacement indices have holes"
  Actual: "1 3"



********************
Testing:  0.. 10.. 20.. 30.. 40.. 50.. 60.. 70.. 80.. 90.. 
********************
Failed Tests (1):
  LLVM-Unit :: Support/./SupportTests/FormatVariadicTest/Validate

@llvm-ci
Copy link
Collaborator

llvm-ci commented Aug 29, 2024

LLVM Buildbot has detected a new failure on builder fuchsia-x86_64-linux running on fuchsia-debian-64-us-central1-a-1 while building clang,llvm,mlir at step 4 "annotate".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/11/builds/4140

Here is the relevant piece of the build log for the reference
Step 4 (annotate) failure: 'python ../llvm-zorg/zorg/buildbot/builders/annotated/fuchsia-linux.py ...' (failure)
...
[1321/1326] Building CXX object unittests/Transforms/Scalar/CMakeFiles/ScalarTests.dir/LoopPassManagerTest.cpp.o
clang++: warning: optimization flag '-ffat-lto-objects' is not supported [-Wignored-optimization-argument]
[1322/1326] Linking CXX executable unittests/Transforms/Scalar/ScalarTests
[1322/1326] Running the LLVM regression tests
llvm-lit: /var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/llvm/utils/lit/lit/llvm/config.py:505: note: using ld.lld: /var/lib/buildbot/fuchsia-x86_64-linux/build/llvm-build-ni5lkjxj/bin/ld.lld
llvm-lit: /var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/llvm/utils/lit/lit/llvm/config.py:505: note: using lld-link: /var/lib/buildbot/fuchsia-x86_64-linux/build/llvm-build-ni5lkjxj/bin/lld-link
llvm-lit: /var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/llvm/utils/lit/lit/llvm/config.py:505: note: using ld64.lld: /var/lib/buildbot/fuchsia-x86_64-linux/build/llvm-build-ni5lkjxj/bin/ld64.lld
llvm-lit: /var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/llvm/utils/lit/lit/llvm/config.py:505: note: using wasm-ld: /var/lib/buildbot/fuchsia-x86_64-linux/build/llvm-build-ni5lkjxj/bin/wasm-ld
-- Testing: 55411 tests, 60 workers --
Testing:  0.. 10.. 20.. 30.. 40.. 50.. 60.. 70.. 80.. 90..
FAIL: LLVM-Unit :: Support/./SupportTests/54/85 (54732 of 55411)
******************** TEST 'LLVM-Unit :: Support/./SupportTests/54/85' FAILED ********************
Script(shard):
--
GTEST_OUTPUT=json:/var/lib/buildbot/fuchsia-x86_64-linux/build/llvm-build-ni5lkjxj/unittests/Support/./SupportTests-LLVM-Unit-2927217-54-85.json GTEST_SHUFFLE=0 GTEST_TOTAL_SHARDS=85 GTEST_SHARD_INDEX=54 /var/lib/buildbot/fuchsia-x86_64-linux/build/llvm-build-ni5lkjxj/unittests/Support/./SupportTests
--

Script:
--
/var/lib/buildbot/fuchsia-x86_64-linux/build/llvm-build-ni5lkjxj/unittests/Support/./SupportTests --gtest_filter=FormatVariadicTest.Validate
--
/var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/llvm/unittests/Support/FormatVariadicTest.cpp:716: Failure
Value of: Str
Expected: has substring "Unexpected number of arguments"
  Actual: "1"

/var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/llvm/unittests/Support/FormatVariadicTest.cpp:719: Failure
Value of: Str
Expected: has substring "eplacement indices have holes"
  Actual: "1 3"


/var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/llvm/unittests/Support/FormatVariadicTest.cpp:716
Value of: Str
Expected: has substring "Unexpected number of arguments"
  Actual: "1"

/var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/llvm/unittests/Support/FormatVariadicTest.cpp:719
Value of: Str
Expected: has substring "eplacement indices have holes"
  Actual: "1 3"



********************
Testing:  0.. 10.. 20.. 30.. 40.. 50.. 60.. 70.. 80.. 90.. 
********************
Failed Tests (1):
  LLVM-Unit :: Support/./SupportTests/FormatVariadicTest/Validate
Step 7 (check) failure: check (failure)
...
[1321/1326] Building CXX object unittests/Transforms/Scalar/CMakeFiles/ScalarTests.dir/LoopPassManagerTest.cpp.o
clang++: warning: optimization flag '-ffat-lto-objects' is not supported [-Wignored-optimization-argument]
[1322/1326] Linking CXX executable unittests/Transforms/Scalar/ScalarTests
[1322/1326] Running the LLVM regression tests
llvm-lit: /var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/llvm/utils/lit/lit/llvm/config.py:505: note: using ld.lld: /var/lib/buildbot/fuchsia-x86_64-linux/build/llvm-build-ni5lkjxj/bin/ld.lld
llvm-lit: /var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/llvm/utils/lit/lit/llvm/config.py:505: note: using lld-link: /var/lib/buildbot/fuchsia-x86_64-linux/build/llvm-build-ni5lkjxj/bin/lld-link
llvm-lit: /var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/llvm/utils/lit/lit/llvm/config.py:505: note: using ld64.lld: /var/lib/buildbot/fuchsia-x86_64-linux/build/llvm-build-ni5lkjxj/bin/ld64.lld
llvm-lit: /var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/llvm/utils/lit/lit/llvm/config.py:505: note: using wasm-ld: /var/lib/buildbot/fuchsia-x86_64-linux/build/llvm-build-ni5lkjxj/bin/wasm-ld
-- Testing: 55411 tests, 60 workers --
Testing:  0.. 10.. 20.. 30.. 40.. 50.. 60.. 70.. 80.. 90..
FAIL: LLVM-Unit :: Support/./SupportTests/54/85 (54732 of 55411)
******************** TEST 'LLVM-Unit :: Support/./SupportTests/54/85' FAILED ********************
Script(shard):
--
GTEST_OUTPUT=json:/var/lib/buildbot/fuchsia-x86_64-linux/build/llvm-build-ni5lkjxj/unittests/Support/./SupportTests-LLVM-Unit-2927217-54-85.json GTEST_SHUFFLE=0 GTEST_TOTAL_SHARDS=85 GTEST_SHARD_INDEX=54 /var/lib/buildbot/fuchsia-x86_64-linux/build/llvm-build-ni5lkjxj/unittests/Support/./SupportTests
--

Script:
--
/var/lib/buildbot/fuchsia-x86_64-linux/build/llvm-build-ni5lkjxj/unittests/Support/./SupportTests --gtest_filter=FormatVariadicTest.Validate
--
/var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/llvm/unittests/Support/FormatVariadicTest.cpp:716: Failure
Value of: Str
Expected: has substring "Unexpected number of arguments"
  Actual: "1"

/var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/llvm/unittests/Support/FormatVariadicTest.cpp:719: Failure
Value of: Str
Expected: has substring "eplacement indices have holes"
  Actual: "1 3"


/var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/llvm/unittests/Support/FormatVariadicTest.cpp:716
Value of: Str
Expected: has substring "Unexpected number of arguments"
  Actual: "1"

/var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/llvm/unittests/Support/FormatVariadicTest.cpp:719
Value of: Str
Expected: has substring "eplacement indices have holes"
  Actual: "1 3"



********************
Testing:  0.. 10.. 20.. 30.. 40.. 50.. 60.. 70.. 80.. 90.. 
********************
Failed Tests (1):
  LLVM-Unit :: Support/./SupportTests/FormatVariadicTest/Validate

@llvm-ci
Copy link
Collaborator

llvm-ci commented Aug 29, 2024

LLVM Buildbot has detected a new failure on builder sanitizer-x86_64-linux-android running on sanitizer-buildbot-android while building clang,llvm,mlir at step 2 "annotate".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/186/builds/1843

Here is the relevant piece of the build log for the reference
Step 2 (annotate) failure: 'python ../sanitizer_buildbot/sanitizers/zorg/buildbot/builders/sanitizers/buildbot_selector.py' (failure)
...
XFAIL: AddressSanitizer-arm-android :: TestCases/log-path_test.cpp (397 of 1528)
PASS: AddressSanitizer-arm-android :: TestCases/malloc-size-too-big.cpp (398 of 1528)
PASS: AddressSanitizer-arm-android :: TestCases/malloc_fill.cpp (399 of 1528)
PASS: AddressSanitizer-arm-android :: TestCases/interception_failure_test.cpp (400 of 1528)
UNSUPPORTED: AddressSanitizer-arm-android :: TestCases/pass-struct-byval-uar.cpp (401 of 1528)
PASS: AddressSanitizer-arm-android :: TestCases/pass-object-byval.cpp (402 of 1528)
PASS: AddressSanitizer-arm-android :: TestCases/pass-struct-byval.cpp (403 of 1528)
PASS: AddressSanitizer-arm-android :: TestCases/malloc_context_size.cpp (404 of 1528)
PASS: AddressSanitizer-arm-android :: TestCases/on_error_callback.cpp (405 of 1528)
PASS: AddressSanitizer-arm-android :: TestCases/memcmp_strict_test.cpp (406 of 1528)
FAIL: AddressSanitizer-arm-android :: TestCases/poison_partial.cpp (407 of 1528)
******************** TEST 'AddressSanitizer-arm-android :: TestCases/poison_partial.cpp' FAILED ********************
Exit Code: 255

Command Output (stdout):
--
adb command failed ['shell', 'cd /data/local/tmp/Output && LD_LIBRARY_PATH=/data/local/tmp/Output ASAN_OPTIONS="abort_on_error=0:poison_partial=0" /data/local/tmp/Output/var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/compiler_rt_build_android_arm/test/asan/ARMAndroidConfig/TestCases/Output/poison_partial.cpp.tmp heap >/data/local/tmp/Output/var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/compiler_rt_build_android_arm/test/asan/ARMAndroidConfig/TestCases/Output/poison_partial.cpp.tmp.stdout 2>/data/local/tmp/Output/var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/compiler_rt_build_android_arm/test/asan/ARMAndroidConfig/TestCases/Output/poison_partial.cpp.tmp.stderr ; echo $? >/data/local/tmp/Output/var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/compiler_rt_build_android_arm/test/asan/ARMAndroidConfig/TestCases/Output/poison_partial.cpp.tmp.exitcode']
/tmp/lit-tmp-6tabjbgo/tmpnraytvnj


--
Command Output (stderr):
--
RUN: at line 1: /var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/llvm-project/compiler-rt/test/sanitizer_common/android_commands/android_compile.py  /var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/llvm_build64/bin/clang  --driver-mode=g++ -fsanitize=address -mno-omit-leaf-frame-pointer -fno-omit-frame-pointer -fno-optimize-sibling-calls -gline-tables-only  --target=armv7-linux-androideabi24 --sysroot=/var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/android_ndk/toolchains/llvm/prebuilt/linux-x86_64/sysroot --gcc-toolchain=/var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/android_ndk/toolchains/llvm/prebuilt/linux-x86_64  -B/var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/android_ndk/toolchains/llvm/prebuilt/linux-x86_64 -Wthread-safety -Wthread-safety-reference -Wthread-safety-beta  -fuse-ld=lld  -shared-libasan -O0 /var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/llvm-project/compiler-rt/test/asan/TestCases/poison_partial.cpp -o /var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/compiler_rt_build_android_arm/test/asan/ARMAndroidConfig/TestCases/Output/poison_partial.cpp.tmp
+ /var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/llvm-project/compiler-rt/test/sanitizer_common/android_commands/android_compile.py /var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/llvm_build64/bin/clang --driver-mode=g++ -fsanitize=address -mno-omit-leaf-frame-pointer -fno-omit-frame-pointer -fno-optimize-sibling-calls -gline-tables-only --target=armv7-linux-androideabi24 --sysroot=/var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/android_ndk/toolchains/llvm/prebuilt/linux-x86_64/sysroot --gcc-toolchain=/var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/android_ndk/toolchains/llvm/prebuilt/linux-x86_64 -B/var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/android_ndk/toolchains/llvm/prebuilt/linux-x86_64 -Wthread-safety -Wthread-safety-reference -Wthread-safety-beta -fuse-ld=lld -shared-libasan -O0 /var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/llvm-project/compiler-rt/test/asan/TestCases/poison_partial.cpp -o /var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/compiler_rt_build_android_arm/test/asan/ARMAndroidConfig/TestCases/Output/poison_partial.cpp.tmp
RUN: at line 2: not  /var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/compiler_rt_build_android_arm/test/asan/ARMAndroidConfig/TestCases/Output/poison_partial.cpp.tmp      2>&1 | FileCheck /var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/llvm-project/compiler-rt/test/asan/TestCases/poison_partial.cpp
+ not /var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/compiler_rt_build_android_arm/test/asan/ARMAndroidConfig/TestCases/Output/poison_partial.cpp.tmp
+ FileCheck /var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/llvm-project/compiler-rt/test/asan/TestCases/poison_partial.cpp
RUN: at line 3: not  /var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/compiler_rt_build_android_arm/test/asan/ARMAndroidConfig/TestCases/Output/poison_partial.cpp.tmp heap 2>&1 | FileCheck /var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/llvm-project/compiler-rt/test/asan/TestCases/poison_partial.cpp
+ not /var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/compiler_rt_build_android_arm/test/asan/ARMAndroidConfig/TestCases/Output/poison_partial.cpp.tmp heap
+ FileCheck /var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/llvm-project/compiler-rt/test/asan/TestCases/poison_partial.cpp
RUN: at line 4: env ASAN_OPTIONS=abort_on_error=0:poison_partial=0  /var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/compiler_rt_build_android_arm/test/asan/ARMAndroidConfig/TestCases/Output/poison_partial.cpp.tmp
+ env ASAN_OPTIONS=abort_on_error=0:poison_partial=0 /var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/compiler_rt_build_android_arm/test/asan/ARMAndroidConfig/TestCases/Output/poison_partial.cpp.tmp
RUN: at line 5: env ASAN_OPTIONS=abort_on_error=0:poison_partial=0  /var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/compiler_rt_build_android_arm/test/asan/ARMAndroidConfig/TestCases/Output/poison_partial.cpp.tmp heap
+ env ASAN_OPTIONS=abort_on_error=0:poison_partial=0 /var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/compiler_rt_build_android_arm/test/asan/ARMAndroidConfig/TestCases/Output/poison_partial.cpp.tmp heap

--

********************
UNSUPPORTED: AddressSanitizer-arm-android :: TestCases/printf-3.c (408 of 1528)
FAIL: AddressSanitizer-arm-android :: TestCases/pr33372.cpp (409 of 1528)
******************** TEST 'AddressSanitizer-arm-android :: TestCases/pr33372.cpp' FAILED ********************
Exit Code: 1

Command Output (stderr):
--
RUN: at line 1: /var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/llvm-project/compiler-rt/test/sanitizer_common/android_commands/android_compile.py  /var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/llvm_build64/bin/clang  --driver-mode=g++ -fsanitize=address -mno-omit-leaf-frame-pointer -fno-omit-frame-pointer -fno-optimize-sibling-calls -gline-tables-only  --target=armv7-linux-androideabi24 --sysroot=/var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/android_ndk/toolchains/llvm/prebuilt/linux-x86_64/sysroot --gcc-toolchain=/var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/android_ndk/toolchains/llvm/prebuilt/linux-x86_64  -B/var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/android_ndk/toolchains/llvm/prebuilt/linux-x86_64 -Wthread-safety -Wthread-safety-reference -Wthread-safety-beta  -fuse-ld=lld  -shared-libasan -O0 -std=c++11 /var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/llvm-project/compiler-rt/test/asan/TestCases/pr33372.cpp -o /var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/compiler_rt_build_android_arm/test/asan/ARMAndroidConfig/TestCases/Output/pr33372.cpp.tmp &&  /var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/compiler_rt_build_android_arm/test/asan/ARMAndroidConfig/TestCases/Output/pr33372.cpp.tmp 2>&1 | FileCheck /var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/llvm-project/compiler-rt/test/asan/TestCases/pr33372.cpp
+ /var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/llvm-project/compiler-rt/test/sanitizer_common/android_commands/android_compile.py /var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/llvm_build64/bin/clang --driver-mode=g++ -fsanitize=address -mno-omit-leaf-frame-pointer -fno-omit-frame-pointer -fno-optimize-sibling-calls -gline-tables-only --target=armv7-linux-androideabi24 --sysroot=/var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/android_ndk/toolchains/llvm/prebuilt/linux-x86_64/sysroot --gcc-toolchain=/var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/android_ndk/toolchains/llvm/prebuilt/linux-x86_64 -B/var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/android_ndk/toolchains/llvm/prebuilt/linux-x86_64 -Wthread-safety -Wthread-safety-reference -Wthread-safety-beta -fuse-ld=lld -shared-libasan -O0 -std=c++11 /var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/llvm-project/compiler-rt/test/asan/TestCases/pr33372.cpp -o /var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/compiler_rt_build_android_arm/test/asan/ARMAndroidConfig/TestCases/Output/pr33372.cpp.tmp
+ /var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/compiler_rt_build_android_arm/test/asan/ARMAndroidConfig/TestCases/Output/pr33372.cpp.tmp
Step 16 (run lit tests [arm/aosp_coral-userdebug/AOSP.MASTER]) failure: run lit tests [arm/aosp_coral-userdebug/AOSP.MASTER] (failure)
...
XFAIL: AddressSanitizer-arm-android :: TestCases/log-path_test.cpp (397 of 1528)
PASS: AddressSanitizer-arm-android :: TestCases/malloc-size-too-big.cpp (398 of 1528)
PASS: AddressSanitizer-arm-android :: TestCases/malloc_fill.cpp (399 of 1528)
PASS: AddressSanitizer-arm-android :: TestCases/interception_failure_test.cpp (400 of 1528)
UNSUPPORTED: AddressSanitizer-arm-android :: TestCases/pass-struct-byval-uar.cpp (401 of 1528)
PASS: AddressSanitizer-arm-android :: TestCases/pass-object-byval.cpp (402 of 1528)
PASS: AddressSanitizer-arm-android :: TestCases/pass-struct-byval.cpp (403 of 1528)
PASS: AddressSanitizer-arm-android :: TestCases/malloc_context_size.cpp (404 of 1528)
PASS: AddressSanitizer-arm-android :: TestCases/on_error_callback.cpp (405 of 1528)
PASS: AddressSanitizer-arm-android :: TestCases/memcmp_strict_test.cpp (406 of 1528)
FAIL: AddressSanitizer-arm-android :: TestCases/poison_partial.cpp (407 of 1528)
******************** TEST 'AddressSanitizer-arm-android :: TestCases/poison_partial.cpp' FAILED ********************
Exit Code: 255

Command Output (stdout):
--
adb command failed ['shell', 'cd /data/local/tmp/Output && LD_LIBRARY_PATH=/data/local/tmp/Output ASAN_OPTIONS="abort_on_error=0:poison_partial=0" /data/local/tmp/Output/var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/compiler_rt_build_android_arm/test/asan/ARMAndroidConfig/TestCases/Output/poison_partial.cpp.tmp heap >/data/local/tmp/Output/var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/compiler_rt_build_android_arm/test/asan/ARMAndroidConfig/TestCases/Output/poison_partial.cpp.tmp.stdout 2>/data/local/tmp/Output/var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/compiler_rt_build_android_arm/test/asan/ARMAndroidConfig/TestCases/Output/poison_partial.cpp.tmp.stderr ; echo $? >/data/local/tmp/Output/var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/compiler_rt_build_android_arm/test/asan/ARMAndroidConfig/TestCases/Output/poison_partial.cpp.tmp.exitcode']
/tmp/lit-tmp-6tabjbgo/tmpnraytvnj


--
Command Output (stderr):
--
RUN: at line 1: /var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/llvm-project/compiler-rt/test/sanitizer_common/android_commands/android_compile.py  /var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/llvm_build64/bin/clang  --driver-mode=g++ -fsanitize=address -mno-omit-leaf-frame-pointer -fno-omit-frame-pointer -fno-optimize-sibling-calls -gline-tables-only  --target=armv7-linux-androideabi24 --sysroot=/var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/android_ndk/toolchains/llvm/prebuilt/linux-x86_64/sysroot --gcc-toolchain=/var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/android_ndk/toolchains/llvm/prebuilt/linux-x86_64  -B/var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/android_ndk/toolchains/llvm/prebuilt/linux-x86_64 -Wthread-safety -Wthread-safety-reference -Wthread-safety-beta  -fuse-ld=lld  -shared-libasan -O0 /var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/llvm-project/compiler-rt/test/asan/TestCases/poison_partial.cpp -o /var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/compiler_rt_build_android_arm/test/asan/ARMAndroidConfig/TestCases/Output/poison_partial.cpp.tmp
+ /var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/llvm-project/compiler-rt/test/sanitizer_common/android_commands/android_compile.py /var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/llvm_build64/bin/clang --driver-mode=g++ -fsanitize=address -mno-omit-leaf-frame-pointer -fno-omit-frame-pointer -fno-optimize-sibling-calls -gline-tables-only --target=armv7-linux-androideabi24 --sysroot=/var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/android_ndk/toolchains/llvm/prebuilt/linux-x86_64/sysroot --gcc-toolchain=/var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/android_ndk/toolchains/llvm/prebuilt/linux-x86_64 -B/var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/android_ndk/toolchains/llvm/prebuilt/linux-x86_64 -Wthread-safety -Wthread-safety-reference -Wthread-safety-beta -fuse-ld=lld -shared-libasan -O0 /var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/llvm-project/compiler-rt/test/asan/TestCases/poison_partial.cpp -o /var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/compiler_rt_build_android_arm/test/asan/ARMAndroidConfig/TestCases/Output/poison_partial.cpp.tmp
RUN: at line 2: not  /var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/compiler_rt_build_android_arm/test/asan/ARMAndroidConfig/TestCases/Output/poison_partial.cpp.tmp      2>&1 | FileCheck /var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/llvm-project/compiler-rt/test/asan/TestCases/poison_partial.cpp
+ not /var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/compiler_rt_build_android_arm/test/asan/ARMAndroidConfig/TestCases/Output/poison_partial.cpp.tmp
+ FileCheck /var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/llvm-project/compiler-rt/test/asan/TestCases/poison_partial.cpp
RUN: at line 3: not  /var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/compiler_rt_build_android_arm/test/asan/ARMAndroidConfig/TestCases/Output/poison_partial.cpp.tmp heap 2>&1 | FileCheck /var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/llvm-project/compiler-rt/test/asan/TestCases/poison_partial.cpp
+ not /var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/compiler_rt_build_android_arm/test/asan/ARMAndroidConfig/TestCases/Output/poison_partial.cpp.tmp heap
+ FileCheck /var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/llvm-project/compiler-rt/test/asan/TestCases/poison_partial.cpp
RUN: at line 4: env ASAN_OPTIONS=abort_on_error=0:poison_partial=0  /var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/compiler_rt_build_android_arm/test/asan/ARMAndroidConfig/TestCases/Output/poison_partial.cpp.tmp
+ env ASAN_OPTIONS=abort_on_error=0:poison_partial=0 /var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/compiler_rt_build_android_arm/test/asan/ARMAndroidConfig/TestCases/Output/poison_partial.cpp.tmp
RUN: at line 5: env ASAN_OPTIONS=abort_on_error=0:poison_partial=0  /var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/compiler_rt_build_android_arm/test/asan/ARMAndroidConfig/TestCases/Output/poison_partial.cpp.tmp heap
+ env ASAN_OPTIONS=abort_on_error=0:poison_partial=0 /var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/compiler_rt_build_android_arm/test/asan/ARMAndroidConfig/TestCases/Output/poison_partial.cpp.tmp heap

--

********************
UNSUPPORTED: AddressSanitizer-arm-android :: TestCases/printf-3.c (408 of 1528)
FAIL: AddressSanitizer-arm-android :: TestCases/pr33372.cpp (409 of 1528)
******************** TEST 'AddressSanitizer-arm-android :: TestCases/pr33372.cpp' FAILED ********************
Exit Code: 1

Command Output (stderr):
--
RUN: at line 1: /var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/llvm-project/compiler-rt/test/sanitizer_common/android_commands/android_compile.py  /var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/llvm_build64/bin/clang  --driver-mode=g++ -fsanitize=address -mno-omit-leaf-frame-pointer -fno-omit-frame-pointer -fno-optimize-sibling-calls -gline-tables-only  --target=armv7-linux-androideabi24 --sysroot=/var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/android_ndk/toolchains/llvm/prebuilt/linux-x86_64/sysroot --gcc-toolchain=/var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/android_ndk/toolchains/llvm/prebuilt/linux-x86_64  -B/var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/android_ndk/toolchains/llvm/prebuilt/linux-x86_64 -Wthread-safety -Wthread-safety-reference -Wthread-safety-beta  -fuse-ld=lld  -shared-libasan -O0 -std=c++11 /var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/llvm-project/compiler-rt/test/asan/TestCases/pr33372.cpp -o /var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/compiler_rt_build_android_arm/test/asan/ARMAndroidConfig/TestCases/Output/pr33372.cpp.tmp &&  /var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/compiler_rt_build_android_arm/test/asan/ARMAndroidConfig/TestCases/Output/pr33372.cpp.tmp 2>&1 | FileCheck /var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/llvm-project/compiler-rt/test/asan/TestCases/pr33372.cpp
+ /var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/llvm-project/compiler-rt/test/sanitizer_common/android_commands/android_compile.py /var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/llvm_build64/bin/clang --driver-mode=g++ -fsanitize=address -mno-omit-leaf-frame-pointer -fno-omit-frame-pointer -fno-optimize-sibling-calls -gline-tables-only --target=armv7-linux-androideabi24 --sysroot=/var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/android_ndk/toolchains/llvm/prebuilt/linux-x86_64/sysroot --gcc-toolchain=/var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/android_ndk/toolchains/llvm/prebuilt/linux-x86_64 -B/var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/android_ndk/toolchains/llvm/prebuilt/linux-x86_64 -Wthread-safety -Wthread-safety-reference -Wthread-safety-beta -fuse-ld=lld -shared-libasan -O0 -std=c++11 /var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/llvm-project/compiler-rt/test/asan/TestCases/pr33372.cpp -o /var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/compiler_rt_build_android_arm/test/asan/ARMAndroidConfig/TestCases/Output/pr33372.cpp.tmp
+ /var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/compiler_rt_build_android_arm/test/asan/ARMAndroidConfig/TestCases/Output/pr33372.cpp.tmp

@llvm-ci
Copy link
Collaborator

llvm-ci commented Aug 29, 2024

LLVM Buildbot has detected a new failure on builder clang-x64-windows-msvc running on windows-gcebot2 while building clang,llvm,mlir at step 4 "annotate".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/63/builds/1273

Here is the relevant piece of the build log for the reference
Step 4 (annotate) failure: 'python ../llvm-zorg/zorg/buildbot/builders/annotated/clang-windows.py ...' (failure)
...
  Passed           : 37763 (99.09%)
  Expectedly Failed:    34 (0.09%)
[317/318] Running the LLVM regression tests
llvm-lit.py: C:\b\slave\clang-x64-windows-msvc\llvm-project\llvm\utils\lit\lit\llvm\config.py:57: note: using lit tools: C:\Program Files\Git\usr\bin
llvm-lit.py: C:\b\slave\clang-x64-windows-msvc\llvm-project\llvm\utils\lit\lit\llvm\config.py:505: note: using ld.lld: c:\b\slave\clang-x64-windows-msvc\build\stage1\bin\ld.lld.exe
llvm-lit.py: C:\b\slave\clang-x64-windows-msvc\llvm-project\llvm\utils\lit\lit\llvm\config.py:505: note: using lld-link: c:\b\slave\clang-x64-windows-msvc\build\stage1\bin\lld-link.exe
llvm-lit.py: C:\b\slave\clang-x64-windows-msvc\llvm-project\llvm\utils\lit\lit\llvm\config.py:505: note: using ld64.lld: c:\b\slave\clang-x64-windows-msvc\build\stage1\bin\ld64.lld.exe
llvm-lit.py: C:\b\slave\clang-x64-windows-msvc\llvm-project\llvm\utils\lit\lit\llvm\config.py:505: note: using wasm-ld: c:\b\slave\clang-x64-windows-msvc\build\stage1\bin\wasm-ld.exe
-- Testing: 54766 tests, 32 workers --
Testing:  0.. 10.. 20.. 30.. 40.. 50.. 60.. 70.. 80.. 90
FAIL: LLVM-Unit :: Support/./SupportTests.exe/9/43 (45151 of 54766)
******************** TEST 'LLVM-Unit :: Support/./SupportTests.exe/9/43' FAILED ********************
Script(shard):
--
GTEST_OUTPUT=json:C:\b\slave\clang-x64-windows-msvc\build\stage1\unittests\Support\.\SupportTests.exe-LLVM-Unit-3888-9-43.json GTEST_SHUFFLE=0 GTEST_TOTAL_SHARDS=43 GTEST_SHARD_INDEX=9 C:\b\slave\clang-x64-windows-msvc\build\stage1\unittests\Support\.\SupportTests.exe
--

Script:
--
C:\b\slave\clang-x64-windows-msvc\build\stage1\unittests\Support\.\SupportTests.exe --gtest_filter=FormatVariadicTest.Validate
--
C:\b\slave\clang-x64-windows-msvc\llvm-project\llvm\unittests\Support\FormatVariadicTest.cpp(716): error: Value of: Str
Expected: has substring "Unexpected number of arguments"
  Actual: "1"

C:\b\slave\clang-x64-windows-msvc\llvm-project\llvm\unittests\Support\FormatVariadicTest.cpp(719): error: Value of: Str
Expected: has substring "eplacement indices have holes"
  Actual: "1 3"


C:\b\slave\clang-x64-windows-msvc\llvm-project\llvm\unittests\Support\FormatVariadicTest.cpp:716
Value of: Str
Expected: has substring "Unexpected number of arguments"
  Actual: "1"

C:\b\slave\clang-x64-windows-msvc\llvm-project\llvm\unittests\Support\FormatVariadicTest.cpp:719
Value of: Str
Expected: has substring "eplacement indices have holes"
  Actual: "1 3"



********************
Testing:  0.. 10.. 20.. 30.. 40.. 50.. 60.. 70.. 80.. 90..
********************
Failed Tests (1):
  LLVM-Unit :: Support/./SupportTests.exe/FormatVariadicTest/Validate


Step 8 (stage 1 check) failure: stage 1 check (failure)
...
  Passed           : 37763 (99.09%)
  Expectedly Failed:    34 (0.09%)
[317/318] Running the LLVM regression tests
llvm-lit.py: C:\b\slave\clang-x64-windows-msvc\llvm-project\llvm\utils\lit\lit\llvm\config.py:57: note: using lit tools: C:\Program Files\Git\usr\bin
llvm-lit.py: C:\b\slave\clang-x64-windows-msvc\llvm-project\llvm\utils\lit\lit\llvm\config.py:505: note: using ld.lld: c:\b\slave\clang-x64-windows-msvc\build\stage1\bin\ld.lld.exe
llvm-lit.py: C:\b\slave\clang-x64-windows-msvc\llvm-project\llvm\utils\lit\lit\llvm\config.py:505: note: using lld-link: c:\b\slave\clang-x64-windows-msvc\build\stage1\bin\lld-link.exe
llvm-lit.py: C:\b\slave\clang-x64-windows-msvc\llvm-project\llvm\utils\lit\lit\llvm\config.py:505: note: using ld64.lld: c:\b\slave\clang-x64-windows-msvc\build\stage1\bin\ld64.lld.exe
llvm-lit.py: C:\b\slave\clang-x64-windows-msvc\llvm-project\llvm\utils\lit\lit\llvm\config.py:505: note: using wasm-ld: c:\b\slave\clang-x64-windows-msvc\build\stage1\bin\wasm-ld.exe
-- Testing: 54766 tests, 32 workers --
Testing:  0.. 10.. 20.. 30.. 40.. 50.. 60.. 70.. 80.. 90
FAIL: LLVM-Unit :: Support/./SupportTests.exe/9/43 (45151 of 54766)
******************** TEST 'LLVM-Unit :: Support/./SupportTests.exe/9/43' FAILED ********************
Script(shard):
--
GTEST_OUTPUT=json:C:\b\slave\clang-x64-windows-msvc\build\stage1\unittests\Support\.\SupportTests.exe-LLVM-Unit-3888-9-43.json GTEST_SHUFFLE=0 GTEST_TOTAL_SHARDS=43 GTEST_SHARD_INDEX=9 C:\b\slave\clang-x64-windows-msvc\build\stage1\unittests\Support\.\SupportTests.exe
--

Script:
--
C:\b\slave\clang-x64-windows-msvc\build\stage1\unittests\Support\.\SupportTests.exe --gtest_filter=FormatVariadicTest.Validate
--
C:\b\slave\clang-x64-windows-msvc\llvm-project\llvm\unittests\Support\FormatVariadicTest.cpp(716): error: Value of: Str
Expected: has substring "Unexpected number of arguments"
  Actual: "1"

C:\b\slave\clang-x64-windows-msvc\llvm-project\llvm\unittests\Support\FormatVariadicTest.cpp(719): error: Value of: Str
Expected: has substring "eplacement indices have holes"
  Actual: "1 3"


C:\b\slave\clang-x64-windows-msvc\llvm-project\llvm\unittests\Support\FormatVariadicTest.cpp:716
Value of: Str
Expected: has substring "Unexpected number of arguments"
  Actual: "1"

C:\b\slave\clang-x64-windows-msvc\llvm-project\llvm\unittests\Support\FormatVariadicTest.cpp:719
Value of: Str
Expected: has substring "eplacement indices have holes"
  Actual: "1 3"



********************
Testing:  0.. 10.. 20.. 30.. 40.. 50.. 60.. 70.. 80.. 90..
********************
Failed Tests (1):
  LLVM-Unit :: Support/./SupportTests.exe/FormatVariadicTest/Validate



@llvm-ci
Copy link
Collaborator

llvm-ci commented Aug 30, 2024

LLVM Buildbot has detected a new failure on builder clang-with-thin-lto-ubuntu running on as-worker-92 while building clang,llvm,mlir at step 7 "test-stage1-compiler".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/127/builds/667

Here is the relevant piece of the build log for the reference
Step 7 (test-stage1-compiler) failure: build (failure)
...
llvm-lit: /home/buildbot/as-worker-92/clang-with-thin-lto-ubuntu/llvm-project/llvm/utils/lit/lit/llvm/config.py:505: note: using ld64.lld: /home/buildbot/as-worker-92/clang-with-thin-lto-ubuntu/build/stage1/bin/ld64.lld
llvm-lit: /home/buildbot/as-worker-92/clang-with-thin-lto-ubuntu/llvm-project/llvm/utils/lit/lit/llvm/config.py:505: note: using wasm-ld: /home/buildbot/as-worker-92/clang-with-thin-lto-ubuntu/build/stage1/bin/wasm-ld
llvm-lit: /home/buildbot/as-worker-92/clang-with-thin-lto-ubuntu/build/stage1/utils/lit/tests/lit.cfg:111: warning: Setting a timeout per test not supported. Requires the Python psutil module but it could not be found. Try installing it via pip or via your operating system's package manager.
 Some tests will be skipped and the --timeout command line argument will not work.
llvm-lit: /home/buildbot/as-worker-92/clang-with-thin-lto-ubuntu/llvm-project/llvm/utils/lit/lit/llvm/config.py:505: note: using ld.lld: /home/buildbot/as-worker-92/clang-with-thin-lto-ubuntu/build/stage1/bin/ld.lld
llvm-lit: /home/buildbot/as-worker-92/clang-with-thin-lto-ubuntu/llvm-project/llvm/utils/lit/lit/llvm/config.py:505: note: using lld-link: /home/buildbot/as-worker-92/clang-with-thin-lto-ubuntu/build/stage1/bin/lld-link
llvm-lit: /home/buildbot/as-worker-92/clang-with-thin-lto-ubuntu/llvm-project/llvm/utils/lit/lit/llvm/config.py:505: note: using ld64.lld: /home/buildbot/as-worker-92/clang-with-thin-lto-ubuntu/build/stage1/bin/ld64.lld
llvm-lit: /home/buildbot/as-worker-92/clang-with-thin-lto-ubuntu/llvm-project/llvm/utils/lit/lit/llvm/config.py:505: note: using wasm-ld: /home/buildbot/as-worker-92/clang-with-thin-lto-ubuntu/build/stage1/bin/wasm-ld
-- Testing: 80249 tests, 72 workers --
Testing:  0.. 10.. 20.. 30.. 40.. 50.. 60.. 70.. 80.. 90
FAIL: LLVM-Unit :: Support/./SupportTests/54/85 (76360 of 80249)
******************** TEST 'LLVM-Unit :: Support/./SupportTests/54/85' FAILED ********************
Script(shard):
--
GTEST_OUTPUT=json:/home/buildbot/as-worker-92/clang-with-thin-lto-ubuntu/build/stage1/unittests/Support/./SupportTests-LLVM-Unit-2613415-54-85.json GTEST_SHUFFLE=0 GTEST_TOTAL_SHARDS=85 GTEST_SHARD_INDEX=54 /home/buildbot/as-worker-92/clang-with-thin-lto-ubuntu/build/stage1/unittests/Support/./SupportTests
--

Script:
--
/home/buildbot/as-worker-92/clang-with-thin-lto-ubuntu/build/stage1/unittests/Support/./SupportTests --gtest_filter=FormatVariadicTest.Validate
--
/home/buildbot/as-worker-92/clang-with-thin-lto-ubuntu/llvm-project/llvm/unittests/Support/FormatVariadicTest.cpp:716: Failure
Value of: Str
Expected: has substring "Unexpected number of arguments"
  Actual: "1"

/home/buildbot/as-worker-92/clang-with-thin-lto-ubuntu/llvm-project/llvm/unittests/Support/FormatVariadicTest.cpp:719: Failure
Value of: Str
Expected: has substring "eplacement indices have holes"
  Actual: "1 3"


/home/buildbot/as-worker-92/clang-with-thin-lto-ubuntu/llvm-project/llvm/unittests/Support/FormatVariadicTest.cpp:716
Value of: Str
Expected: has substring "Unexpected number of arguments"
  Actual: "1"

/home/buildbot/as-worker-92/clang-with-thin-lto-ubuntu/llvm-project/llvm/unittests/Support/FormatVariadicTest.cpp:719
Value of: Str
Expected: has substring "eplacement indices have holes"
  Actual: "1 3"



********************
Testing:  0.. 10.. 20.. 30.. 40.. 50.. 60.. 70.. 80.. 90.. 

1 warning(s) in tests
********************

Mogball pushed a commit that referenced this pull request Sep 6, 2024
PR #105745 requires that `formatv` calls have the correct number of
arguments. This call to `Logger::info` was incorrect.
@llvm-ci
Copy link
Collaborator

llvm-ci commented Sep 6, 2024

LLVM Buildbot has detected a new failure on builder clang-with-lto-ubuntu running on as-worker-91 while building clang,llvm,mlir at step 7 "test-stage1-compiler".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/49/builds/431

Here is the relevant piece of the build log for the reference
Step 7 (test-stage1-compiler) failure: build (failure)
...
llvm-lit: /home/buildbot/as-worker-91/clang-with-lto-ubuntu/llvm-project/llvm/utils/lit/lit/llvm/config.py:505: note: using ld64.lld: /home/buildbot/as-worker-91/clang-with-lto-ubuntu/build/stage1/bin/ld64.lld
llvm-lit: /home/buildbot/as-worker-91/clang-with-lto-ubuntu/llvm-project/llvm/utils/lit/lit/llvm/config.py:505: note: using wasm-ld: /home/buildbot/as-worker-91/clang-with-lto-ubuntu/build/stage1/bin/wasm-ld
llvm-lit: /home/buildbot/as-worker-91/clang-with-lto-ubuntu/build/stage1/utils/lit/tests/lit.cfg:111: warning: Setting a timeout per test not supported. Requires the Python psutil module but it could not be found. Try installing it via pip or via your operating system's package manager.
 Some tests will be skipped and the --timeout command line argument will not work.
llvm-lit: /home/buildbot/as-worker-91/clang-with-lto-ubuntu/llvm-project/llvm/utils/lit/lit/llvm/config.py:505: note: using ld.lld: /home/buildbot/as-worker-91/clang-with-lto-ubuntu/build/stage1/bin/ld.lld
llvm-lit: /home/buildbot/as-worker-91/clang-with-lto-ubuntu/llvm-project/llvm/utils/lit/lit/llvm/config.py:505: note: using lld-link: /home/buildbot/as-worker-91/clang-with-lto-ubuntu/build/stage1/bin/lld-link
llvm-lit: /home/buildbot/as-worker-91/clang-with-lto-ubuntu/llvm-project/llvm/utils/lit/lit/llvm/config.py:505: note: using ld64.lld: /home/buildbot/as-worker-91/clang-with-lto-ubuntu/build/stage1/bin/ld64.lld
llvm-lit: /home/buildbot/as-worker-91/clang-with-lto-ubuntu/llvm-project/llvm/utils/lit/lit/llvm/config.py:505: note: using wasm-ld: /home/buildbot/as-worker-91/clang-with-lto-ubuntu/build/stage1/bin/wasm-ld
-- Testing: 80249 tests, 72 workers --
Testing:  0.. 10.. 20.. 30.. 40.. 50.. 60.. 70.. 80.. 90
FAIL: LLVM-Unit :: Support/./SupportTests/54/85 (76365 of 80249)
******************** TEST 'LLVM-Unit :: Support/./SupportTests/54/85' FAILED ********************
Script(shard):
--
GTEST_OUTPUT=json:/home/buildbot/as-worker-91/clang-with-lto-ubuntu/build/stage1/unittests/Support/./SupportTests-LLVM-Unit-3381136-54-85.json GTEST_SHUFFLE=0 GTEST_TOTAL_SHARDS=85 GTEST_SHARD_INDEX=54 /home/buildbot/as-worker-91/clang-with-lto-ubuntu/build/stage1/unittests/Support/./SupportTests
--

Script:
--
/home/buildbot/as-worker-91/clang-with-lto-ubuntu/build/stage1/unittests/Support/./SupportTests --gtest_filter=FormatVariadicTest.Validate
--
/home/buildbot/as-worker-91/clang-with-lto-ubuntu/llvm-project/llvm/unittests/Support/FormatVariadicTest.cpp:716: Failure
Value of: Str
Expected: has substring "Unexpected number of arguments"
  Actual: "1"

/home/buildbot/as-worker-91/clang-with-lto-ubuntu/llvm-project/llvm/unittests/Support/FormatVariadicTest.cpp:719: Failure
Value of: Str
Expected: has substring "eplacement indices have holes"
  Actual: "1 3"


/home/buildbot/as-worker-91/clang-with-lto-ubuntu/llvm-project/llvm/unittests/Support/FormatVariadicTest.cpp:716
Value of: Str
Expected: has substring "Unexpected number of arguments"
  Actual: "1"

/home/buildbot/as-worker-91/clang-with-lto-ubuntu/llvm-project/llvm/unittests/Support/FormatVariadicTest.cpp:719
Value of: Str
Expected: has substring "eplacement indices have holes"
  Actual: "1 3"



********************
Testing:  0.. 10.. 20.. 30.. 40.. 50.. 60.. 70.. 80.. 90.. 

1 warning(s) in tests
********************

github-merge-queue bot pushed a commit to carbon-language/carbon-lang that referenced this pull request Sep 9, 2024
llvm/llvm-project#105745 increased validation of
formatv requirements, this fixes a couple issues.

Note the CommandLine case was untested, and caught separately.
nirvedhmeshram added a commit to iree-org/iree that referenced this pull request Sep 12, 2024
Bumps llvm to commit:
iree-org/llvm-project@e268afb
in branch
https://github.com/iree-org/llvm-project/tree/shared/integrates_20240910

Following changes are made:
1. Fix formatv call to pass validation added by
llvm/llvm-project#105745
2. API changes in DICompositeTypeAttr::get introduced by
llvm/llvm-project#106571
  3. Fix API call from llvm/llvm-project#100361
  4. Fix chipset comparison in ROCMTarget.cpp

There are two cherry-picks from upstream main as they contain fixes we
need and one cheery-pick that is yet to land
1.
iree-org/llvm-project@0d5d355
2.
iree-org/llvm-project@650d852
3.
iree-org/llvm-project@e268afb
(the upstream PR for this one is
llvm/llvm-project#108302

And a revert due to an outstanding torch-mlir issue

iree-org/llvm-project@cf22797
VitaNuo pushed a commit to VitaNuo/llvm-project that referenced this pull request Sep 12, 2024
PR llvm#105745 requires that `formatv` calls have the correct number of
arguments. This call to `Logger::info` was incorrect.
josemonsalve2 pushed a commit to josemonsalve2/iree that referenced this pull request Sep 14, 2024
Bumps llvm to commit:
iree-org/llvm-project@e268afb
in branch
https://github.com/iree-org/llvm-project/tree/shared/integrates_20240910

Following changes are made:
1. Fix formatv call to pass validation added by
llvm/llvm-project#105745
2. API changes in DICompositeTypeAttr::get introduced by
llvm/llvm-project#106571
  3. Fix API call from llvm/llvm-project#100361
  4. Fix chipset comparison in ROCMTarget.cpp

There are two cherry-picks from upstream main as they contain fixes we
need and one cheery-pick that is yet to land
1.
iree-org/llvm-project@0d5d355
2.
iree-org/llvm-project@650d852
3.
iree-org/llvm-project@e268afb
(the upstream PR for this one is
llvm/llvm-project#108302

And a revert due to an outstanding torch-mlir issue

iree-org/llvm-project@cf22797
@llvm-ci
Copy link
Collaborator

llvm-ci commented Sep 20, 2024

LLVM Buildbot has detected a new failure on builder clang-s390x-linux-multistage running on systemz-1 while building clang,llvm,mlir at step 11 "ninja check 2".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/98/builds/388

Here is the relevant piece of the build log for the reference
Step 11 (ninja check 2) failure: stage 2 checked (failure)
******************** TEST 'libFuzzer-s390x-default-Linux :: fuzzer-timeout.test' FAILED ********************
Exit Code: 1

Command Output (stderr):
--
RUN: at line 1: /home/uweigand/sandbox/buildbot/clang-s390x-linux-multistage/stage2/./bin/clang    -Wthread-safety -Wthread-safety-reference -Wthread-safety-beta   --driver-mode=g++ -O2 -gline-tables-only -fsanitize=address,fuzzer -I/home/uweigand/sandbox/buildbot/clang-s390x-linux-multistage/llvm/compiler-rt/lib/fuzzer  /home/uweigand/sandbox/buildbot/clang-s390x-linux-multistage/llvm/compiler-rt/test/fuzzer/TimeoutTest.cpp -o /home/uweigand/sandbox/buildbot/clang-s390x-linux-multistage/stage2/runtimes/runtimes-bins/compiler-rt/test/fuzzer/S390XDefaultLinuxConfig/Output/fuzzer-timeout.test.tmp-TimeoutTest
+ /home/uweigand/sandbox/buildbot/clang-s390x-linux-multistage/stage2/./bin/clang -Wthread-safety -Wthread-safety-reference -Wthread-safety-beta --driver-mode=g++ -O2 -gline-tables-only -fsanitize=address,fuzzer -I/home/uweigand/sandbox/buildbot/clang-s390x-linux-multistage/llvm/compiler-rt/lib/fuzzer /home/uweigand/sandbox/buildbot/clang-s390x-linux-multistage/llvm/compiler-rt/test/fuzzer/TimeoutTest.cpp -o /home/uweigand/sandbox/buildbot/clang-s390x-linux-multistage/stage2/runtimes/runtimes-bins/compiler-rt/test/fuzzer/S390XDefaultLinuxConfig/Output/fuzzer-timeout.test.tmp-TimeoutTest
RUN: at line 2: /home/uweigand/sandbox/buildbot/clang-s390x-linux-multistage/stage2/./bin/clang    -Wthread-safety -Wthread-safety-reference -Wthread-safety-beta   --driver-mode=g++ -O2 -gline-tables-only -fsanitize=address,fuzzer -I/home/uweigand/sandbox/buildbot/clang-s390x-linux-multistage/llvm/compiler-rt/lib/fuzzer  /home/uweigand/sandbox/buildbot/clang-s390x-linux-multistage/llvm/compiler-rt/test/fuzzer/TimeoutEmptyTest.cpp -o /home/uweigand/sandbox/buildbot/clang-s390x-linux-multistage/stage2/runtimes/runtimes-bins/compiler-rt/test/fuzzer/S390XDefaultLinuxConfig/Output/fuzzer-timeout.test.tmp-TimeoutEmptyTest
+ /home/uweigand/sandbox/buildbot/clang-s390x-linux-multistage/stage2/./bin/clang -Wthread-safety -Wthread-safety-reference -Wthread-safety-beta --driver-mode=g++ -O2 -gline-tables-only -fsanitize=address,fuzzer -I/home/uweigand/sandbox/buildbot/clang-s390x-linux-multistage/llvm/compiler-rt/lib/fuzzer /home/uweigand/sandbox/buildbot/clang-s390x-linux-multistage/llvm/compiler-rt/test/fuzzer/TimeoutEmptyTest.cpp -o /home/uweigand/sandbox/buildbot/clang-s390x-linux-multistage/stage2/runtimes/runtimes-bins/compiler-rt/test/fuzzer/S390XDefaultLinuxConfig/Output/fuzzer-timeout.test.tmp-TimeoutEmptyTest
RUN: at line 3: not  /home/uweigand/sandbox/buildbot/clang-s390x-linux-multistage/stage2/runtimes/runtimes-bins/compiler-rt/test/fuzzer/S390XDefaultLinuxConfig/Output/fuzzer-timeout.test.tmp-TimeoutTest -timeout=1 2>&1 | FileCheck /home/uweigand/sandbox/buildbot/clang-s390x-linux-multistage/llvm/compiler-rt/test/fuzzer/fuzzer-timeout.test --check-prefix=TimeoutTest
+ not /home/uweigand/sandbox/buildbot/clang-s390x-linux-multistage/stage2/runtimes/runtimes-bins/compiler-rt/test/fuzzer/S390XDefaultLinuxConfig/Output/fuzzer-timeout.test.tmp-TimeoutTest -timeout=1
+ FileCheck /home/uweigand/sandbox/buildbot/clang-s390x-linux-multistage/llvm/compiler-rt/test/fuzzer/fuzzer-timeout.test --check-prefix=TimeoutTest
RUN: at line 12: not  /home/uweigand/sandbox/buildbot/clang-s390x-linux-multistage/stage2/runtimes/runtimes-bins/compiler-rt/test/fuzzer/S390XDefaultLinuxConfig/Output/fuzzer-timeout.test.tmp-TimeoutTest -timeout=1 /home/uweigand/sandbox/buildbot/clang-s390x-linux-multistage/llvm/compiler-rt/test/fuzzer/hi.txt 2>&1 | FileCheck /home/uweigand/sandbox/buildbot/clang-s390x-linux-multistage/llvm/compiler-rt/test/fuzzer/fuzzer-timeout.test --check-prefix=SingleInputTimeoutTest
+ not /home/uweigand/sandbox/buildbot/clang-s390x-linux-multistage/stage2/runtimes/runtimes-bins/compiler-rt/test/fuzzer/S390XDefaultLinuxConfig/Output/fuzzer-timeout.test.tmp-TimeoutTest -timeout=1 /home/uweigand/sandbox/buildbot/clang-s390x-linux-multistage/llvm/compiler-rt/test/fuzzer/hi.txt
+ FileCheck /home/uweigand/sandbox/buildbot/clang-s390x-linux-multistage/llvm/compiler-rt/test/fuzzer/fuzzer-timeout.test --check-prefix=SingleInputTimeoutTest
RUN: at line 16: /home/uweigand/sandbox/buildbot/clang-s390x-linux-multistage/stage2/runtimes/runtimes-bins/compiler-rt/test/fuzzer/S390XDefaultLinuxConfig/Output/fuzzer-timeout.test.tmp-TimeoutTest -timeout=1 -timeout_exitcode=0
+ /home/uweigand/sandbox/buildbot/clang-s390x-linux-multistage/stage2/runtimes/runtimes-bins/compiler-rt/test/fuzzer/S390XDefaultLinuxConfig/Output/fuzzer-timeout.test.tmp-TimeoutTest -timeout=1 -timeout_exitcode=0
INFO: Running with entropic power schedule (0xFF, 100).
INFO: Seed: 826913915
INFO: Loaded 1 modules   (13 inline 8-bit counters): 13 [0x2aa17269e48, 0x2aa17269e55), 
INFO: Loaded 1 PC tables (13 PCs): 13 [0x2aa17269e58,0x2aa17269f28), 
INFO: -max_len is not provided; libFuzzer will not generate inputs larger than 4096 bytes
INFO: A corpus is not provided, starting from an empty corpus
#2	INITED cov: 2 ft: 2 corp: 1/1b exec/s: 0 rss: 32Mb
#118	NEW    cov: 3 ft: 3 corp: 2/2b lim: 4 exec/s: 0 rss: 32Mb L: 1/1 MS: 1 ChangeByte-
#134	NEW    cov: 4 ft: 4 corp: 3/4b lim: 4 exec/s: 0 rss: 32Mb L: 2/2 MS: 1 CrossOver-
#275	NEW    cov: 5 ft: 5 corp: 4/7b lim: 4 exec/s: 0 rss: 32Mb L: 3/3 MS: 1 InsertByte-
#374	NEW    cov: 6 ft: 6 corp: 5/9b lim: 4 exec/s: 0 rss: 32Mb L: 2/3 MS: 4 CrossOver-ChangeByte-CopyPart-EraseBytes-
ALARM: working on the last Unit for 1 seconds
       and the timeout value is 1 (use -timeout=N to change)
MS: 1 InsertRepeatedBytes-; base unit: bf397014ecbce0b1be8d9011c77f6181927a357f
0x48,0x69,0x21,0x21,0x21,0x21,0x21,0x21,0x21,0x21,0x21,0x21,0x21,0x21,0x21,0x21,0x21,0x21,0x21,0x21,0x21,0x21,0x21,0x21,0x21,0x21,0x21,0x21,0x21,0x21,0x21,0x21,0x21,0x21,0x21,0x21,0x21,0x21,0x21,0x21,0x21,0x21,0x21,0x21,0x21,0x21,0x21,0x21,0x21,0x21,0x21,0x21,0x21,0x21,0x21,0x21,0x21,0x21,0x21,0x21,0x21,0x48,
Hi!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!H
artifact_prefix='./'; Test unit written to ./timeout-00d2a1868431de116292a2e6db9305f70d559fd1
Base64: SGkhISEhISEhISEhISEhISEhISEhISEhISEhISEhISEhISEhISEhISEhISEhISEhISEhISEhISEhISEhIUg=
==3749969== ERROR: libFuzzer: timeout after 1 seconds
AddressSanitizer:DEADLYSIGNAL
=================================================================
AddressSanitizer:DEADLYSIGNAL
=================================================================
AddressSanitizer: CHECK failed: asan_report.cpp:199 "((current_error_.kind)) == ((kErrorKindInvalid))" (0x1, 0x0) (tid=3749969)
    <empty stack>

MS: 1 InsertRepeatedBytes-; base unit: bf397014ecbce0b1be8d9011c77f6181927a357f
0x48,0x69,0x21,0x21,0x21,0x21,0x21,0x21,0x21,0x21,0x21,0x21,0x21,0x21,0x21,0x21,0x21,0x21,0x21,0x21,0x21,0x21,0x21,0x21,0x21,0x21,0x21,0x21,0x21,0x21,0x21,0x21,0x21,0x21,0x21,0x21,0x21,0x21,0x21,0x21,0x21,0x21,0x21,0x21,0x21,0x21,0x21,0x21,0x21,0x21,0x21,0x21,0x21,0x21,0x21,0x21,0x21,0x21,0x21,0x21,0x21,0x48,
Hi!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!H
artifact_prefix='./'; Test unit written to ./crash-00d2a1868431de116292a2e6db9305f70d559fd1
Base64: SGkhISEhISEhISEhISEhISEhISEhISEhISEhISEhISEhISEhISEhISEhISEhISEhISEhISEhISEhISEhIUg=

--
...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants