[lld] [lld] check cache before real_path in loadDylib (PR #140791)
Prabhu Rajasekaran via llvm-commits
llvm-commits at lists.llvm.org
Tue Jun 10 10:04:34 PDT 2025
Prabhuk wrote:
Hi! I am part of a toolchain team at Google. We have been seeing failures in MAC builders since the introduction of this patch. Some of the failures are due to linker crashes. I've gone as far as to verify that the failures disappear when we don't have this patch in our downstream tree. The nature of the failures vary and quite inconsistent to get to a reproducer yet. But my team is working on it.
One such sample failure from our MAC ARM64 toolchain builder.
```
FAILED: bin/clang-tblgen
: && /Volumes/Work/s/w/ir/x/w/llvm_build/./bin/clang++ --sysroot=/Volumes/Work/s/w/ir/cache/macos_sdk/XCode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.3.sdk -stdlib=libc++ -fPIC -fvisibility-inlines-hidden -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -pedantic -Wno-long-long -Wc++98-compat-extra-semi -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wno-comment -Wstring-conversion -Wmisleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -ffile-prefix-map=/Volumes/Work/s/w/ir/x/w/llvm_build/tools/clang/stage2-bins=../../../../github-prabhuk-llvm-project -ffile-prefix-map=/Volumes/Work/s/w/ir/x/w/github-prabhuk-llvm-project/= -no-canonical-prefixes -fcrash-diagnostics=all -fcrash-diagnostics-dir=/Volumes/Work/s/w/ir/x/w/llvm_build/clang-crashreports -fno-common -Woverloaded-virtual -Wno-nested-anon-types -O3 -DNDEBUG -arch arm64 -isysroot /Volumes/Work/s/w/ir/cache/macos_sdk/XCode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.3.sdk -mmacosx-version-min=10.13 -Wl,-search_paths_first -Wl,-headerpad_max_install_names -nostdlib++ /Volumes/Work/s/w/ir/x/w/cipd/lib/libc++.a -stdlib=libc++ -static-libstdc++ -fuse-ld=lld -Wl,--color-diagnostics -fcrash-diagnostics=all -fcrash-diagnostics-dir=/Volumes/Work/s/w/ir/x/w/llvm_build/clang-crashreports -Wl,-lto_library -Wl,/Volumes/Work/s/w/ir/x/w/llvm_build/./lib/libLTO.dylib -Wl,-dead_strip tools/clang/lib/Support/CMakeFiles/obj.clangSupport.dir/RISCVVIntrinsicUtils.cpp.o tools/clang/utils/TableGen/CMakeFiles/clang-tblgen.dir/ASTTableGen.cpp.o tools/clang/utils/TableGen/CMakeFiles/clang-tblgen.dir/ClangASTNodesEmitter.cpp.o tools/clang/utils/TableGen/CMakeFiles/clang-tblgen.dir/ClangASTPropertiesEmitter.cpp.o tools/clang/utils/TableGen/CMakeFiles/clang-tblgen.dir/ClangAttrEmitter.cpp.o tools/clang/utils/TableGen/CMakeFiles/clang-tblgen.dir/ClangBuiltinsEmitter.cpp.o tools/clang/utils/TableGen/CMakeFiles/clang-tblgen.dir/ClangBuiltinTemplatesEmitter.cpp.o tools/clang/utils/TableGen/CMakeFiles/clang-tblgen.dir/ClangCommentCommandInfoEmitter.cpp.o tools/clang/utils/TableGen/CMakeFiles/clang-tblgen.dir/ClangCommentHTMLNamedCharacterReferenceEmitter.cpp.o tools/clang/utils/TableGen/CMakeFiles/clang-tblgen.dir/ClangCommentHTMLTagsEmitter.cpp.o tools/clang/utils/TableGen/CMakeFiles/clang-tblgen.dir/ClangDataCollectorsEmitter.cpp.o tools/clang/utils/TableGen/CMakeFiles/clang-tblgen.dir/ClangDiagnosticsEmitter.cpp.o tools/clang/utils/TableGen/CMakeFiles/clang-tblgen.dir/ClangOpcodesEmitter.cpp.o tools/clang/utils/TableGen/CMakeFiles/clang-tblgen.dir/ClangOpenCLBuiltinEmitter.cpp.o tools/clang/utils/TableGen/CMakeFiles/clang-tblgen.dir/ClangOptionDocEmitter.cpp.o tools/clang/utils/TableGen/CMakeFiles/clang-tblgen.dir/ClangSACheckersEmitter.cpp.o tools/clang/utils/TableGen/CMakeFiles/clang-tblgen.dir/ClangSyntaxEmitter.cpp.o tools/clang/utils/TableGen/CMakeFiles/clang-tblgen.dir/ClangTypeNodesEmitter.cpp.o tools/clang/utils/TableGen/CMakeFiles/clang-tblgen.dir/MveEmitter.cpp.o tools/clang/utils/TableGen/CMakeFiles/clang-tblgen.dir/NeonEmitter.cpp.o tools/clang/utils/TableGen/CMakeFiles/clang-tblgen.dir/RISCVVEmitter.cpp.o tools/clang/utils/TableGen/CMakeFiles/clang-tblgen.dir/SveEmitter.cpp.o tools/clang/utils/TableGen/CMakeFiles/clang-tblgen.dir/TableGen.cpp.o -o bin/clang-tblgen -Wl,-rpath, at loader_path/../lib lib/libLLVMSupport.a lib/libLLVMTableGen.a lib/libLLVMSupport.a -lm /Volumes/Work/s/w/ir/x/w/zlib_install_target/lib/libz.a /Volumes/Work/s/w/ir/x/w/zstd_install/lib/libzstd.a lib/libLLVMDemangle.a && :
clang++: warning: argument unused during compilation: '-stdlib=libc++' [-Wunused-command-line-argument]
clang++: warning: argument unused during compilation: '-stdlib=libc++' [-Wunused-command-line-argument]
clang++: warning: argument unused during compilation: '-static-libstdc++' [-Wunused-command-line-argument]
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
clang++: error: unable to execute command: Trace/BPT trap: 5
clang++: error: linker command failed due to signal (use -v to see invocation)
Fuchsia clang version 21.0.0git (https://github.com/prabhuk/llvm-project 822d05acc2dcecbe2c92d966c1d77fcd13ed680a)
Target: arm64-apple-darwin22.6.0
Thread model: posix
InstalledDir: /Volumes/Work/s/w/ir/x/w/llvm_build/./bin
Build config: +assertions
```
There was another bug reported in the past few days which may be related as well but I am not fully sure if the reporter's toolchain had this patch on their tree. https://github.com/llvm/llvm-project/issues/143332
But we noticed similar crashes in our builders when this patch was in tree. @rmaz I will try to get more information but it would help if you can think of reasons that this patch could cause problems.
https://github.com/llvm/llvm-project/pull/140791
More information about the llvm-commits
mailing list