Skip to content

Conversation

@Nerixyz
Copy link
Contributor

@Nerixyz Nerixyz commented Nov 5, 2025

The section headers present in the DBI stream got lost when using pdb2yaml and yaml2pdb.

They are a list of COFF section headers. The llvm::object::coff_section didn't have a YAML mapping, so I added one in llvm-pdbutil. The mapping for COFF sections in ObjectYAML includes the section data itself, so we can't use it here.

Creation of the section map and headers in yaml2pdb is done like in LLD:

llvm-project/lld/COFF/PDB.cpp

Lines 1695 to 1703 in 438a18c

// Add Section Map stream.
ArrayRef<object::coff_section> sections = {
(const object::coff_section *)sectionTable.data(),
sectionTable.size() / sizeof(object::coff_section)};
dbiBuilder.createSectionMap(sections);
// Add COFF section header stream.
exitOnErr(
dbiBuilder.addDbgStream(pdb::DbgHeaderType::SectionHdr, sectionTable));

@Nerixyz Nerixyz requested a review from aganea November 5, 2025 14:13
@llvmbot
Copy link
Member

llvmbot commented Nov 5, 2025

@llvm/pr-subscribers-debuginfo

Author: nerix (Nerixyz)

Changes

The section headers present in the DBI stream got lost when using pdb2yaml and yaml2pdb.

They are a list of COFF section headers. The llvm::object::coff_section didn't have a YAML mapping, so I added one in llvm-pdbutil. The mapping for COFF sections in ObjectYAML includes the section data itself, so we can't use it here.

Creation of the section map and headers in yaml2pdb is done like in LLD:

llvm-project/lld/COFF/PDB.cpp

Lines 1695 to 1703 in 438a18c

// Add Section Map stream.
ArrayRef<object::coff_section> sections = {
(const object::coff_section *)sectionTable.data(),
sectionTable.size() / sizeof(object::coff_section)};
dbiBuilder.createSectionMap(sections);
// Add COFF section header stream.
exitOnErr(
dbiBuilder.addDbgStream(pdb::DbgHeaderType::SectionHdr, sectionTable));


Full diff: https://github.com/llvm/llvm-project/pull/166566.diff

5 Files Affected:

  • (added) llvm/test/tools/llvm-pdbutil/dbi-section-headers.test (+131)
  • (modified) llvm/tools/llvm-pdbutil/PdbYaml.cpp (+45)
  • (modified) llvm/tools/llvm-pdbutil/PdbYaml.h (+21)
  • (modified) llvm/tools/llvm-pdbutil/YAMLOutputStyle.cpp (+14)
  • (modified) llvm/tools/llvm-pdbutil/llvm-pdbutil.cpp (+13)
