[PATCH] D137882: [DWARFLibrary] Add support to re-construct cu-index

Dmitri Gribenko via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 11 02:09:37 PST 2023


gribozavr2 added a comment.

Sorry, this change causes a MemorySanitizer error in LLVM testsuite. I'm going to revert it. Please investigate, fix, and feel free to re-land.

Here's a sample error from `llvm/test/CodeGen/X86/dwarf-split-line-1.ll`:

  ==6051==WARNING: MemorySanitizer: use-of-uninitialized-value
      #0 0x55fcfe0c7a00 in llvm::DWARFContext::getTUIndex() llvm-project/llvm/lib/DebugInfo/DWARF/DWARFContext.cpp:870:7
      #1 0x55fcfe17365f in operator() llvm-project/llvm/lib/DebugInfo/DWARF/DWARFUnit.cpp:87:39
      #2 0x55fcfe17365f in __invoke<(lambda at llvm-project/llvm/lib/DebugInfo/DWARF/DWARFUnit.cpp:74:14) &, unsigned long, llvm::DWARFSectionKind, const llvm::DWARFSection *, const llvm::DWARFUnitIndex::Entry *> [...]/c++/v1/__functional/invoke.h:394:23
      #3 0x55fcfe17365f in __call<(lambda at llvm-project/llvm/lib/DebugInfo/DWARF/DWARFUnit.cpp:74:14) &, unsigned long, llvm::DWARFSectionKind, const llvm::DWARFSection *, const llvm::DWARFUnitIndex::Entry *> [...]/c++/v1/__functional/invoke.h:478:16
      #4 0x55fcfe17365f in operator() [...]/c++/v1/__functional/function.h:232:12
      #5 0x55fcfe17365f in std::__msan::unique_ptr<llvm::DWARFUnit, std::__msan::default_delete<llvm::DWARFUnit>> std::__msan::__function::__policy_invoker<std::__msan::unique_ptr<llvm::DWARFUnit, std::__msan::default_delete<llvm::DWARFUnit>> (unsigned long, llvm::DWARFSectionKind, llvm::DWARFSection const*, llvm::DWARFUnitIndex::Entry const*)>::__call_impl<std::__msan::__function::__default_alloc_func<llvm::DWARFUnitVector::addUnitsImpl(llvm::DWARFContext&, llvm::DWARFObject const&, llvm::DWARFSection const&, llvm::DWARFDebugAbbrev const*, llvm::DWARFSection const*, llvm::DWARFSection const*, llvm::StringRef, llvm::DWARFSection const&, llvm::DWARFSection const*, llvm::DWARFSection const&, bool, bool, bool, llvm::DWARFSectionKind)::$_0, std::__msan::unique_ptr<llvm::DWARFUnit, std::__msan::default_delete<llvm::DWARFUnit>> (unsigned long, llvm::DWARFSectionKind, llvm::DWARFSection const*, llvm::DWARFUnitIndex::Entry const*)>>(std::__msan::__function::__policy_storage const*, unsigned long, llvm::DWARFSectionKind, llvm::DWARFSection const*, llvm::DWARFUnitIndex::Entry const*) v1/__functional/function.h:711:16
      #6 0x55fcfe166ef6 in operator() [...]/c++/v1/__functional/function.h:842:16
      #7 0x55fcfe166ef6 in operator() [...]/c++/v1/__functional/function.h:1152:12
      #8 0x55fcfe166ef6 in llvm::DWARFUnitVector::addUnitsImpl(llvm::DWARFContext&, llvm::DWARFObject const&, llvm::DWARFSection const&, llvm::DWARFDebugAbbrev const*, llvm::DWARFSection const*, llvm::DWARFSection const*, llvm::StringRef, llvm::DWARFSection const&, llvm::DWARFSection const*, llvm::DWARFSection const&, bool, bool, bool, llvm::DWARFSectionKind) llvm-project/llvm/lib/DebugInfo/DWARF/DWARFUnit.cpp:127:14
      #9 0x55fcfe1671cd in llvm::DWARFUnitVector::addUnitsForDWOSection(llvm::DWARFContext&, llvm::DWARFSection const&, llvm::DWARFSectionKind, bool) llvm-project/llvm/lib/DebugInfo/DWARF/DWARFUnit.cpp:58:3
      #10 0x55fcfe0dee91 in operator() llvm-project/llvm/include/llvm/ADT/STLFunctionalExtras.h:68:12
      #11 0x55fcfe0dee91 in (anonymous namespace)::DWARFObjInMemory::forEachInfoDWOSections(llvm::function_ref<void (llvm::DWARFSection const&)>) const llvm-project/llvm/lib/DebugInfo/DWARF/DWARFContext.cpp:1999:7
      #12 0x55fcfe0cabdf in llvm::DWARFContext::parseDWOUnits(bool) llvm-project/llvm/lib/DebugInfo/DWARF/DWARFContext.cpp:1106:9
      #13 0x55fcfe0bc1f5 in getNumDWOCompileUnits llvm-project/llvm/include/llvm/DebugInfo/DWARF/DWARFContext.h:229:5
      #14 0x55fcfe0bc1f5 in llvm::DWARFContext::dump(llvm::raw_ostream&, llvm::DIDumpOptions, std::__msan::array<std::__msan::optional<unsigned long>, 28ul>) llvm-project/llvm/lib/DebugInfo/DWARF/DWARFContext.cpp:398:24
      #15 0x55fcfcdc085a in dumpObjectFile(llvm::object::ObjectFile&, llvm::DWARFContext&, llvm::Twine const&, llvm::raw_ostream&) llvm-project/llvm/tools/llvm-dwarfdump/llvm-dwarfdump.cpp:631:9
      #16 0x55fcfcdc298d in operator() [...]/c++/v1/__functional/function.h:842:16
      #17 0x55fcfcdc298d in operator() [...]/c++/v1/__functional/function.h:1152:12
      #18 0x55fcfcdc298d in handleBuffer(llvm::StringRef, llvm::MemoryBufferRef, std::__msan::function<bool (llvm::object::ObjectFile&, llvm::DWARFContext&, llvm::Twine const&, llvm::raw_ostream&)>, llvm::raw_ostream&) llvm-project/llvm/tools/llvm-dwarfdump/llvm-dwarfdump.cpp:686:12
      #19 0x55fcfcdbc35d in handleFile(llvm::StringRef, std::__msan::function<bool (llvm::object::ObjectFile&, llvm::DWARFContext&, llvm::Twine const&, llvm::raw_ostream&)>, llvm::raw_ostream&) llvm-project/llvm/tools/llvm-dwarfdump/llvm-dwarfdump.cpp:724:10
      #20 0x55fcfcdbb99a in main llvm-project/llvm/tools/llvm-dwarfdump/llvm-dwarfdump.cpp:820:18
      #21 0x7faa82510632 in __libc_start_main
      #22 0x55fcfcd15169 in _start
  
  SUMMARY: MemorySanitizer: use-of-uninitialized-value llvm-project/llvm/lib/DebugInfo/DWARF/DWARFContext.cpp:870:7 in llvm::DWARFContext::getTUIndex()

Full list of affected tests, the immediate cause looks similar (use-of-uninitialized-value in `llvm::DWARFContext::getTUIndex()`):

  llvm/test/CodeGen/X86/dwarf-headers.ll
  llvm/test/CodeGen/X86/dwarf-split-line-1.ll
  llvm/test/CodeGen/X86/dwarf-split-line-2.ll
  llvm/test/DebugInfo/WebAssembly/dwarf-headers.ll
  llvm/test/DebugInfo/X86/dwarfdump-header.s
  llvm/test/DebugInfo/X86/dwarfdump-str-offsets-v4-dwarf64-dwo.s
  llvm/test/DebugInfo/X86/dwarfdump-str-offsets.s
  llvm/test/DebugInfo/X86/generate-odr-hash.ll
  llvm/test/DebugInfo/X86/gnu-public-names-tu.ll
  llvm/test/DebugInfo/X86/string-offsets-multiple-cus.ll
  llvm/test/DebugInfo/X86/tu-to-non-named-type.ll
  llvm/test/DebugInfo/X86/tu-to-non-tu.ll
  llvm/test/DebugInfo/X86/type_units_with_addresses.ll


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D137882



More information about the llvm-commits mailing list