[lld] [llvm] [NFCI][LTO][lld] Optimize away symbol copies within LTO global resolution in ELF (PR #106193)

LLVM Continuous Integration via llvm-commits llvm-commits at lists.llvm.org
Sun Sep 8 15:47:27 PDT 2024


llvm-ci wrote:

LLVM Buildbot has detected a new failure on builder `sanitizer-x86_64-linux-fast` running on `sanitizer-buildbot4` while building `lld,llvm` at step 2 "annotate".

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

<details>
<summary>Here is the relevant piece of the build log for the reference</summary>

```
Step 2 (annotate) failure: 'python ../sanitizer_buildbot/sanitizers/zorg/buildbot/builders/sanitizers/buildbot_selector.py' (failure)
...
llvm-lit: /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:506: note: using lld-link: /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/bin/lld-link
llvm-lit: /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:506: note: using ld64.lld: /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/bin/ld64.lld
llvm-lit: /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:506: note: using wasm-ld: /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/bin/wasm-ld
llvm-lit: /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:506: note: using ld.lld: /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/bin/ld.lld
llvm-lit: /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:506: note: using lld-link: /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/bin/lld-link
llvm-lit: /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:506: note: using ld64.lld: /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/bin/ld64.lld
llvm-lit: /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:506: note: using wasm-ld: /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/bin/wasm-ld
llvm-lit: /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/utils/lit/lit/main.py:72: 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: 85621 of 85622 tests, 88 workers --
Testing:  0.. 10.. 20.. 30.. 40.. 50.. 60.. 70.. 80
FAIL: lld :: ELF/lto/asmundef.ll (27416 of 85621)
******************** TEST 'lld :: ELF/lto/asmundef.ll' FAILED ********************
Exit Code: 1

Command Output (stderr):
--
RUN: at line 2: /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/bin/llvm-as /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/lld/test/ELF/lto/asmundef.ll -o /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/tools/lld/test/ELF/lto/Output/asmundef.ll.tmp.o
+ /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/bin/llvm-as /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/lld/test/ELF/lto/asmundef.ll -o /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/tools/lld/test/ELF/lto/Output/asmundef.ll.tmp.o
RUN: at line 3: /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/bin/llvm-as /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/lld/test/ELF/lto/Inputs/asmundef.ll -o /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/tools/lld/test/ELF/lto/Output/asmundef.ll.tmp2.o
+ /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/bin/llvm-as /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/lld/test/ELF/lto/Inputs/asmundef.ll -o /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/tools/lld/test/ELF/lto/Output/asmundef.ll.tmp2.o
RUN: at line 4: /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/bin/ld.lld /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/tools/lld/test/ELF/lto/Output/asmundef.ll.tmp.o /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/tools/lld/test/ELF/lto/Output/asmundef.ll.tmp2.o -o /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/tools/lld/test/ELF/lto/Output/asmundef.ll.tmp -save-temps
+ /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/bin/ld.lld /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/tools/lld/test/ELF/lto/Output/asmundef.ll.tmp.o /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/tools/lld/test/ELF/lto/Output/asmundef.ll.tmp2.o -o /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/tools/lld/test/ELF/lto/Output/asmundef.ll.tmp -save-temps
=================================================================
==4148783==ERROR: AddressSanitizer: heap-use-after-free on address 0x50d000004834 at pc 0x583de4250ff6 bp 0x7ffebf773270 sp 0x7ffebf772a18
READ of size 8 at 0x50d000004834 thread T0
    #0 0x583de4250ff5 in MemcmpInterceptorCommon(void*, int (*)(void const*, void const*, unsigned long), void const*, void const*, unsigned long) /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/compiler-rt/lib/asan/../sanitizer_common/sanitizer_common_interceptors.inc:814:7
    #1 0x583de425143c in bcmp /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/compiler-rt/lib/asan/../sanitizer_common/sanitizer_common_interceptors.inc:859:10
    #2 0x583dea00e84f in operator== /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/include/llvm/ADT/StringRef.h:883:12
    #3 0x583dea00e84f in isEqual /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/include/llvm/ADT/StringRef.h:932:18
    #4 0x583dea00e84f in bool llvm::DenseMapBase<llvm::DenseMap<llvm::StringRef, llvm::lto::LTO::GlobalResolution, llvm::DenseMapInfo<llvm::StringRef, void>, llvm::detail::DenseMapPair<llvm::StringRef, llvm::lto::LTO::GlobalResolution>>, llvm::StringRef, llvm::lto::LTO::GlobalResolution, llvm::DenseMapInfo<llvm::StringRef, void>, llvm::detail::DenseMapPair<llvm::StringRef, llvm::lto::LTO::GlobalResolution>>::LookupBucketFor<llvm::StringRef>(llvm::StringRef const&, llvm::detail::DenseMapPair<llvm::StringRef, llvm::lto::LTO::GlobalResolution>*&) /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/include/llvm/ADT/DenseMap.h:704:11
    #5 0x583de9fec3c8 in llvm::DenseMapBase<llvm::DenseMap<llvm::StringRef, llvm::lto::LTO::GlobalResolution, llvm::DenseMapInfo<llvm::StringRef, void>, llvm::detail::DenseMapPair<llvm::StringRef, llvm::lto::LTO::GlobalResolution>>, llvm::StringRef, llvm::lto::LTO::GlobalResolution, llvm::DenseMapInfo<llvm::StringRef, void>, llvm::detail::DenseMapPair<llvm::StringRef, llvm::lto::LTO::GlobalResolution>>::operator[](llvm::StringRef const&) /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/include/llvm/ADT/DenseMap.h:368:9
    #6 0x583de9feba32 in llvm::lto::LTO::addModuleToGlobalRes(llvm::ArrayRef<llvm::lto::InputFile::Symbol>, llvm::ArrayRef<llvm::lto::SymbolResolution>, unsigned int, bool) /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/lib/LTO/LTO.cpp:624:23
    #7 0x583de9fee220 in llvm::lto::LTO::addModule(llvm::lto::InputFile&, unsigned int, llvm::lto::SymbolResolution const*&, llvm::lto::SymbolResolution const*) /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/lib/LTO/LTO.cpp:763:3
    #8 0x583de9fed72e in llvm::lto::LTO::add(std::__1::unique_ptr<llvm::lto::InputFile, std::__1::default_delete<llvm::lto::InputFile>>, llvm::ArrayRef<llvm::lto::SymbolResolution>) /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/lib/LTO/LTO.cpp:725:21
    #9 0x583de4b08176 in lld::elf::BitcodeCompiler::add(lld::elf::BitcodeFile&) /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/lld/ELF/LTO.cpp:277:22
    #10 0x583de489e273 in void lld::elf::LinkerDriver::compileBitcodeFiles<llvm::object::ELFType<(llvm::endianness)1, true>>(bool) /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/lld/ELF/Driver.cpp:2521:10
    #11 0x583de48333b8 in void lld::elf::LinkerDriver::link<llvm::object::ELFType<(llvm::endianness)1, true>>(llvm::opt::InputArgList&) /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/lld/ELF/Driver.cpp:2995:3
    #12 0x583de4802103 in lld::elf::LinkerDriver::linkerMain(llvm::ArrayRef<char const*>) /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/lld/ELF/Driver.cpp:697:5
    #13 0x583de47fd631 in lld::elf::link(llvm::ArrayRef<char const*>, llvm::raw_ostream&, llvm::raw_ostream&, bool, bool) /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/lld/ELF/Driver.cpp:175:19
    #14 0x583de44fbacf in lld::unsafeLldMain(llvm::ArrayRef<char const*>, llvm::raw_ostream&, llvm::raw_ostream&, llvm::ArrayRef<lld::DriverDef>, bool) /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/lld/Common/DriverDispatcher.cpp:164:12
    #15 0x583de44fd0cf in operator() /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/lld/Common/DriverDispatcher.cpp:189:15
    #16 0x583de44fd0cf in void llvm::function_ref<void ()>::callback_fn<lld::lldMain(llvm::ArrayRef<char const*>, llvm::raw_ostream&, llvm::raw_ostream&, llvm::ArrayRef<lld::DriverDef>)::$_0>(long) /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/include/llvm/ADT/STLFunctionalExtras.h:45:12
    #17 0x583de4362e11 in operator() /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/include/llvm/ADT/STLFunctionalExtras.h:68:12
    #18 0x583de4362e11 in llvm::CrashRecoveryContext::RunSafely(llvm::function_ref<void ()>) /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/lib/Support/CrashRecoveryContext.cpp:426:3
    #19 0x583de44fc753 in lld::lldMain(llvm::ArrayRef<char const*>, llvm::raw_ostream&, llvm::raw_ostream&, llvm::ArrayRef<lld::DriverDef>) /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/lld/Common/DriverDispatcher.cpp:188:14
    #20 0x583de430ef86 in lld_main(int, char**, llvm::ToolContext const&) /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/lld/tools/lld/lld.cpp:103:14
    #21 0x583de43105f5 in main /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/tools/lld/tools/lld/lld-driver.cpp:17:10
    #22 0x72638e62a1c9  (/lib/x86_64-linux-gnu/libc.so.6+0x2a1c9) (BuildId: 6d64b17fbac799e68da7ebd9985ddf9b5cb375e6)
    #23 0x72638e62a28a in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2a28a) (BuildId: 6d64b17fbac799e68da7ebd9985ddf9b5cb375e6)
Step 9 (stage2/asan_ubsan check) failure: stage2/asan_ubsan check (failure)
...
llvm-lit: /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:506: note: using lld-link: /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/bin/lld-link
llvm-lit: /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:506: note: using ld64.lld: /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/bin/ld64.lld
llvm-lit: /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:506: note: using wasm-ld: /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/bin/wasm-ld
llvm-lit: /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:506: note: using ld.lld: /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/bin/ld.lld
llvm-lit: /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:506: note: using lld-link: /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/bin/lld-link
llvm-lit: /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:506: note: using ld64.lld: /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/bin/ld64.lld
llvm-lit: /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:506: note: using wasm-ld: /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/bin/wasm-ld
llvm-lit: /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/utils/lit/lit/main.py:72: 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: 85621 of 85622 tests, 88 workers --
Testing:  0.. 10.. 20.. 30.. 40.. 50.. 60.. 70.. 80
FAIL: lld :: ELF/lto/asmundef.ll (27416 of 85621)
******************** TEST 'lld :: ELF/lto/asmundef.ll' FAILED ********************
Exit Code: 1

Command Output (stderr):
--
RUN: at line 2: /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/bin/llvm-as /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/lld/test/ELF/lto/asmundef.ll -o /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/tools/lld/test/ELF/lto/Output/asmundef.ll.tmp.o
+ /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/bin/llvm-as /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/lld/test/ELF/lto/asmundef.ll -o /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/tools/lld/test/ELF/lto/Output/asmundef.ll.tmp.o
RUN: at line 3: /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/bin/llvm-as /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/lld/test/ELF/lto/Inputs/asmundef.ll -o /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/tools/lld/test/ELF/lto/Output/asmundef.ll.tmp2.o
+ /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/bin/llvm-as /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/lld/test/ELF/lto/Inputs/asmundef.ll -o /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/tools/lld/test/ELF/lto/Output/asmundef.ll.tmp2.o
RUN: at line 4: /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/bin/ld.lld /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/tools/lld/test/ELF/lto/Output/asmundef.ll.tmp.o /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/tools/lld/test/ELF/lto/Output/asmundef.ll.tmp2.o -o /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/tools/lld/test/ELF/lto/Output/asmundef.ll.tmp -save-temps
+ /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/bin/ld.lld /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/tools/lld/test/ELF/lto/Output/asmundef.ll.tmp.o /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/tools/lld/test/ELF/lto/Output/asmundef.ll.tmp2.o -o /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/tools/lld/test/ELF/lto/Output/asmundef.ll.tmp -save-temps
=================================================================
==4148783==ERROR: AddressSanitizer: heap-use-after-free on address 0x50d000004834 at pc 0x583de4250ff6 bp 0x7ffebf773270 sp 0x7ffebf772a18
READ of size 8 at 0x50d000004834 thread T0
    #0 0x583de4250ff5 in MemcmpInterceptorCommon(void*, int (*)(void const*, void const*, unsigned long), void const*, void const*, unsigned long) /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/compiler-rt/lib/asan/../sanitizer_common/sanitizer_common_interceptors.inc:814:7
    #1 0x583de425143c in bcmp /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/compiler-rt/lib/asan/../sanitizer_common/sanitizer_common_interceptors.inc:859:10
    #2 0x583dea00e84f in operator== /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/include/llvm/ADT/StringRef.h:883:12
    #3 0x583dea00e84f in isEqual /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/include/llvm/ADT/StringRef.h:932:18
    #4 0x583dea00e84f in bool llvm::DenseMapBase<llvm::DenseMap<llvm::StringRef, llvm::lto::LTO::GlobalResolution, llvm::DenseMapInfo<llvm::StringRef, void>, llvm::detail::DenseMapPair<llvm::StringRef, llvm::lto::LTO::GlobalResolution>>, llvm::StringRef, llvm::lto::LTO::GlobalResolution, llvm::DenseMapInfo<llvm::StringRef, void>, llvm::detail::DenseMapPair<llvm::StringRef, llvm::lto::LTO::GlobalResolution>>::LookupBucketFor<llvm::StringRef>(llvm::StringRef const&, llvm::detail::DenseMapPair<llvm::StringRef, llvm::lto::LTO::GlobalResolution>*&) /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/include/llvm/ADT/DenseMap.h:704:11
    #5 0x583de9fec3c8 in llvm::DenseMapBase<llvm::DenseMap<llvm::StringRef, llvm::lto::LTO::GlobalResolution, llvm::DenseMapInfo<llvm::StringRef, void>, llvm::detail::DenseMapPair<llvm::StringRef, llvm::lto::LTO::GlobalResolution>>, llvm::StringRef, llvm::lto::LTO::GlobalResolution, llvm::DenseMapInfo<llvm::StringRef, void>, llvm::detail::DenseMapPair<llvm::StringRef, llvm::lto::LTO::GlobalResolution>>::operator[](llvm::StringRef const&) /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/include/llvm/ADT/DenseMap.h:368:9
    #6 0x583de9feba32 in llvm::lto::LTO::addModuleToGlobalRes(llvm::ArrayRef<llvm::lto::InputFile::Symbol>, llvm::ArrayRef<llvm::lto::SymbolResolution>, unsigned int, bool) /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/lib/LTO/LTO.cpp:624:23
    #7 0x583de9fee220 in llvm::lto::LTO::addModule(llvm::lto::InputFile&, unsigned int, llvm::lto::SymbolResolution const*&, llvm::lto::SymbolResolution const*) /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/lib/LTO/LTO.cpp:763:3
    #8 0x583de9fed72e in llvm::lto::LTO::add(std::__1::unique_ptr<llvm::lto::InputFile, std::__1::default_delete<llvm::lto::InputFile>>, llvm::ArrayRef<llvm::lto::SymbolResolution>) /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/lib/LTO/LTO.cpp:725:21
    #9 0x583de4b08176 in lld::elf::BitcodeCompiler::add(lld::elf::BitcodeFile&) /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/lld/ELF/LTO.cpp:277:22
    #10 0x583de489e273 in void lld::elf::LinkerDriver::compileBitcodeFiles<llvm::object::ELFType<(llvm::endianness)1, true>>(bool) /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/lld/ELF/Driver.cpp:2521:10
    #11 0x583de48333b8 in void lld::elf::LinkerDriver::link<llvm::object::ELFType<(llvm::endianness)1, true>>(llvm::opt::InputArgList&) /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/lld/ELF/Driver.cpp:2995:3
    #12 0x583de4802103 in lld::elf::LinkerDriver::linkerMain(llvm::ArrayRef<char const*>) /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/lld/ELF/Driver.cpp:697:5
    #13 0x583de47fd631 in lld::elf::link(llvm::ArrayRef<char const*>, llvm::raw_ostream&, llvm::raw_ostream&, bool, bool) /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/lld/ELF/Driver.cpp:175:19
    #14 0x583de44fbacf in lld::unsafeLldMain(llvm::ArrayRef<char const*>, llvm::raw_ostream&, llvm::raw_ostream&, llvm::ArrayRef<lld::DriverDef>, bool) /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/lld/Common/DriverDispatcher.cpp:164:12
    #15 0x583de44fd0cf in operator() /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/lld/Common/DriverDispatcher.cpp:189:15
    #16 0x583de44fd0cf in void llvm::function_ref<void ()>::callback_fn<lld::lldMain(llvm::ArrayRef<char const*>, llvm::raw_ostream&, llvm::raw_ostream&, llvm::ArrayRef<lld::DriverDef>)::$_0>(long) /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/include/llvm/ADT/STLFunctionalExtras.h:45:12
    #17 0x583de4362e11 in operator() /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/include/llvm/ADT/STLFunctionalExtras.h:68:12
    #18 0x583de4362e11 in llvm::CrashRecoveryContext::RunSafely(llvm::function_ref<void ()>) /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/lib/Support/CrashRecoveryContext.cpp:426:3
    #19 0x583de44fc753 in lld::lldMain(llvm::ArrayRef<char const*>, llvm::raw_ostream&, llvm::raw_ostream&, llvm::ArrayRef<lld::DriverDef>) /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/lld/Common/DriverDispatcher.cpp:188:14
    #20 0x583de430ef86 in lld_main(int, char**, llvm::ToolContext const&) /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/lld/tools/lld/lld.cpp:103:14
    #21 0x583de43105f5 in main /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/tools/lld/tools/lld/lld-driver.cpp:17:10
    #22 0x72638e62a1c9  (/lib/x86_64-linux-gnu/libc.so.6+0x2a1c9) (BuildId: 6d64b17fbac799e68da7ebd9985ddf9b5cb375e6)
    #23 0x72638e62a28a in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2a28a) (BuildId: 6d64b17fbac799e68da7ebd9985ddf9b5cb375e6)
Step 12 (stage2/msan check) failure: stage2/msan check (failure)
...
llvm-lit: /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:506: note: using lld-link: /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_msan/bin/lld-link
llvm-lit: /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:506: note: using ld64.lld: /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_msan/bin/ld64.lld
llvm-lit: /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:506: note: using wasm-ld: /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_msan/bin/wasm-ld
llvm-lit: /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:506: note: using ld.lld: /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_msan/bin/ld.lld
llvm-lit: /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:506: note: using lld-link: /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_msan/bin/lld-link
llvm-lit: /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:506: note: using ld64.lld: /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_msan/bin/ld64.lld
llvm-lit: /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:506: note: using wasm-ld: /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_msan/bin/wasm-ld
llvm-lit: /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/utils/lit/lit/main.py:72: 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: 85619 tests, 88 workers --
Testing:  0.. 10.. 20.. 30.. 40.. 50.. 60.. 70.. 80.. 90
FAIL: lld :: ELF/lto/asmundef.ll (36833 of 85619)
******************** TEST 'lld :: ELF/lto/asmundef.ll' FAILED ********************
Exit Code: 1

Command Output (stderr):
--
RUN: at line 2: /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_msan/bin/llvm-as /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/lld/test/ELF/lto/asmundef.ll -o /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_msan/tools/lld/test/ELF/lto/Output/asmundef.ll.tmp.o
+ /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_msan/bin/llvm-as /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/lld/test/ELF/lto/asmundef.ll -o /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_msan/tools/lld/test/ELF/lto/Output/asmundef.ll.tmp.o
RUN: at line 3: /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_msan/bin/llvm-as /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/lld/test/ELF/lto/Inputs/asmundef.ll -o /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_msan/tools/lld/test/ELF/lto/Output/asmundef.ll.tmp2.o
+ /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_msan/bin/llvm-as /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/lld/test/ELF/lto/Inputs/asmundef.ll -o /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_msan/tools/lld/test/ELF/lto/Output/asmundef.ll.tmp2.o
RUN: at line 4: /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_msan/bin/ld.lld /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_msan/tools/lld/test/ELF/lto/Output/asmundef.ll.tmp.o /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_msan/tools/lld/test/ELF/lto/Output/asmundef.ll.tmp2.o -o /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_msan/tools/lld/test/ELF/lto/Output/asmundef.ll.tmp -save-temps
+ /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_msan/bin/ld.lld /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_msan/tools/lld/test/ELF/lto/Output/asmundef.ll.tmp.o /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_msan/tools/lld/test/ELF/lto/Output/asmundef.ll.tmp2.o -o /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_msan/tools/lld/test/ELF/lto/Output/asmundef.ll.tmp -save-temps
Uninitialized bytes in MemcmpInterceptorCommon at offset 0 inside [0x709000000734, 8)
==2829652==WARNING: MemorySanitizer: use-of-uninitialized-value
    #0 0x555559da4e45 in bcmp /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/compiler-rt/lib/msan/../sanitizer_common/sanitizer_common_interceptors.inc:859:10
    #1 0x555559e0db1f in llvm::operator==(llvm::StringRef, llvm::StringRef) /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/include/llvm/ADT/StringRef.h:883:12
    #2 0x55555d02a045 in bool llvm::DenseMapBase<llvm::DenseMap<llvm::StringRef, llvm::lto::LTO::GlobalResolution, llvm::DenseMapInfo<llvm::StringRef, void>, llvm::detail::DenseMapPair<llvm::StringRef, llvm::lto::LTO::GlobalResolution>>, llvm::StringRef, llvm::lto::LTO::GlobalResolution, llvm::DenseMapInfo<llvm::StringRef, void>, llvm::detail::DenseMapPair<llvm::StringRef, llvm::lto::LTO::GlobalResolution>>::LookupBucketFor<llvm::StringRef>(llvm::StringRef const&, llvm::detail::DenseMapPair<llvm::StringRef, llvm::lto::LTO::GlobalResolution>*&) /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/include/llvm/ADT/DenseMap.h:704:11
    #3 0x55555d014bcc in llvm::DenseMapBase<llvm::DenseMap<llvm::StringRef, llvm::lto::LTO::GlobalResolution, llvm::DenseMapInfo<llvm::StringRef, void>, llvm::detail::DenseMapPair<llvm::StringRef, llvm::lto::LTO::GlobalResolution>>, llvm::StringRef, llvm::lto::LTO::GlobalResolution, llvm::DenseMapInfo<llvm::StringRef, void>, llvm::detail::DenseMapPair<llvm::StringRef, llvm::lto::LTO::GlobalResolution>>::operator[](llvm::StringRef const&) /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/include/llvm/ADT/DenseMap.h:368:9
    #4 0x55555d01466b in llvm::lto::LTO::addModuleToGlobalRes(llvm::ArrayRef<llvm::lto::InputFile::Symbol>, llvm::ArrayRef<llvm::lto::SymbolResolution>, unsigned int, bool) /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/lib/LTO/LTO.cpp:624:23
    #5 0x55555d015bc7 in llvm::lto::LTO::addModule(llvm::lto::InputFile&, unsigned int, llvm::lto::SymbolResolution const*&, llvm::lto::SymbolResolution const*) /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/lib/LTO/LTO.cpp:763:3
    #6 0x55555d015388 in llvm::lto::LTO::add(std::__1::unique_ptr<llvm::lto::InputFile, std::__1::default_delete<llvm::lto::InputFile>>, llvm::ArrayRef<llvm::lto::SymbolResolution>) /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/lib/LTO/LTO.cpp:725:21
    #7 0x55555a1fff54 in lld::elf::BitcodeCompiler::add(lld::elf::BitcodeFile&) /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/lld/ELF/LTO.cpp:277:22
    #8 0x55555a0cd8cd in void lld::elf::LinkerDriver::compileBitcodeFiles<llvm::object::ELFType<(llvm::endianness)1, true>>(bool) /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/lld/ELF/Driver.cpp:2521:10
    #9 0x55555a095da2 in void lld::elf::LinkerDriver::link<llvm::object::ELFType<(llvm::endianness)1, true>>(llvm::opt::InputArgList&) /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/lld/ELF/Driver.cpp:2995:3
    #10 0x55555a07de05 in lld::elf::LinkerDriver::linkerMain(llvm::ArrayRef<char const*>) /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/lld/ELF/Driver.cpp:697:5
    #11 0x55555a07aee2 in lld::elf::link(llvm::ArrayRef<char const*>, llvm::raw_ostream&, llvm::raw_ostream&, bool, bool) /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/lld/ELF/Driver.cpp:175:19
    #12 0x555559ef23e8 in lld::unsafeLldMain(llvm::ArrayRef<char const*>, llvm::raw_ostream&, llvm::raw_ostream&, llvm::ArrayRef<lld::DriverDef>, bool) /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/lld/Common/DriverDispatcher.cpp:164:12
    #13 0x555559ef2e7e in operator() /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/lld/Common/DriverDispatcher.cpp:189:15
    #14 0x555559ef2e7e in void llvm::function_ref<void ()>::callback_fn<lld::lldMain(llvm::ArrayRef<char const*>, llvm::raw_ostream&, llvm::raw_ostream&, llvm::ArrayRef<lld::DriverDef>)::$_0>(long) /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/include/llvm/ADT/STLFunctionalExtras.h:45:12
    #15 0x555559e26e0d in operator() /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/include/llvm/ADT/STLFunctionalExtras.h:68:12
    #16 0x555559e26e0d in llvm::CrashRecoveryContext::RunSafely(llvm::function_ref<void ()>) /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/lib/Support/CrashRecoveryContext.cpp:426:3
    #17 0x555559ef2688 in lld::lldMain(llvm::ArrayRef<char const*>, llvm::raw_ostream&, llvm::raw_ostream&, llvm::ArrayRef<lld::DriverDef>) /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/lld/Common/DriverDispatcher.cpp:188:14
    #18 0x555559dfdddd in lld_main(int, char**, llvm::ToolContext const&) /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/lld/tools/lld/lld.cpp:103:14
    #19 0x555559dfedf8 in main /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_msan/tools/lld/tools/lld/lld-driver.cpp:17:10
    #20 0x7ffff7a2a1c9  (/lib/x86_64-linux-gnu/libc.so.6+0x2a1c9) (BuildId: 6d64b17fbac799e68da7ebd9985ddf9b5cb375e6)
    #21 0x7ffff7a2a28a in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2a28a) (BuildId: 6d64b17fbac799e68da7ebd9985ddf9b5cb375e6)
    #22 0x555559d65864 in _start (/home/b/sanitizer-x86_64-linux-fast/build/llvm_build_msan/bin/lld+0x4811864)

SUMMARY: MemorySanitizer: use-of-uninitialized-value /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/include/llvm/ADT/StringRef.h:883:12 in llvm::operator==(llvm::StringRef, llvm::StringRef)

```

</details>

https://github.com/llvm/llvm-project/pull/106193


More information about the llvm-commits mailing list