diff --git a/llvm/test/tools/llvm-pdbutil/dbi-section-headers.test b/llvm/test/tools/llvm-pdbutil/dbi-section-headers.test
new file mode 100644
index 0000000000000..bced13cc25199
--- /dev/null
+++ b/llvm/test/tools/llvm-pdbutil/dbi-section-headers.test
@@ -0,0 +1,131 @@
+# RUN: llvm-pdbutil yaml2pdb %s --pdb=%t.pdb
+# RUN: llvm-pdbutil dump --section-headers --section-map %t.pdb | FileCheck --check-prefix=CHECK-YAML2PDB %s
+
+# RUN: llvm-pdbutil pdb2yaml --dbi-stream %t.pdb > %t.yaml
+# RUN: FileCheck --input-file=%t.yaml --check-prefix=CHECK-PDB2YAML %s
+
+# CHECK-YAML2PDB:                      Section Headers
+# CHECK-YAML2PDB:  SECTION HEADER #1
+# CHECK-YAML2PDB:     .text name
+# CHECK-YAML2PDB:        47 virtual size
+# CHECK-YAML2PDB:      1000 virtual address
+# CHECK-YAML2PDB:       200 size of raw data
+# CHECK-YAML2PDB:       400 file pointer to raw data
+# CHECK-YAML2PDB:         0 file pointer to relocation table
+# CHECK-YAML2PDB:         0 file pointer to line numbers
+# CHECK-YAML2PDB:         0 number of relocations
+# CHECK-YAML2PDB:         0 number of line numbers
+# CHECK-YAML2PDB:  60000020 flags
+# CHECK-YAML2PDB:           IMAGE_SCN_CNT_CODE
+# CHECK-YAML2PDB:           IMAGE_SCN_MEM_EXECUTE
+# CHECK-YAML2PDB:           IMAGE_SCN_MEM_READ
+
+# CHECK-YAML2PDB:  SECTION HEADER #2
+# CHECK-YAML2PDB:    .rdata name
+# CHECK-YAML2PDB:        64 virtual size
+# CHECK-YAML2PDB:      2000 virtual address
+# CHECK-YAML2PDB:       200 size of raw data
+# CHECK-YAML2PDB:       600 file pointer to raw data
+# CHECK-YAML2PDB:         0 file pointer to relocation table
+# CHECK-YAML2PDB:         0 file pointer to line numbers
+# CHECK-YAML2PDB:         0 number of relocations
+# CHECK-YAML2PDB:         0 number of line numbers
+# CHECK-YAML2PDB:  40000040 flags
+# CHECK-YAML2PDB:           IMAGE_SCN_CNT_INITIALIZED_DATA
+# CHECK-YAML2PDB:           IMAGE_SCN_MEM_READ
+
+# CHECK-YAML2PDB:  SECTION HEADER #3
+# CHECK-YAML2PDB:    .pdata name
+# CHECK-YAML2PDB:        18 virtual size
+# CHECK-YAML2PDB:      3000 virtual address
+# CHECK-YAML2PDB:       200 size of raw data
+# CHECK-YAML2PDB:       800 file pointer to raw data
+# CHECK-YAML2PDB:         0 file pointer to relocation table
+# CHECK-YAML2PDB:         0 file pointer to line numbers
+# CHECK-YAML2PDB:         0 number of relocations
+# CHECK-YAML2PDB:         0 number of line numbers
+# CHECK-YAML2PDB:  40000040 flags
+# CHECK-YAML2PDB:           IMAGE_SCN_CNT_INITIALIZED_DATA
+# CHECK-YAML2PDB:           IMAGE_SCN_MEM_READ
+
+# CHECK-YAML2PDB:                        Section Map
+# CHECK-YAML2PDB:  Section 0000 | ovl = 0, group = 0, frame = 1, name = 65535
+# CHECK-YAML2PDB:                 class = 65535, offset = 0, size = 71
+# CHECK-YAML2PDB:                 flags = read | execute | 32 bit addr | selector
+# CHECK-YAML2PDB:  Section 0001 | ovl = 0, group = 0, frame = 2, name = 65535
+# CHECK-YAML2PDB:                 class = 65535, offset = 0, size = 100
+# CHECK-YAML2PDB:                 flags = read | 32 bit addr | selector
+# CHECK-YAML2PDB:  Section 0002 | ovl = 0, group = 0, frame = 3, name = 65535
+# CHECK-YAML2PDB:                 class = 65535, offset = 0, size = 24
+# CHECK-YAML2PDB:                 flags = read | 32 bit addr | selector
+# CHECK-YAML2PDB:  Section 0003 | ovl = 0, group = 0, frame = 4, name = 65535
+# CHECK-YAML2PDB:                 class = 65535, offset = 0, size = 4294967295
+# CHECK-YAML2PDB:                 flags = 32 bit addr | absolute addr
+
+# CHECK-PDB2YAML:DbiStream:
+# CHECK-PDB2YAML:  SectionHeaders:
+# CHECK-PDB2YAML:    - Name:            .text
+# CHECK-PDB2YAML:      VirtualSize:     71
+# CHECK-PDB2YAML:      VirtualAddress:  4096
+# CHECK-PDB2YAML:      SizeOfRawData:   512
+# CHECK-PDB2YAML:      PointerToRawData: 1024
+# CHECK-PDB2YAML:      PointerToRelocations: 0
+# CHECK-PDB2YAML:      PointerToLinenumbers: 0
+# CHECK-PDB2YAML:      NumberOfRelocations: 0
+# CHECK-PDB2YAML:      NumberOfLinenumbers: 0
+# CHECK-PDB2YAML:      Characteristics: 1610612768
+# CHECK-PDB2YAML:    - Name:            .rdata
+# CHECK-PDB2YAML:      VirtualSize:     100
+# CHECK-PDB2YAML:      VirtualAddress:  8192
+# CHECK-PDB2YAML:      SizeOfRawData:   512
+# CHECK-PDB2YAML:      PointerToRawData: 1536
+# CHECK-PDB2YAML:      PointerToRelocations: 0
+# CHECK-PDB2YAML:      PointerToLinenumbers: 0
+# CHECK-PDB2YAML:      NumberOfRelocations: 0
+# CHECK-PDB2YAML:      NumberOfLinenumbers: 0
+# CHECK-PDB2YAML:      Characteristics: 1073741888
+# CHECK-PDB2YAML:    - Name:            .pdata
+# CHECK-PDB2YAML:      VirtualSize:     24
+# CHECK-PDB2YAML:      VirtualAddress:  12288
+# CHECK-PDB2YAML:      SizeOfRawData:   512
+# CHECK-PDB2YAML:      PointerToRawData: 2048
+# CHECK-PDB2YAML:      PointerToRelocations: 0
+# CHECK-PDB2YAML:      PointerToLinenumbers: 0
+# CHECK-PDB2YAML:      NumberOfRelocations: 0
+# CHECK-PDB2YAML:      NumberOfLinenumbers: 0
+# CHECK-PDB2YAML:      Characteristics: 1073741888
+
+---
+DbiStream:
+  SectionHeaders:
+    - Name:            .text
+      VirtualSize:     71
+      VirtualAddress:  4096
+      SizeOfRawData:   512
+      PointerToRawData: 1024
+      PointerToRelocations: 0
+      PointerToLinenumbers: 0
+      NumberOfRelocations: 0
+      NumberOfLinenumbers: 0
+      Characteristics: 1610612768
+    - Name:            .rdata
+      VirtualSize:     100
+      VirtualAddress:  8192
+      SizeOfRawData:   512
+      PointerToRawData: 1536
+      PointerToRelocations: 0
+      PointerToLinenumbers: 0
+      NumberOfRelocations: 0
+      NumberOfLinenumbers: 0
+      Characteristics: 1073741888
+    - Name:            .pdata
+      VirtualSize:     24
+      VirtualAddress:  12288
+      SizeOfRawData:   512
+      PointerToRawData: 2048
+      PointerToRelocations: 0
+      PointerToLinenumbers: 0
+      NumberOfRelocations: 0
+      NumberOfLinenumbers: 0
+      Characteristics: 1073741888
+...
diff --git a/llvm/tools/llvm-pdbutil/PdbYaml.cpp b/llvm/tools/llvm-pdbutil/PdbYaml.cpp
index fac1d89321610..030d8cead24ff 100644
--- a/llvm/tools/llvm-pdbutil/PdbYaml.cpp
+++ b/llvm/tools/llvm-pdbutil/PdbYaml.cpp
@@ -24,6 +24,7 @@ using namespace llvm::yaml;
 
 LLVM_YAML_IS_SEQUENCE_VECTOR(llvm::pdb::yaml::NamedStreamMapping)
 LLVM_YAML_IS_SEQUENCE_VECTOR(llvm::pdb::yaml::PdbDbiModuleInfo)
