mold icon indicating copy to clipboard operation
mold copied to clipboard

Assertion failed: (got_idx != -1), function get_got_addr

Open erneestoc opened this issue 3 years ago • 3 comments

Getting Assertion failed: (got_idx != -1), function get_got_addr, file mold.h, line 1017.

"/usr/local/bin/ld64.mold" /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/13.1.6/lib/darwin/libclang_rt.profile_iossim.a -demangle -lto_library /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/libLTO.dylib -dynamic -arch arm64 -bundle -bundle_loader /Users/myuser/DerivedData/Projects/Build/Products/Debug-iphonesimulator/MockApp.app/MockApp -dead_strip -platform_version ios-simulator 14.0.0 15.5 -syslibroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.5.sdk -ObjC -o /Users/myuser/DerivedData/Projects/Build/Products/Debug-iphonesimulator/MockApp.app/PlugIns/SomeExampleTests.xctest/SomeExampleTests -L/Users/myuser/DerivedData/Projects/Build/Products/Debug-iphonesimulator -L/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/lib -L/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator -L/usr/lib/swift -filelist /Users/myuser/DerivedData/Projects/Build/Intermediates.noindex/Projects.build/Debug-iphonesimulator/SomeExampleTests.build/Objects-normal/arm64/SomeExampleTests.LinkFileList -rpath /usr/lib/swift -rpath @loader_path/Frameworks -rpath @executable_path/Frameworks -rpath @loader_path/Frameworks -object_path_lto /Users/myuser/DerivedData/Projects/Build/Intermediates.noindex/Projects.build/Debug-iphonesimulator/SomeExampleTests.build/Objects-normal/arm64/SomeExampleTests_lto.o -export_dynamic -no_deduplicate -objc_abi_version 2 -debug_variant -add_ast_path /Users/myuser/DerivedData/Projects/Build/Intermediates.noindex/Projects.build/Debug-iphonesimulator/SomeExampleTests.build/Objects-normal/arm64/SomeExampleTests.swiftmodule -framework XCTest -framework FBSnapshotTestCase -framework TestCommon -lAhoyTestSupport -lAPIConfigurationTestSupport -lAuthUtilitiesTestSupport -lKeychainTestSupport -lNetworkingTestSupport -lUtilitiesTestSupport -framework RxBlocking -no_adhoc_codesign -dependency_info /Users/myuser/DerivedData/Projects/Build/Intermediates.noindex/Projects.build/Debug-iphonesimulator/SomeExampleTests.build/Objects-normal/arm64/SomeExampleTests_dependency_info.dat -add_ast_path /Users/myuser/DerivedData/Projects/Build/Intermediates.noindex/Projects.build/Debug-iphonesimulator/AhoyTestSupport.build/Objects-normal/arm64/AhoyTestSupport.swiftmodule -add_ast_path /Users/myuser/DerivedData/Projects/Build/Intermediates.noindex/Projects.build/Debug-iphonesimulator/APIConfigurationTestSupport.build/Objects-normal/arm64/APIConfigurationTestSupport.swiftmodule -add_ast_path /Users/myuser/DerivedData/Projects/Build/Intermediates.noindex/Projects.build/Debug-iphonesimulator/AuthUtilitiesTestSupport.build/Objects-normal/arm64/AuthUtilitiesTestSupport.swiftmodule -add_ast_path /Users/myuser/DerivedData/Projects/Build/Intermediates.noindex/Projects.build/Debug-iphonesimulator/KeychainTestSupport.build/Objects-normal/arm64/KeychainTestSupport.swiftmodule -add_ast_path /Users/myuser/DerivedData/Projects/Build/Intermediates.noindex/Projects.build/Debug-iphonesimulator/NetworkingTestSupport.build/Objects-normal/arm64/NetworkingTestSupport.swiftmodule -add_ast_path /Users/myuser/DerivedData/Projects/Build/Intermediates.noindex/Projects.build/Debug-iphonesimulator/UtilitiesTestSupport.build/Objects-normal/arm64/UtilitiesTestSupport.swiftmodule -framework Foundation -lobjc -sectalign __DATA __llvm_prf_cnts 0x4000 -sectalign __DATA __llvm_prf_data 0x4000 -lSystem /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/13.1.6/lib/darwin/libclang_rt.iossim.a -F/Users/myuser/DerivedData/Projects/Build/Products/Debug-iphonesimulator/PackageFrameworks -F/Users/myuser/DerivedData/Projects/Build/Products/Debug-iphonesimulator/PackageFrameworks -F/Users/myuser/DerivedData/Projects/Build/Products/Debug-iphonesimulator/PackageFrameworks -F/Users/myuser/DerivedData/Projects/Build/Products/Debug-iphonesimulator/PackageFrameworks -F/Users/myuser/DerivedData/Projects/Build/Products/Debug-iphonesimulator/PackageFrameworks -F/Users/myuser/DerivedData/Projects/Build/Products/Debug-iphonesimulator/PackageFrameworks -F/Users/myuser/DerivedData/Projects/Build/Products/Debug-iphonesimulator/PackageFrameworks -F/Users/myuser/DerivedData/Projects/Build/Products/Debug-iphonesimulator/PackageFrameworks -F/Users/myuser/DerivedData/Projects/Build/Products/Debug-iphonesimulator -FCarthage/Build -F/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Library/Frameworks -F/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.5.sdk/Developer/Library/Frameworks

I can try to tackle this issue with some guidance.

erneestoc avatar Sep 30 '22 21:09 erneestoc

Suspecting this issue is a configuration error on my side. Would this error happen if I'm using different linkers on different targets and then try to link using mold?

erneestoc avatar Sep 30 '22 23:09 erneestoc

Wrong usage should be reported to the user with a proper error mesage, so an assertion failures are always a bug. I'll take a look at this. Thank you for reporting!

rui314 avatar Sep 30 '22 23:09 rui314

I'm working on an Xcode project with 150+ targets and multiple schemas to build different things. One for each of those 150 frameworks and their tests, and others for the main app and all of the tests. When I compile the framework and tests individually, it works flawlessly. It also works to compile and run the app, but when I try to compile tests for all of the targets, it randomly fails at different frameworks with the error above. 👆🏻

Do you have an idea of what it could be?

erneestoc avatar Oct 03 '22 07:10 erneestoc