[PATCH] D72695: [MachO] Add a test for detecting reserved unit length.

Mitch Phillips via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 20 22:43:20 PST 2020


hctim added a comment.

This test broke the UBSan buildbot here <http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-bootstrap-ubsan/builds/17094>. I've rolled it back for now, but to reproduce the issue should be as simple as adding `-DLLVM_USE_SANITIZER=Undefined` and running `ninja check-lld` or `make check-lld` depending on which tool you use :)

  [ RUN      ] ToAtomsTest.reservedUnitLength
  /b/sanitizer-x86_64-linux-bootstrap-ubsan/build/llvm-project/lld/lib/ReaderWriter/MachO/MachONormalizedFileToAtoms.cpp:972:35: runtime error: reference binding to null pointer of type 'const lld::mach_o::normalized::Section'
      #0 0x509684 in parseDebugInfo /b/sanitizer-x86_64-linux-bootstrap-ubsan/build/llvm-project/lld/lib/ReaderWriter/MachO/MachONormalizedFileToAtoms.cpp:971:22
      #1 0x509684 in lld::mach_o::normalized::normalizedObjectToAtoms(lld::mach_o::MachOFile*, lld::mach_o::normalized::NormalizedFile const&, bool) /b/sanitizer-x86_64-linux-bootstrap-ubsan/build/llvm-project/lld/lib/ReaderWriter/MachO/MachONormalizedFileToAtoms.cpp:1553:18
      #2 0x50a6f5 in objectToAtoms /b/sanitizer-x86_64-linux-bootstrap-ubsan/build/llvm-project/lld/lib/ReaderWriter/MachO/MachONormalizedFileToAtoms.cpp:1405:17
      #3 0x50a6f5 in lld::mach_o::normalized::normalizedToAtoms(lld::mach_o::normalized::NormalizedFile const&, llvm::StringRef, bool) /b/sanitizer-x86_64-linux-bootstrap-ubsan/build/llvm-project/lld/lib/ReaderWriter/MachO/MachONormalizedFileToAtoms.cpp:1626:12
      #4 0x45811f in ToAtomsTest_reservedUnitLength_Test::TestBody() /b/sanitizer-x86_64-linux-bootstrap-ubsan/build/llvm-project/lld/unittests/MachOTests/MachONormalizedFileToAtomsTests.cpp:126:31
      #5 0x4d250b in testing::Test::Run() /b/sanitizer-x86_64-linux-bootstrap-ubsan/build/llvm-project/llvm/utils/unittest/googletest/src/gtest.cc:2474:5
      #6 0x4d31fa in testing::TestInfo::Run() /b/sanitizer-x86_64-linux-bootstrap-ubsan/build/llvm-project/llvm/utils/unittest/googletest/src/gtest.cc:2656:11
      #7 0x4d3bc2 in testing::TestCase::Run() /b/sanitizer-x86_64-linux-bootstrap-ubsan/build/llvm-project/llvm/utils/unittest/googletest/src/gtest.cc:2774:28
      #8 0x4db1d2 in testing::internal::UnitTestImpl::RunAllTests() /b/sanitizer-x86_64-linux-bootstrap-ubsan/build/llvm-project/llvm/utils/unittest/googletest/src/gtest.cc:4649:43
      #9 0x4dac55 in testing::UnitTest::Run() /b/sanitizer-x86_64-linux-bootstrap-ubsan/build/llvm-project/llvm/utils/unittest/googletest/src/gtest.cc:4257:10
      #10 0x4cab63 in RUN_ALL_TESTS /b/sanitizer-x86_64-linux-bootstrap-ubsan/build/llvm-project/llvm/utils/unittest/googletest/include/gtest/gtest.h:2233:46
      #11 0x4cab63 in main /b/sanitizer-x86_64-linux-bootstrap-ubsan/build/llvm-project/llvm/utils/unittest/UnitTestMain/TestMain.cpp:50:10
      #12 0x7fbfa7f842e0 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x202e0)
      #13 0x40e909 in _start (/b/sanitizer-x86_64-linux-bootstrap-ubsan/build/llvm_build_ubsan/tools/lld/unittests/MachOTests/lldMachOTests+0x40e909)
  
  SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /b/sanitizer-x86_64-linux-bootstrap-ubsan/build/llvm-project/lld/lib/ReaderWriter/MachO/MachONormalizedFileToAtoms.cpp:972:35 in 


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D72695





More information about the llvm-commits mailing list