+LLVM_YAML_IS_SEQUENCE_VECTOR(llvm::pdb::yaml::CoffSectionHeader)
 LLVM_YAML_IS_SEQUENCE_VECTOR(llvm::pdb::yaml::StreamBlockList)
 LLVM_YAML_IS_FLOW_SEQUENCE_VECTOR(llvm::pdb::PdbRaw_FeatureSig)
 
@@ -135,6 +136,49 @@ void MappingTraits<msf::SuperBlock>::mapping(IO &IO, msf::SuperBlock &SB) {
   IO.mapOptional("BlockMapAddr", SB.BlockMapAddr, u32(0U));
 }
 
+CoffSectionHeader::CoffSectionHeader() = default;
+
+CoffSectionHeader::CoffSectionHeader(const object::coff_section &Section)
+    : Name(Section.Name), VirtualSize(Section.VirtualSize),
+      VirtualAddress(Section.VirtualAddress),
+      SizeOfRawData(Section.SizeOfRawData),
+      PointerToRawData(Section.PointerToRawData),
+      PointerToRelocations(Section.PointerToRelocations),
+      PointerToLinenumbers(Section.PointerToLinenumbers),
+      NumberOfRelocations(Section.NumberOfRelocations),
+      NumberOfLinenumbers(Section.NumberOfLinenumbers),
+      Characteristics(Section.Characteristics) {}
+
+object::coff_section CoffSectionHeader::toCoffSection() const {
+  object::coff_section Sec;
+  std::memset(Sec.Name, 0, COFF::NameSize);
+  std::memcpy(Sec.Name, Name.data(),
+              std::min(static_cast<size_t>(COFF::NameSize), Name.size()));
+  Sec.VirtualSize = VirtualSize;
+  Sec.VirtualAddress = VirtualAddress;
+  Sec.SizeOfRawData = SizeOfRawData;
+  Sec.PointerToRawData = PointerToRawData;
+  Sec.PointerToRelocations = PointerToRelocations;
+  Sec.PointerToLinenumbers = PointerToLinenumbers;
+  Sec.NumberOfRelocations = NumberOfRelocations;
+  Sec.NumberOfLinenumbers = NumberOfLinenumbers;
+  Sec.Characteristics = Characteristics;
+  return Sec;
+}
+
+void MappingTraits<CoffSectionHeader>::mapping(IO &IO, CoffSectionHeader &Obj) {
+  IO.mapRequired("Name", Obj.Name);
+  IO.mapOptional("VirtualSize", Obj.VirtualSize);
+  IO.mapOptional("VirtualAddress", Obj.VirtualAddress);
+  IO.mapOptional("SizeOfRawData", Obj.SizeOfRawData);
+  IO.mapOptional("PointerToRawData", Obj.PointerToRawData);
+  IO.mapOptional("PointerToRelocations", Obj.PointerToRelocations);
+  IO.mapOptional("PointerToLinenumbers", Obj.PointerToLinenumbers);
+  IO.mapOptional("NumberOfRelocations", Obj.NumberOfRelocations);
+  IO.mapOptional("NumberOfLinenumbers", Obj.NumberOfLinenumbers);
+  IO.mapOptional("Characteristics", Obj.Characteristics);
+}
+
 void MappingTraits<StreamBlockList>::mapping(IO &IO, StreamBlockList &SB) {
   IO.mapRequired("Stream", SB.Blocks);
 }
@@ -163,6 +207,7 @@ void MappingTraits<PdbDbiStream>::mapping(IO &IO, PdbDbiStream &Obj) {
     IO.setContext(&Obj.FakeHeader);
   }
   IO.mapOptional("Modules", Obj.ModInfos);
