[lld] [LLD, MachO] Default objc_relative_method_lists on MacOS11+/iOS14+ (PR #101360)

via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 7 20:03:22 PDT 2024


zeroomega wrote:

Hi, we are seeing a LLDB test failure after this change was landed and the stack trace from the failed test looks related to this patch:

```
Script:
--
/Volumes/Work/s/w/ir/x/w/lldb_install/python3/bin/python3 /Volumes/Work/s/w/ir/x/w/llvm-llvm-project/lldb/test/API/dotest.py -u CXXFLAGS -u CFLAGS --env OBJCOPY=/Volumes/Work/s/w/ir/x/w/llvm_build/./bin/llvm-objcopy --env LLVM_LIBS_DIR=/Volumes/Work/s/w/ir/x/w/llvm_build/./lib --env LLVM_INCLUDE_DIR=/Volumes/Work/s/w/ir/x/w/llvm_build/include --env LLVM_TOOLS_DIR=/Volumes/Work/s/w/ir/x/w/llvm_build/./bin --libcxx-include-dir /Volumes/Work/s/w/ir/x/w/llvm_build/include/c++/v1 --libcxx-library-dir /Volumes/Work/s/w/ir/x/w/llvm_build/lib --arch x86_64 --build-dir /Volumes/Work/s/w/ir/x/w/llvm_build/lldb-test-build.noindex --lldb-module-cache-dir /Volumes/Work/s/w/ir/x/w/llvm_build/lldb-test-build.noindex/module-cache-lldb/lldb-api --clang-module-cache-dir /Volumes/Work/s/w/ir/x/w/llvm_build/lldb-test-build.noindex/module-cache-clang/lldb-api --executable /Volumes/Work/s/w/ir/x/w/llvm_build/./bin/lldb --compiler /Volumes/Work/s/w/ir/x/w/llvm_build/./bin/clang --dsymutil /Volumes/Work/s/w/ir/x/w/llvm_build/./bin/dsymutil --llvm-tools-dir /Volumes/Work/s/w/ir/x/w/llvm_build/./bin --lldb-obj-root /Volumes/Work/s/w/ir/x/w/llvm_build/tools/lldb --lldb-libs-dir /Volumes/Work/s/w/ir/x/w/llvm_build/./lib --skip-category=pexpect /Volumes/Work/s/w/ir/x/w/llvm-llvm-project/lldb/test/API/commands/expression/call-throws -p TestCallThatThrows.py
--
Exit Code: 1

Command Output (stdout):
--
lldb version 20.0.0git (https://llvm.googlesource.com/a/llvm-project revision 6a3604ef8592edf39fedd6af8100aefafd6d931d)
  clang revision 6a3604ef8592edf39fedd6af8100aefafd6d931d
  llvm revision 6a3604ef8592edf39fedd6af8100aefafd6d931d
Skipping the following test categories: ['pexpect', 'libstdcxx', 'dwo', 'llgs', 'fork']

--
Command Output (stderr):
--
FAIL: LLDB (/Volumes/Work/s/w/ir/x/w/llvm_build/bin/clang-x86_64) :: test_dsym (TestCallThatThrows.ExprCommandWithThrowTestCase.test_dsym)
FAIL: LLDB (/Volumes/Work/s/w/ir/x/w/llvm_build/bin/clang-x86_64) :: test_dwarf (TestCallThatThrows.ExprCommandWithThrowTestCase.test_dwarf)
UNSUPPORTED: LLDB (/Volumes/Work/s/w/ir/x/w/llvm_build/bin/clang-x86_64) :: test_dwo (TestCallThatThrows.ExprCommandWithThrowTestCase.test_dwo) (test case does not fall in any category of interest for this run) 
======================================================================
ERROR: test_dsym (TestCallThatThrows.ExprCommandWithThrowTestCase.test_dsym)
   Test calling a function that throws and ObjC exception.
----------------------------------------------------------------------
Error when building test subject.

Build Command:
make VPATH=/Volumes/Work/s/w/ir/x/w/llvm-llvm-project/lldb/test/API/commands/expression/call-throws -C /Volumes/Work/s/w/ir/x/w/llvm_build/lldb-test-build.noindex/commands/expression/call-throws/TestCallThatThrows.test_dsym -I /Volumes/Work/s/w/ir/x/w/llvm-llvm-project/lldb/test/API/commands/expression/call-throws -I /Volumes/Work/s/w/ir/x/w/llvm-llvm-project/lldb/packages/Python/lldbsuite/test/make -f /Volumes/Work/s/w/ir/x/w/llvm-llvm-project/lldb/test/API/commands/expression/call-throws/Makefile MAKE_DSYM=YES all ARCH=x86_64 'CC="/Volumes/Work/s/w/ir/x/w/llvm_build/bin/clang"' DSYMUTIL=/Volumes/Work/s/w/ir/x/w/llvm_build/./bin/dsymutil 'CODESIGN=codesign --entitlements /Volumes/Work/s/w/ir/x/w/llvm-llvm-project/lldb/packages/Python/lldbsuite/test/make/entitlements-macos.plist' CLANG_MODULE_CACHE_DIR=/Volumes/Work/s/w/ir/x/w/llvm_build/lldb-test-build.noindex/module-cache-clang/lldb-api LIBCPP_INCLUDE_DIR=/Volumes/Work/s/w/ir/x/w/llvm_build/include/c++/v1 LIBCPP_LIBRARY_DIR=/Volumes/Work/s/w/ir/x/w/llvm_build/lib LLDB_OBJ_ROOT=/Volumes/Work/s/w/ir/x/w/llvm_build/tools/lldb OS=Darwin HOST_OS=Darwin

Build Command Output:
make: Entering directory '/Volumes/Work/s/w/ir/x/w/llvm_build/lldb-test-build.noindex/commands/expression/call-throws/TestCallThatThrows.test_dsym'
"/Volumes/Work/s/w/ir/x/w/llvm_build/bin/clang" -g -O0 -isysroot "/Volumes/Work/s/w/ir/cache/macos_sdk/XCode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.3.sdk" -arch x86_64  -I/Volumes/Work/s/w/ir/x/w/llvm-llvm-project/lldb/packages/Python/lldbsuite/test/make/../../../../..//include -I/Volumes/Work/s/w/ir/x/w/llvm_build/tools/lldb/include -I/Volumes/Work/s/w/ir/x/w/llvm-llvm-project/lldb/test/API/commands/expression/call-throws -I/Volumes/Work/s/w/ir/x/w/llvm-llvm-project/lldb/packages/Python/lldbsuite/test/make -include /Volumes/Work/s/w/ir/x/w/llvm-llvm-project/lldb/packages/Python/lldbsuite/test/make/test_common.h -fno-limit-debug-info   -MT call-throws.o -MD -MP -MF call-throws.d -c -o call-throws.o /Volumes/Work/s/w/ir/x/w/llvm-llvm-project/lldb/test/API/commands/expression/call-throws/call-throws.m
"/Volumes/Work/s/w/ir/x/w/llvm_build/bin/clang" call-throws.o -g -O0 -isysroot "/Volumes/Work/s/w/ir/cache/macos_sdk/XCode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.3.sdk" -arch x86_64  -I/Volumes/Work/s/w/ir/x/w/llvm-llvm-project/lldb/packages/Python/lldbsuite/test/make/../../../../..//include -I/Volumes/Work/s/w/ir/x/w/llvm_build/tools/lldb/include -I/Volumes/Work/s/w/ir/x/w/llvm-llvm-project/lldb/test/API/commands/expression/call-throws -I/Volumes/Work/s/w/ir/x/w/llvm-llvm-project/lldb/packages/Python/lldbsuite/test/make -include /Volumes/Work/s/w/ir/x/w/llvm-llvm-project/lldb/packages/Python/lldbsuite/test/make/test_common.h -fno-limit-debug-info   -framework Foundation  -L/Volumes/Work/s/w/ir/x/w/llvm_build/lib -Wl,-rpath,/Volumes/Work/s/w/ir/x/w/llvm_build/lib -lc++ -lobjc --driver-mode=g++ -o "a.out"
Assertion failed: (isa<T>(*this) && "Invalid accessor called"), function get, file PointerUnion.h, line 156.
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
Stack dump:
0.	Program arguments: /Volumes/Work/s/w/ir/x/w/llvm_build/bin/ld64.lld -demangle -no_deduplicate -dynamic -arch x86_64 -platform_version macos 13.0.0 13.3 -syslibroot /Volumes/Work/s/w/ir/cache/macos_sdk/XCode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.3.sdk -mllvm -enable-linkonceodr-outlining -o a.out -L/Volumes/Work/s/w/ir/x/w/llvm_build/lib call-throws.o -framework Foundation -rpath /Volumes/Work/s/w/ir/x/w/llvm_build/lib -lc++ -lobjc -lc++ -lSystem /Volumes/Work/s/w/ir/x/w/llvm_build/lib/clang/20/lib/darwin/libclang_rt.osx.a
 #0 0x0000000112246178 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/Volumes/Work/s/w/ir/x/w/llvm_build/bin/llvm+0x106152178)
 #1 0x0000000112243f39 llvm::sys::RunSignalHandlers() (/Volumes/Work/s/w/ir/x/w/llvm_build/bin/llvm+0x10614ff39)
 #2 0x0000000112246840 SignalHandler(int) (/Volumes/Work/s/w/ir/x/w/llvm_build/bin/llvm+0x106152840)
 #3 0x00007ff8158575ed (/usr/lib/system/libsystem_platform.dylib+0x7ff8004265ed)
 #4 0x0000000000000000 
 #5 0x00007ff815750b45 (/usr/lib/system/libsystem_c.dylib+0x7ff80031fb45)
 #6 0x00007ff81574fe5e (/usr/lib/system/libsystem_c.dylib+0x7ff80031ee5e)
 #7 0x000000010c8454b0 lld::macho::ObjCMethListSection::setUp() (/Volumes/Work/s/w/ir/x/w/llvm_build/bin/llvm+0x1007514b0)
 #8 0x000000010c864d0c void lld::macho::writeResult<lld::macho::LP64>() (/Volumes/Work/s/w/ir/x/w/llvm_build/bin/llvm+0x100770d0c)
 #9 0x000000010c7d7219 lld::macho::link(llvm::ArrayRef<char const*>, llvm::raw_ostream&, llvm::raw_ostream&, bool, bool) (/Volumes/Work/s/w/ir/x/w/llvm_build/bin/llvm+0x1006e3219)
#10 0x000000010c4f54e2 lld::unsafeLldMain(llvm::ArrayRef<char const*>, llvm::raw_ostream&, llvm::raw_ostream&, llvm::ArrayRef<lld::DriverDef>, bool) (/Volumes/Work/s/w/ir/x/w/llvm_build/bin/llvm+0x1004014e2)
#11 0x000000010c1a0e08 lld_main(int, char**, llvm::ToolContext const&) (/Volumes/Work/s/w/ir/x/w/llvm_build/bin/llvm+0x1000ace08)
#12 0x000000010c4f422f findTool(int, char**, char const*) (/Volumes/Work/s/w/ir/x/w/llvm_build/bin/llvm+0x10040022f)
#13 0x000000010c4f3a60 main (/Volumes/Work/s/w/ir/x/w/llvm_build/bin/llvm+0x1003ffa60)
#14 0x00007ff8154cf41f 
clang: error: unable to execute command: Abort trap: 6
clang: error: linker command failed due to signal (use -v to see invocation)
make: *** [Makefile.rules:571: a.out] Error 1
make: Leaving directory '/Volumes/Work/s/w/ir/x/w/llvm_build/lldb-test-build.noindex/commands/expression/call-throws/TestCallThatThrows.test_dsym'

Test Directory:
/Volumes/Work/s/w/ir/x/w/llvm-llvm-project/lldb/test/API/commands/expression/call-throws
======================================================================
ERROR: test_dwarf (TestCallThatThrows.ExprCommandWithThrowTestCase.test_dwarf)
   Test calling a function that throws and ObjC exception.
----------------------------------------------------------------------
Error when building test subject.

Build Command:
make VPATH=/Volumes/Work/s/w/ir/x/w/llvm-llvm-project/lldb/test/API/commands/expression/call-throws -C /Volumes/Work/s/w/ir/x/w/llvm_build/lldb-test-build.noindex/commands/expression/call-throws/TestCallThatThrows.test_dwarf -I /Volumes/Work/s/w/ir/x/w/llvm-llvm-project/lldb/test/API/commands/expression/call-throws -I /Volumes/Work/s/w/ir/x/w/llvm-llvm-project/lldb/packages/Python/lldbsuite/test/make -f /Volumes/Work/s/w/ir/x/w/llvm-llvm-project/lldb/test/API/commands/expression/call-throws/Makefile MAKE_DSYM=NO all ARCH=x86_64 'CC="/Volumes/Work/s/w/ir/x/w/llvm_build/bin/clang"' DSYMUTIL=/Volumes/Work/s/w/ir/x/w/llvm_build/./bin/dsymutil 'CODESIGN=codesign --entitlements /Volumes/Work/s/w/ir/x/w/llvm-llvm-project/lldb/packages/Python/lldbsuite/test/make/entitlements-macos.plist' CLANG_MODULE_CACHE_DIR=/Volumes/Work/s/w/ir/x/w/llvm_build/lldb-test-build.noindex/module-cache-clang/lldb-api LIBCPP_INCLUDE_DIR=/Volumes/Work/s/w/ir/x/w/llvm_build/include/c++/v1 LIBCPP_LIBRARY_DIR=/Volumes/Work/s/w/ir/x/w/llvm_build/lib LLDB_OBJ_ROOT=/Volumes/Work/s/w/ir/x/w/llvm_build/tools/lldb OS=Darwin HOST_OS=Darwin

Build Command Output:
make: Entering directory '/Volumes/Work/s/w/ir/x/w/llvm_build/lldb-test-build.noindex/commands/expression/call-throws/TestCallThatThrows.test_dwarf'
"/Volumes/Work/s/w/ir/x/w/llvm_build/bin/clang" -g -O0 -isysroot "/Volumes/Work/s/w/ir/cache/macos_sdk/XCode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.3.sdk" -arch x86_64  -I/Volumes/Work/s/w/ir/x/w/llvm-llvm-project/lldb/packages/Python/lldbsuite/test/make/../../../../..//include -I/Volumes/Work/s/w/ir/x/w/llvm_build/tools/lldb/include -I/Volumes/Work/s/w/ir/x/w/llvm-llvm-project/lldb/test/API/commands/expression/call-throws -I/Volumes/Work/s/w/ir/x/w/llvm-llvm-project/lldb/packages/Python/lldbsuite/test/make -include /Volumes/Work/s/w/ir/x/w/llvm-llvm-project/lldb/packages/Python/lldbsuite/test/make/test_common.h -fno-limit-debug-info   -MT call-throws.o -MD -MP -MF call-throws.d -c -o call-throws.o /Volumes/Work/s/w/ir/x/w/llvm-llvm-project/lldb/test/API/commands/expression/call-throws/call-throws.m
"/Volumes/Work/s/w/ir/x/w/llvm_build/bin/clang" call-throws.o -g -O0 -isysroot "/Volumes/Work/s/w/ir/cache/macos_sdk/XCode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.3.sdk" -arch x86_64  -I/Volumes/Work/s/w/ir/x/w/llvm-llvm-project/lldb/packages/Python/lldbsuite/test/make/../../../../..//include -I/Volumes/Work/s/w/ir/x/w/llvm_build/tools/lldb/include -I/Volumes/Work/s/w/ir/x/w/llvm-llvm-project/lldb/test/API/commands/expression/call-throws -I/Volumes/Work/s/w/ir/x/w/llvm-llvm-project/lldb/packages/Python/lldbsuite/test/make -include /Volumes/Work/s/w/ir/x/w/llvm-llvm-project/lldb/packages/Python/lldbsuite/test/make/test_common.h -fno-limit-debug-info   -framework Foundation  -L/Volumes/Work/s/w/ir/x/w/llvm_build/lib -Wl,-rpath,/Volumes/Work/s/w/ir/x/w/llvm_build/lib -lc++ -lobjc --driver-mode=g++ -o "a.out"
Assertion failed: (isa<T>(*this) && "Invalid accessor called"), function get, file PointerUnion.h, line 156.
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
Stack dump:
0.	Program arguments: /Volumes/Work/s/w/ir/x/w/llvm_build/bin/ld64.lld -demangle -no_deduplicate -dynamic -arch x86_64 -platform_version macos 13.0.0 13.3 -syslibroot /Volumes/Work/s/w/ir/cache/macos_sdk/XCode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.3.sdk -mllvm -enable-linkonceodr-outlining -o a.out -L/Volumes/Work/s/w/ir/x/w/llvm_build/lib call-throws.o -framework Foundation -rpath /Volumes/Work/s/w/ir/x/w/llvm_build/lib -lc++ -lobjc -lc++ -lSystem /Volumes/Work/s/w/ir/x/w/llvm_build/lib/clang/20/lib/darwin/libclang_rt.osx.a
 #0 0x0000000110b92178 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/Volumes/Work/s/w/ir/x/w/llvm_build/bin/llvm+0x106152178)
 #1 0x0000000110b8ff39 llvm::sys::RunSignalHandlers() (/Volumes/Work/s/w/ir/x/w/llvm_build/bin/llvm+0x10614ff39)
 #2 0x0000000110b92840 SignalHandler(int) (/Volumes/Work/s/w/ir/x/w/llvm_build/bin/llvm+0x106152840)
 #3 0x00007ff8158575ed (/usr/lib/system/libsystem_platform.dylib+0x7ff8004265ed)
 #4 0x0000000000000000 
 #5 0x00007ff815750b45 (/usr/lib/system/libsystem_c.dylib+0x7ff80031fb45)
 #6 0x00007ff81574fe5e (/usr/lib/system/libsystem_c.dylib+0x7ff80031ee5e)
 #7 0x000000010b1914b0 lld::macho::ObjCMethListSection::setUp() (/Volumes/Work/s/w/ir/x/w/llvm_build/bin/llvm+0x1007514b0)
 #8 0x000000010b1b0d0c void lld::macho::writeResult<lld::macho::LP64>() (/Volumes/Work/s/w/ir/x/w/llvm_build/bin/llvm+0x100770d0c)
 #9 0x000000010b123219 lld::macho::link(llvm::ArrayRef<char const*>, llvm::raw_ostream&, llvm::raw_ostream&, bool, bool) (/Volumes/Work/s/w/ir/x/w/llvm_build/bin/llvm+0x1006e3219)
#10 0x000000010ae414e2 lld::unsafeLldMain(llvm::ArrayRef<char const*>, llvm::raw_ostream&, llvm::raw_ostream&, llvm::ArrayRef<lld::DriverDef>, bool) (/Volumes/Work/s/w/ir/x/w/llvm_build/bin/llvm+0x1004014e2)
#11 0x000000010aaece08 lld_main(int, char**, llvm::ToolContext const&) (/Volumes/Work/s/w/ir/x/w/llvm_build/bin/llvm+0x1000ace08)
#12 0x000000010ae4022f findTool(int, char**, char const*) (/Volumes/Work/s/w/ir/x/w/llvm_build/bin/llvm+0x10040022f)
#13 0x000000010ae3fa60 main (/Volumes/Work/s/w/ir/x/w/llvm_build/bin/llvm+0x1003ffa60)
#14 0x00007ff8154cf41f 
clang: error: unable to execute command: Abort trap: 6
clang: error: linker command failed due to signal (use -v to see invocation)
make: *** [Makefile.rules:571: a.out] Error 1
make: Leaving directory '/Volumes/Work/s/w/ir/x/w/llvm_build/lldb-test-build.noindex/commands/expression/call-throws/TestCallThatThrows.test_dwarf'

Test Directory:
/Volumes/Work/s/w/ir/x/w/llvm-llvm-project/lldb/test/API/commands/expression/call-throws
----------------------------------------------------------------------
Ran 3 tests in 2.297s

FAILED (errors=2, skipped=1)

--
```

Build task link: https://ci.chromium.org/ui/p/fuchsia/builders/toolchain.ci/clang-mac-x64/b8740230069184308337/overview

We haven't yet finish a local revert and verification but looking at the blamelist, the change you landed is most likely. Could you take a look please?
And since it was a assertion error, if it is caused by this change, could you revert your change and fix it and reland it please?

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


More information about the llvm-commits mailing list