+  IO.mapOptional("SectionHeaders", Obj.SectionHeaders);
 }
 
 void MappingTraits<PdbTpiStream>::mapping(IO &IO,
diff --git a/llvm/tools/llvm-pdbutil/PdbYaml.h b/llvm/tools/llvm-pdbutil/PdbYaml.h
index d5111a9e8d3a3..b539428190998 100644
--- a/llvm/tools/llvm-pdbutil/PdbYaml.h
+++ b/llvm/tools/llvm-pdbutil/PdbYaml.h
@@ -18,6 +18,7 @@
 #include "llvm/DebugInfo/PDB/Native/PDBFile.h"
 #include "llvm/DebugInfo/PDB/Native/RawConstants.h"
 #include "llvm/DebugInfo/PDB/PDBTypes.h"
+#include "llvm/Object/COFF.h"
 #include "llvm/ObjectYAML/CodeViewYAMLDebugSections.h"
 #include "llvm/ObjectYAML/CodeViewYAMLSymbols.h"
 #include "llvm/ObjectYAML/CodeViewYAMLTypes.h"
@@ -40,6 +41,24 @@ struct MSFHeaders {
   uint64_t FileSize = 0;
 };
 
+struct CoffSectionHeader {
+  CoffSectionHeader();
+  CoffSectionHeader(const object::coff_section &Section);
+
+  object::coff_section toCoffSection() const;
+
+  StringRef Name;
+  uint32_t VirtualSize = 0;
+  uint32_t VirtualAddress = 0;
+  uint32_t SizeOfRawData = 0;
+  uint32_t PointerToRawData = 0;
+  uint32_t PointerToRelocations = 0;
+  uint32_t PointerToLinenumbers = 0;
+  uint16_t NumberOfRelocations = 0;
+  uint16_t NumberOfLinenumbers = 0;
+  uint32_t Characteristics = 0;
+};
+
 struct StreamBlockList {
   std::vector<uint32_t> Blocks;
 };
@@ -82,6 +101,7 @@ struct PdbDbiStream {
 
   std::vector<PdbDbiModuleInfo> ModInfos;
   COFF::header FakeHeader;
+  std::vector<CoffSectionHeader> SectionHeaders;
 };
 
 struct PdbTpiStream {
@@ -115,6 +135,7 @@ struct PdbObject {
 
 LLVM_YAML_DECLARE_MAPPING_TRAITS_PRIVATE(pdb::yaml::PdbObject)
 LLVM_YAML_DECLARE_MAPPING_TRAITS_PRIVATE(pdb::yaml::MSFHeaders)
+LLVM_YAML_DECLARE_MAPPING_TRAITS_PRIVATE(pdb::yaml::CoffSectionHeader)
 LLVM_YAML_DECLARE_MAPPING_TRAITS_PRIVATE(msf::SuperBlock)
 LLVM_YAML_DECLARE_MAPPING_TRAITS_PRIVATE(pdb::yaml::StreamBlockList)
 LLVM_YAML_DECLARE_MAPPING_TRAITS_PRIVATE(pdb::yaml::PdbInfoStream)
diff --git a/llvm/tools/llvm-pdbutil/YAMLOutputStyle.cpp b/llvm/tools/llvm-pdbutil/YAMLOutputStyle.cpp
index ecb4c2175e49a..24d182134bd6c 100644
--- a/llvm/tools/llvm-pdbutil/YAMLOutputStyle.cpp
+++ b/llvm/tools/llvm-pdbutil/YAMLOutputStyle.cpp
@@ -285,6 +285,20 @@ Error YAMLOutputStyle::dumpDbiStream() {
       }
     }
   }
+  for (const auto &Section : DS.getSectionHeaders()) {
+    yaml::CoffSectionHeader Hdr;
+    Hdr.Name = Section.Name;
+    Hdr.VirtualSize = Section.VirtualSize;
+    Hdr.VirtualAddress = Section.VirtualAddress;
+    Hdr.SizeOfRawData = Section.SizeOfRawData;
+    Hdr.PointerToRawData = Section.PointerToRawData;
+    Hdr.PointerToRelocations = Section.PointerToRelocations;
+    Hdr.PointerToLinenumbers = Section.PointerToLinenumbers;
+    Hdr.NumberOfRelocations = Section.NumberOfRelocations;
+    Hdr.NumberOfLinenumbers = Section.NumberOfLinenumbers;
+    Hdr.Characteristics = Section.Characteristics;
+    Obj.DbiStream->SectionHeaders.emplace_back(Hdr);
+  }
   return Error::success();
 }
 
diff --git a/llvm/tools/llvm-pdbutil/llvm-pdbutil.cpp b/llvm/tools/llvm-pdbutil/llvm-pdbutil.cpp
index a5b8e8b7941d7..20a9bc839f343 100644
--- a/llvm/tools/llvm-pdbutil/llvm-pdbutil.cpp
+++ b/llvm/tools/llvm-pdbutil/llvm-pdbutil.cpp
@@ -865,6 +865,19 @@ static void yamlToPdb(StringRef Path) {
     }
   }
 
+  std::vector<object::coff_section> Sections;
+  if (!Dbi.SectionHeaders.empty()) {
+    for (const auto &Hdr : Dbi.SectionHeaders) {
+      Sections.emplace_back(Hdr.toCoffSection());
+    }
+
+    DbiBuilder.createSectionMap(Sections);
+    ExitOnErr(DbiBuilder.addDbgStream(
+        pdb::DbgHeaderType::SectionHdr,
+        ArrayRef<uint8_t>{(const uint8_t *)Sections.data(),
+                          Sections.size() * sizeof(object::coff_section)}));
+  }
+
   auto &TpiBuilder = Builder.getTpiBuilder();
   const auto &Tpi = YamlObj.TpiStream.value_or(DefaultTpiStream);
   TpiBuilder.setVersionHeader(Tpi.Version);

Copy link
Member

@aganea aganea left a comment

Choose a reason for hiding this comment

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

LGTM, just a few minor things.

@aganea aganea requested a review from mstorsjo November 7, 2025 00:59
Copy link
Member

@aganea aganea left a comment

Choose a reason for hiding this comment

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

LGTM, just a few minor things.

DbiBuilder.createSectionMap(Sections);
ExitOnErr(DbiBuilder.addDbgStream(
pdb::DbgHeaderType::SectionHdr,
ArrayRef<uint8_t>{(const uint8_t *)Sections.data(),
Copy link
Member

Choose a reason for hiding this comment

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

ArrayRef supports constructing from a std::vector directly, you could probably just do ArrayRef(Sections)?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I can't do it here, because Sections is a std::vector<object::coff_section> and the function expects an ArrayRef<uint8_t> (i.e. the element type doesn't match).

Copy link
Member

@aganea aganea Nov 7, 2025

Choose a reason for hiding this comment

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

Ah yes the downcasting from object::coff_section * to uint_8_t * must be explicit. The reason I mentionned it is that I think boilerplate like this doesn't belong in high level code. We should probably have something like arrayRefFromStringRef, but for downcasting any ArrayRef<T> to a ArrayRef<uint8_t>. We can probably do that in a follow-up PR, since this should be a separate discussion.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sorry for the delay. Should I create an issue for this? I can't think of a good name for this function/method(?).

Copy link
Member

Choose a reason for hiding this comment

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

Not sure github issues are really meant as a code cleanup backlog; at least a FIXME comment above would be enough for now.

@Nerixyz Nerixyz merged commit d99c840 into llvm:main Nov 15, 2025
10 checks passed
@llvm-ci
Copy link
Collaborator

llvm-ci commented Nov 15, 2025

LLVM Buildbot has detected a new failure on builder sanitizer-x86_64-linux running on sanitizer-buildbot2 while building llvm at step 2 "annotate".

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

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)
...
llvm-lit: /home/b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/test/lit.common.cfg.py:246: warning: COMPILER_RT_TEST_STANDALONE_BUILD_LIBS=ON, but this test suite does not support testing the just-built runtime libraries when the test compiler is configured to use different runtime libraries. Either modify this test suite to support this test configuration, or set COMPILER_RT_TEST_STANDALONE_BUILD_LIBS=OFF to test the runtime libraries included in the compiler instead.
llvm-lit: /home/b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/test/lit.common.cfg.py:257: note: Testing using libraries in "/home/b/sanitizer-x86_64-linux/build/build_default/./lib/../lib/clang/22/lib/i386-unknown-linux-gnu"
llvm-lit: /home/b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/test/lit.common.cfg.py:235: warning: Compiler lib dir != compiler-rt lib dir
Compiler libdir:     "/home/b/sanitizer-x86_64-linux/build/build_default/lib/clang/22/lib/i386-unknown-linux-gnu"
compiler-rt libdir:  "/home/b/sanitizer-x86_64-linux/build/build_default/lib/clang/22/lib/x86_64-unknown-linux-gnu"
llvm-lit: /home/b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/test/lit.common.cfg.py:246: warning: COMPILER_RT_TEST_STANDALONE_BUILD_LIBS=ON, but this test suite does not support testing the just-built runtime libraries when the test compiler is configured to use different runtime libraries. Either modify this test suite to support this test configuration, or set COMPILER_RT_TEST_STANDALONE_BUILD_LIBS=OFF to test the runtime libraries included in the compiler instead.
llvm-lit: /home/b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/test/lit.common.cfg.py:257: note: Testing using libraries in "/home/b/sanitizer-x86_64-linux/build/build_default/./lib/../lib/clang/22/lib/x86_64-unknown-linux-gnu"
llvm-lit: /home/b/sanitizer-x86_64-linux/build/llvm-project/llvm/utils/lit/lit/main.py:74: note: The test suite configuration requested an individual test timeout of 0 seconds but a timeout of 900 seconds was requested on the command line. Forcing timeout to be 900 seconds.
-- Testing: 10478 tests, 64 workers --
Testing:  0.. 10.. 20.. 30.. 40.. 50.. 60.. 70.. 80.. 90.
FAIL: libFuzzer-x86_64-libcxx-Linux :: reduce_inputs.test (10251 of 10478)
******************** TEST 'libFuzzer-x86_64-libcxx-Linux :: reduce_inputs.test' FAILED ********************
Exit Code: 1

Command Output (stderr):
--
rm -rf /home/b/sanitizer-x86_64-linux/build/build_default/runtimes/runtimes-bins/compiler-rt/test/fuzzer/X86_64LibcxxLinuxConfig/Output/reduce_inputs.test.tmp/C # RUN: at line 3
+ rm -rf /home/b/sanitizer-x86_64-linux/build/build_default/runtimes/runtimes-bins/compiler-rt/test/fuzzer/X86_64LibcxxLinuxConfig/Output/reduce_inputs.test.tmp/C
mkdir -p /home/b/sanitizer-x86_64-linux/build/build_default/runtimes/runtimes-bins/compiler-rt/test/fuzzer/X86_64LibcxxLinuxConfig/Output/reduce_inputs.test.tmp/C # RUN: at line 4
+ mkdir -p /home/b/sanitizer-x86_64-linux/build/build_default/runtimes/runtimes-bins/compiler-rt/test/fuzzer/X86_64LibcxxLinuxConfig/Output/reduce_inputs.test.tmp/C
/home/b/sanitizer-x86_64-linux/build/build_default/./bin/clang    -Wthread-safety -Wthread-safety-reference -Wthread-safety-beta   --driver-mode=g++ -O2 -gline-tables-only -fsanitize=address,fuzzer -I/home/b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/lib/fuzzer -m64 /home/b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/test/fuzzer/ShrinkControlFlowSimpleTest.cpp -o /home/b/sanitizer-x86_64-linux/build/build_default/runtimes/runtimes-bins/compiler-rt/test/fuzzer/X86_64LibcxxLinuxConfig/Output/reduce_inputs.test.tmp-ShrinkControlFlowSimpleTest # RUN: at line 5
+ /home/b/sanitizer-x86_64-linux/build/build_default/./bin/clang -Wthread-safety -Wthread-safety-reference -Wthread-safety-beta --driver-mode=g++ -O2 -gline-tables-only -fsanitize=address,fuzzer -I/home/b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/lib/fuzzer -m64 /home/b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/test/fuzzer/ShrinkControlFlowSimpleTest.cpp -o /home/b/sanitizer-x86_64-linux/build/build_default/runtimes/runtimes-bins/compiler-rt/test/fuzzer/X86_64LibcxxLinuxConfig/Output/reduce_inputs.test.tmp-ShrinkControlFlowSimpleTest
/home/b/sanitizer-x86_64-linux/build/build_default/./bin/clang    -Wthread-safety -Wthread-safety-reference -Wthread-safety-beta   --driver-mode=g++ -O2 -gline-tables-only -fsanitize=address,fuzzer -I/home/b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/lib/fuzzer -m64 /home/b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/test/fuzzer/ShrinkControlFlowTest.cpp -o /home/b/sanitizer-x86_64-linux/build/build_default/runtimes/runtimes-bins/compiler-rt/test/fuzzer/X86_64LibcxxLinuxConfig/Output/reduce_inputs.test.tmp-ShrinkControlFlowTest # RUN: at line 6
+ /home/b/sanitizer-x86_64-linux/build/build_default/./bin/clang -Wthread-safety -Wthread-safety-reference -Wthread-safety-beta --driver-mode=g++ -O2 -gline-tables-only -fsanitize=address,fuzzer -I/home/b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/lib/fuzzer -m64 /home/b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/test/fuzzer/ShrinkControlFlowTest.cpp -o /home/b/sanitizer-x86_64-linux/build/build_default/runtimes/runtimes-bins/compiler-rt/test/fuzzer/X86_64LibcxxLinuxConfig/Output/reduce_inputs.test.tmp-ShrinkControlFlowTest
/home/b/sanitizer-x86_64-linux/build/build_default/runtimes/runtimes-bins/compiler-rt/test/fuzzer/X86_64LibcxxLinuxConfig/Output/reduce_inputs.test.tmp-ShrinkControlFlowSimpleTest  -exit_on_item=0eb8e4ed029b774d80f2b66408203801cb982a60   -runs=1000000 /home/b/sanitizer-x86_64-linux/build/build_default/runtimes/runtimes-bins/compiler-rt/test/fuzzer/X86_64LibcxxLinuxConfig/Output/reduce_inputs.test.tmp/C 2>&1 | FileCheck /home/b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/test/fuzzer/reduce_inputs.test # RUN: at line 7
+ FileCheck /home/b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/test/fuzzer/reduce_inputs.test
+ /home/b/sanitizer-x86_64-linux/build/build_default/runtimes/runtimes-bins/compiler-rt/test/fuzzer/X86_64LibcxxLinuxConfig/Output/reduce_inputs.test.tmp-ShrinkControlFlowSimpleTest -exit_on_item=0eb8e4ed029b774d80f2b66408203801cb982a60 -runs=1000000 /home/b/sanitizer-x86_64-linux/build/build_default/runtimes/runtimes-bins/compiler-rt/test/fuzzer/X86_64LibcxxLinuxConfig/Output/reduce_inputs.test.tmp/C
/home/b/sanitizer-x86_64-linux/build/build_default/runtimes/runtimes-bins/compiler-rt/test/fuzzer/X86_64LibcxxLinuxConfig/Output/reduce_inputs.test.tmp-ShrinkControlFlowSimpleTest -runs=0 /home/b/sanitizer-x86_64-linux/build/build_default/runtimes/runtimes-bins/compiler-rt/test/fuzzer/X86_64LibcxxLinuxConfig/Output/reduce_inputs.test.tmp/C 2>&1 | FileCheck /home/b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/test/fuzzer/reduce_inputs.test --check-prefix=COUNT # RUN: at line 11
+ /home/b/sanitizer-x86_64-linux/build/build_default/runtimes/runtimes-bins/compiler-rt/test/fuzzer/X86_64LibcxxLinuxConfig/Output/reduce_inputs.test.tmp-ShrinkControlFlowSimpleTest -runs=0 /home/b/sanitizer-x86_64-linux/build/build_default/runtimes/runtimes-bins/compiler-rt/test/fuzzer/X86_64LibcxxLinuxConfig/Output/reduce_inputs.test.tmp/C
+ FileCheck /home/b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/test/fuzzer/reduce_inputs.test --check-prefix=COUNT
/home/b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/test/fuzzer/reduce_inputs.test:12:8: error: COUNT: expected string not found in input
COUNT: seed corpus: files: 4
       ^
<stdin>:1:1: note: scanning from here
INFO: Running with entropic power schedule (0xFF, 100).
^
<stdin>:7:7: note: possible intended match here
INFO: seed corpus: files: 3 min: 2b max: 3b total: 7b rss: 31Mb
      ^

Input file: <stdin>
Check file: /home/b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/test/fuzzer/reduce_inputs.test

-dump-input=help explains the following input dump.

Input was:
<<<<<<
            1: INFO: Running with entropic power schedule (0xFF, 100). 
check:12'0     X~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ error: no match found
Step 14 (test compiler-rt default) failure: test compiler-rt default (failure)
...
llvm-lit: /home/b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/test/lit.common.cfg.py:246: warning: COMPILER_RT_TEST_STANDALONE_BUILD_LIBS=ON, but this test suite does not support testing the just-built runtime libraries when the test compiler is configured to use different runtime libraries. Either modify this test suite to support this test configuration, or set COMPILER_RT_TEST_STANDALONE_BUILD_LIBS=OFF to test the runtime libraries included in the compiler instead.
llvm-lit: /home/b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/test/lit.common.cfg.py:257: note: Testing using libraries in "/home/b/sanitizer-x86_64-linux/build/build_default/./lib/../lib/clang/22/lib/i386-unknown-linux-gnu"
llvm-lit: /home/b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/test/lit.common.cfg.py:235: warning: Compiler lib dir != compiler-rt lib dir
Compiler libdir:     "/home/b/sanitizer-x86_64-linux/build/build_default/lib/clang/22/lib/i386-unknown-linux-gnu"
compiler-rt libdir:  "/home/b/sanitizer-x86_64-linux/build/build_default/lib/clang/22/lib/x86_64-unknown-linux-gnu"
llvm-lit: /home/b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/test/lit.common.cfg.py:246: warning: COMPILER_RT_TEST_STANDALONE_BUILD_LIBS=ON, but this test suite does not support testing the just-built runtime libraries when the test compiler is configured to use different runtime libraries. Either modify this test suite to support this test configuration, or set COMPILER_RT_TEST_STANDALONE_BUILD_LIBS=OFF to test the runtime libraries included in the compiler instead.
llvm-lit: /home/b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/test/lit.common.cfg.py:257: note: Testing using libraries in "/home/b/sanitizer-x86_64-linux/build/build_default/./lib/../lib/clang/22/lib/x86_64-unknown-linux-gnu"
llvm-lit: /home/b/sanitizer-x86_64-linux/build/llvm-project/llvm/utils/lit/lit/main.py:74: note: The test suite configuration requested an individual test timeout of 0 seconds but a timeout of 900 seconds was requested on the command line. Forcing timeout to be 900 seconds.
-- Testing: 10478 tests, 64 workers --
Testing:  0.. 10.. 20.. 30.. 40.. 50.. 60.. 70.. 80.. 90.
FAIL: libFuzzer-x86_64-libcxx-Linux :: reduce_inputs.test (10251 of 10478)
******************** TEST 'libFuzzer-x86_64-libcxx-Linux :: reduce_inputs.test' FAILED ********************
Exit Code: 1

Command Output (stderr):
--
rm -rf /home/b/sanitizer-x86_64-linux/build/build_default/runtimes/runtimes-bins/compiler-rt/test/fuzzer/X86_64LibcxxLinuxConfig/Output/reduce_inputs.test.tmp/C # RUN: at line 3
+ rm -rf /home/b/sanitizer-x86_64-linux/build/build_default/runtimes/runtimes-bins/compiler-rt/test/fuzzer/X86_64LibcxxLinuxConfig/Output/reduce_inputs.test.tmp/C
mkdir -p /home/b/sanitizer-x86_64-linux/build/build_default/runtimes/runtimes-bins/compiler-rt/test/fuzzer/X86_64LibcxxLinuxConfig/Output/reduce_inputs.test.tmp/C # RUN: at line 4
+ mkdir -p /home/b/sanitizer-x86_64-linux/build/build_default/runtimes/runtimes-bins/compiler-rt/test/fuzzer/X86_64LibcxxLinuxConfig/Output/reduce_inputs.test.tmp/C
/home/b/sanitizer-x86_64-linux/build/build_default/./bin/clang    -Wthread-safety -Wthread-safety-reference -Wthread-safety-beta   --driver-mode=g++ -O2 -gline-tables-only -fsanitize=address,fuzzer -I/home/b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/lib/fuzzer -m64 /home/b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/test/fuzzer/ShrinkControlFlowSimpleTest.cpp -o /home/b/sanitizer-x86_64-linux/build/build_default/runtimes/runtimes-bins/compiler-rt/test/fuzzer/X86_64LibcxxLinuxConfig/Output/reduce_inputs.test.tmp-ShrinkControlFlowSimpleTest # RUN: at line 5
+ /home/b/sanitizer-x86_64-linux/build/build_default/./bin/clang -Wthread-safety -Wthread-safety-reference -Wthread-safety-beta --driver-mode=g++ -O2 -gline-tables-only -fsanitize=address,fuzzer -I/home/b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/lib/fuzzer -m64 /home/b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/test/fuzzer/ShrinkControlFlowSimpleTest.cpp -o /home/b/sanitizer-x86_64-linux/build/build_default/runtimes/runtimes-bins/compiler-rt/test/fuzzer/X86_64LibcxxLinuxConfig/Output/reduce_inputs.test.tmp-ShrinkControlFlowSimpleTest
/home/b/sanitizer-x86_64-linux/build/build_default/./bin/clang    -Wthread-safety -Wthread-safety-reference -Wthread-safety-beta   --driver-mode=g++ -O2 -gline-tables-only -fsanitize=address,fuzzer -I/home/b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/lib/fuzzer -m64 /home/b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/test/fuzzer/ShrinkControlFlowTest.cpp -o /home/b/sanitizer-x86_64-linux/build/build_default/runtimes/runtimes-bins/compiler-rt/test/fuzzer/X86_64LibcxxLinuxConfig/Output/reduce_inputs.test.tmp-ShrinkControlFlowTest # RUN: at line 6
+ /home/b/sanitizer-x86_64-linux/build/build_default/./bin/clang -Wthread-safety -Wthread-safety-reference -Wthread-safety-beta --driver-mode=g++ -O2 -gline-tables-only -fsanitize=address,fuzzer -I/home/b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/lib/fuzzer -m64 /home/b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/test/fuzzer/ShrinkControlFlowTest.cpp -o /home/b/sanitizer-x86_64-linux/build/build_default/runtimes/runtimes-bins/compiler-rt/test/fuzzer/X86_64LibcxxLinuxConfig/Output/reduce_inputs.test.tmp-ShrinkControlFlowTest
/home/b/sanitizer-x86_64-linux/build/build_default/runtimes/runtimes-bins/compiler-rt/test/fuzzer/X86_64LibcxxLinuxConfig/Output/reduce_inputs.test.tmp-ShrinkControlFlowSimpleTest  -exit_on_item=0eb8e4ed029b774d80f2b66408203801cb982a60   -runs=1000000 /home/b/sanitizer-x86_64-linux/build/build_default/runtimes/runtimes-bins/compiler-rt/test/fuzzer/X86_64LibcxxLinuxConfig/Output/reduce_inputs.test.tmp/C 2>&1 | FileCheck /home/b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/test/fuzzer/reduce_inputs.test # RUN: at line 7
+ FileCheck /home/b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/test/fuzzer/reduce_inputs.test
+ /home/b/sanitizer-x86_64-linux/build/build_default/runtimes/runtimes-bins/compiler-rt/test/fuzzer/X86_64LibcxxLinuxConfig/Output/reduce_inputs.test.tmp-ShrinkControlFlowSimpleTest -exit_on_item=0eb8e4ed029b774d80f2b66408203801cb982a60 -runs=1000000 /home/b/sanitizer-x86_64-linux/build/build_default/runtimes/runtimes-bins/compiler-rt/test/fuzzer/X86_64LibcxxLinuxConfig/Output/reduce_inputs.test.tmp/C
/home/b/sanitizer-x86_64-linux/build/build_default/runtimes/runtimes-bins/compiler-rt/test/fuzzer/X86_64LibcxxLinuxConfig/Output/reduce_inputs.test.tmp-ShrinkControlFlowSimpleTest -runs=0 /home/b/sanitizer-x86_64-linux/build/build_default/runtimes/runtimes-bins/compiler-rt/test/fuzzer/X86_64LibcxxLinuxConfig/Output/reduce_inputs.test.tmp/C 2>&1 | FileCheck /home/b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/test/fuzzer/reduce_inputs.test --check-prefix=COUNT # RUN: at line 11
+ /home/b/sanitizer-x86_64-linux/build/build_default/runtimes/runtimes-bins/compiler-rt/test/fuzzer/X86_64LibcxxLinuxConfig/Output/reduce_inputs.test.tmp-ShrinkControlFlowSimpleTest -runs=0 /home/b/sanitizer-x86_64-linux/build/build_default/runtimes/runtimes-bins/compiler-rt/test/fuzzer/X86_64LibcxxLinuxConfig/Output/reduce_inputs.test.tmp/C
+ FileCheck /home/b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/test/fuzzer/reduce_inputs.test --check-prefix=COUNT
/home/b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/test/fuzzer/reduce_inputs.test:12:8: error: COUNT: expected string not found in input
COUNT: seed corpus: files: 4
       ^
<stdin>:1:1: note: scanning from here
INFO: Running with entropic power schedule (0xFF, 100).
^
<stdin>:7:7: note: possible intended match here
INFO: seed corpus: files: 3 min: 2b max: 3b total: 7b rss: 31Mb
      ^

Input file: <stdin>
Check file: /home/b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/test/fuzzer/reduce_inputs.test

-dump-input=help explains the following input dump.

Input was:
<<<<<<
            1: INFO: Running with entropic power schedule (0xFF, 100). 
check:12'0     X~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ error: no match found

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants