我有一个奇怪的问题,可以通过我当前的项目进行一些概念汇编。
我们正在尝试测试的是,如果我们的项目在Xcode 10.2下(截至今天截至目前,我们知道我们也有BetaS 3和4)。我们知道这是Beta的东西,我们必须小心等等...
无论如何...我们要处理的奇怪情况是将领域用作吊舱(典型用法,OTOH)。版本是Realmswift 3.13.1
在Xcode 10.1(Swift 4 World)下,我们的整个项目编译。在Xcode 10.2(Betas 2和4,再次是Swift 4 World)下,我们的项目没有编译。实际上,它带有令人讨厌的"分段故障代码:11"错误。
我们试图在领域论坛中环顾四周,堆栈溢出等……取得了很大的成功。我们不确定Xcode 10.2对领域的支持,因此我们的问题:
- dy xcode 10.2编译领域,用于典型的" cmd r"运行命令部署到模拟器?
要使事情变得更复杂,CMD U(运行测试套件)和存档命令,请编译我们的整个项目,也就是说,编译领域时没有任何问题(在Xcode 10.2 Beta 2和4下)。因此,我们的疑问很奇怪,我们不确定我们是否在做错事,或者"运行" vs test/compile"是领域编译阶段的不同命令。
关于在哪里检查/测试的任何暗示?我们开始用完想法(除了领域的策略之外,还可以正式支持Xcode 10.2 beta 2、3和4,以防万一。
)。问候
编辑:我们一直在试图确定"领域编译分离故障:代码11"的确切原因。据我们所知,我们有这些情况:
1.-我们代码中使用的SWIFT版本与崩溃无关。无论我们使用Swift 4还是Swift 5,Xcode 10.2在编译某些领域时仍会崩溃。
2.-所有版本的Xcode 10.2崩溃(beta2,beta4和最终完整官员)。Xcode 10.1没有任何问题。
3.-我们试图将我们的"数据模块"隔离在一个空项目中(这是我们领域依赖性寿命的项目)。隔离该模块时,领域完美编译。
4.-当我们将"数据模块"集成到我们的"大项目"中时,当汇编领域时,出现segfault崩溃。
我们得到的典型的"崩溃转储"是(例如)这个(建议将其复制到您喜欢的文本编辑器中,前方丑陋的线条):
0. Program arguments: /Applications/Xcode_10.2.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift -frontend -c -primary-file /Users/MYUSERNAME/proyectos/MY_PROJECT_FOLDER_NAME/dev/MYMAINPROJECTNAME/Pods/RealmSwift/RealmSwift/Aliases.swift -primary-file /Users/MYUSERNAME/proyectos/MY_PROJECT_FOLDER_NAME/dev/MYMAINPROJECTNAME/Pods/RealmSwift/RealmSwift/Error.swift -primary-file /Users/MYUSERNAME/proyectos/MY_PROJECT_FOLDER_NAME/dev/MYMAINPROJECTNAME/Pods/RealmSwift/RealmSwift/LinkingObjects.swift -primary-file /Users/MYUSERNAME/proyectos/MY_PROJECT_FOLDER_NAME/dev/MYMAINPROJECTNAME/Pods/RealmSwift/RealmSwift/List.swift -primary-file /Users/MYUSERNAME/proyectos/MY_PROJECT_FOLDER_NAME/dev/MYMAINPROJECTNAME/Pods/RealmSwift/RealmSwift/Migration.swift /Users/MYUSERNAME/proyectos/MY_PROJECT_FOLDER_NAME/dev/MYMAINPROJECTNAME/Pods/RealmSwift/RealmSwift/Object.swift /Users/MYUSERNAME/proyectos/MY_PROJECT_FOLDER_NAME/dev/MYMAINPROJECTNAME/Pods/RealmSwift/RealmSwift/ObjectiveCSupport.swift /Users/MYUSERNAME/proyectos/MY_PROJECT_FOLDER_NAME/dev/MYMAINPROJECTNAME/Pods/RealmSwift/RealmSwift/ObjectSchema.swift /Users/MYUSERNAME/proyectos/MY_PROJECT_FOLDER_NAME/dev/MYMAINPROJECTNAME/Pods/RealmSwift/RealmSwift/Optional.swift /Users/MYUSERNAME/proyectos/MY_PROJECT_FOLDER_NAME/dev/MYMAINPROJECTNAME/Pods/RealmSwift/RealmSwift/Property.swift /Users/MYUSERNAME/proyectos/MY_PROJECT_FOLDER_NAME/dev/MYMAINPROJECTNAME/Pods/RealmSwift/RealmSwift/Realm.swift /Users/MYUSERNAME/proyectos/MY_PROJECT_FOLDER_NAME/dev/MYMAINPROJECTNAME/Pods/RealmSwift/RealmSwift/RealmCollection.swift /Users/MYUSERNAME/proyectos/MY_PROJECT_FOLDER_NAME/dev/MYMAINPROJECTNAME/Pods/RealmSwift/RealmSwift/RealmConfiguration.swift /Users/MYUSERNAME/proyectos/MY_PROJECT_FOLDER_NAME/dev/MYMAINPROJECTNAME/Pods/RealmSwift/RealmSwift/Results.swift /Users/MYUSERNAME/proyectos/MY_PROJECT_FOLDER_NAME/dev/MYMAINPROJECTNAME/Pods/RealmSwift/RealmSwift/Schema.swift /Users/MYUSERNAME/proyectos/MY_PROJECT_FOLDER_NAME/dev/MYMAINPROJECTNAME/Pods/RealmSwift/RealmSwift/SortDescriptor.swift /Users/MYUSERNAME/proyectos/MY_PROJECT_FOLDER_NAME/dev/MYMAINPROJECTNAME/Pods/RealmSwift/RealmSwift/SwiftVersion.swift /Users/MYUSERNAME/proyectos/MY_PROJECT_FOLDER_NAME/dev/MYMAINPROJECTNAME/Pods/RealmSwift/RealmSwift/Sync.swift /Users/MYUSERNAME/proyectos/MY_PROJECT_FOLDER_NAME/dev/MYMAINPROJECTNAME/Pods/RealmSwift/RealmSwift/ThreadSafeReference.swift /Users/MYUSERNAME/proyectos/MY_PROJECT_FOLDER_NAME/dev/MYMAINPROJECTNAME/Pods/RealmSwift/RealmSwift/Util.swift -supplementary-output-file-map /var/folders/zw/lb043_2n0ng097crfq3rzfc00000gr/T/supplementaryOutputs-137c0f -target x86_64-apple-ios8.0-simulator -enable-objc-interop -sdk /Applications/Xcode_10.2.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk -I /Users/MYUSERNAME/Library/Developer/Xcode/DerivedData/MYMAINPROJECTNAME-efvegromitzyfvcolcgynqojoooi/Build/Products/Debug-iphonesimulator/RealmSwift-iOS -F /Users/MYUSERNAME/Library/Developer/Xcode/DerivedData/MYMAINPROJECTNAME-efvegromitzyfvcolcgynqojoooi/Build/Products/Debug-iphonesimulator/RealmSwift-iOS -F /Users/MYUSERNAME/Library/Developer/Xcode/DerivedData/MYMAINPROJECTNAME-efvegromitzyfvcolcgynqojoooi/Build/Products/Debug-iphonesimulator/Realm-iOS -application-extension -enable-testing -g -import-underlying-module -module-cache-path /Users/MYUSERNAME/Library/Developer/Xcode/DerivedData/ModuleCache.noindex -profile-generate -profile-coverage-mapping -sanitize=thread -swift-version 4 -enforce-exclusivity=checked -Onone -D DEBUG -D COCOAPODS -serialize-debugging-options -Xcc -working-directory -Xcc /Users/MYUSERNAME/proyectos/MY_PROJECT_FOLDER_NAME/dev/MYMAINPROJECTNAME/Pods -enable-anonymous-context-mangled-names -Xcc -I/Users/MYUSERNAME/Library/Developer/Xcode/DerivedData/MYMAINPROJECTNAME-efvegromitzyfvcolcgynqojoooi/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/RealmSwift-iOS.build/swift-overrides.hmap -Xcc -iquote -Xcc /Users/MYUSERNAME/Library/Developer/Xcode/DerivedData/MYMAINPROJECTNAME-efvegromitzyfvcolcgynqojoooi/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/RealmSwift-iOS.build/RealmSwift-generated-files.hmap -Xcc -I/Users/MYUSERNAME/Library/Developer/Xcode/DerivedData/MYMAINPROJECTNAME-efvegromitzyfvcolcgynqojoooi/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/RealmSwift-iOS.build/RealmSwift-own-target-headers.hmap -Xcc -I/Users/MYUSERNAME/Library/Developer/Xcode/DerivedData/MYMAINPROJECTNAME-efvegromitzyfvcolcgynqojoooi/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/RealmSwift-iOS.build/RealmSwift-all-non-framework-target-headers.hmap -Xcc -ivfsoverlay -Xcc /Users/MYUSERNAME/Library/Developer/Xcode/DerivedData/MYMAINPROJECTNAME-efvegromitzyfvcolcgynqojoooi/Build/Intermediates.noindex/Pods.build/all-product-headers.yaml -Xcc -iquote -Xcc /Users/MYUSERNAME/Library/Developer/Xcode/DerivedData/MYMAINPROJECTNAME-efvegromitzyfvcolcgynqojoooi/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/RealmSwift-iOS.build/RealmSwift-project-headers.hmap -Xcc -I/Users/MYUSERNAME/Library/Developer/Xcode/DerivedData/MYMAINPROJECTNAME-efvegromitzyfvcolcgynqojoooi/Build/Products/Debug-iphonesimulator/RealmSwift-iOS/include -Xcc -I/Users/MYUSERNAME/proyectos/MY_PROJECT_FOLDER_NAME/dev/MYMAINPROJECTNAME/Pods/Headers/Private -Xcc -I/Users/MYUSERNAME/proyectos/MY_PROJECT_FOLDER_NAME/dev/MYMAINPROJECTNAME/Pods/Headers/Public -Xcc -I/Users/MYUSERNAME/proyectos/MY_PROJECT_FOLDER_NAME/dev/MYMAINPROJECTNAME/Pods/Headers/Public/HockeySDK -Xcc -I/Users/MYUSERNAME/Library/Developer/Xcode/DerivedData/MYMAINPROJECTNAME-efvegromitzyfvcolcgynqojoooi/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/RealmSwift-iOS.build/DerivedSources-normal/x86_64 -Xcc -I/Users/MYUSERNAME/Library/Developer/Xcode/DerivedData/MYMAINPROJECTNAME-efvegromitzyfvcolcgynqojoooi/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/RealmSwift-iOS.build/DerivedSources/x86_64 -Xcc -I/Users/MYUSERNAME/Library/Developer/Xcode/DerivedData/MYMAINPROJECTNAME-efvegromitzyfvcolcgynqojoooi/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/RealmSwift-iOS.build/DerivedSources -Xcc -DPOD_CONFIGURATION_DEBUG=1 -Xcc -DDEBUG=1 -Xcc -DCOCOAPODS=1 -Xcc -ivfsoverlay -Xcc /Users/MYUSERNAME/Library/Developer/Xcode/DerivedData/MYMAINPROJECTNAME-efvegromitzyfvcolcgynqojoooi/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/RealmSwift-iOS.build/unextended-module-overlay.yaml -module-name RealmSwift -o /Users/MYUSERNAME/Library/Developer/Xcode/DerivedData/MYMAINPROJECTNAME-efvegromitzyfvcolcgynqojoooi/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/RealmSwift-iOS.build/Objects-normal-tsan-ubsan/x86_64/Aliases.o -o /Users/MYUSERNAME/Library/Developer/Xcode/DerivedData/MYMAINPROJECTNAME-efvegromitzyfvcolcgynqojoooi/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/RealmSwift-iOS.build/Objects-normal-tsan-ubsan/x86_64/Error.o -o /Users/MYUSERNAME/Library/Developer/Xcode/DerivedData/MYMAINPROJECTNAME-efvegromitzyfvcolcgynqojoooi/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/RealmSwift-iOS.build/Objects-normal-tsan-ubsan/x86_64/LinkingObjects.o -o /Users/MYUSERNAME/Library/Developer/Xcode/DerivedData/MYMAINPROJECTNAME-efvegromitzyfvcolcgynqojoooi/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/RealmSwift-iOS.build/Objects-normal-tsan-ubsan/x86_64/List.o -o /Users/MYUSERNAME/Library/Developer/Xcode/DerivedData/MYMAINPROJECTNAME-efvegromitzyfvcolcgynqojoooi/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/RealmSwift-iOS.build/Objects-normal-tsan-ubsan/x86_64/Migration.o -index-store-path /Users/MYUSERNAME/Library/Developer/Xcode/DerivedData/MYMAINPROJECTNAME-efvegromitzyfvcolcgynqojoooi/Index/DataStore -index-system-modules
1. Running pass 'CallGraph Pass Manager' on module '/Users/MYUSERNAME/Library/Developer/Xcode/DerivedData/MYMAINPROJECTNAME-efvegromitzyfvcolcgynqojoooi/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/RealmSwift-iOS.build/Objects-normal-tsan-ubsan/x86_64/LinkingObjects.o'.
2. Running pass 'Dominator Tree Construction' on function '@"$s10RealmSwift14LinkingObjectsCyxSicir.resume.0"'
0 swift 0x00000001073b8ee3 PrintStackTraceSignalHandler(void*) + 51
1 swift 0x00000001073b86bc SignalHandler(int) + 348
2 libsystem_platform.dylib 0x00007fff6acdeb3d _sigtramp + 29
3 libsystem_malloc.dylib 0x00007fff6aca6a61 small_malloc_from_free_list + 166
4 swift 0x0000000107291991 llvm::DomTreeBuilder::SemiNCAInfo<llvm::DominatorTreeBase<llvm::BasicBlock, false> >::CalculateFromScratch(llvm::DominatorTreeBase<llvm::BasicBlock, false>&, llvm::DomTreeBuilder::SemiNCAInfo<llvm::DominatorTreeBase<llvm::BasicBlock, false> >::BatchUpdateInfo*) + 1025
5 swift 0x0000000107291583 llvm::DominatorTreeWrapperPass::runOnFunction(llvm::Function&) + 19
6 swift 0x00000001072d45ad llvm::FPPassManager::runOnFunction(llvm::Function&) + 1613
7 swift 0x0000000105eb0e27 (anonymous namespace)::CGPassManager::runOnModule(llvm::Module&) + 2311
8 swift 0x00000001072e0a00 llvm::legacy::PassManager::run(llvm::Module&) + 1696
9 swift 0x00000001033f6518 swift::performLLVM(swift::IRGenOptions&, swift::DiagnosticEngine*, llvm::sys::SmartMutex<false>*, llvm::GlobalVariable*, llvm::Module*, llvm::TargetMachine*, swift::version::Version const&, llvm::StringRef, swift::UnifiedStatsReporter*) + 5816
10 swift 0x000000010321d91e performCompile(swift::CompilerInstance&, swift::CompilerInvocation&, llvm::ArrayRef<char const*>, int&, swift::FrontendObserver*, swift::UnifiedStatsReporter*) + 51566
11 swift 0x000000010320d6de swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) + 6862
12 swift 0x00000001031ab7be main + 1246
13 libdyld.dylib 0x00007fff6aaf3ed9 start + 1
我发现了为什么在"大"项目中编译领域导致Swift编译器崩溃。显然,罪魁祸首是当前模式的运行部分中的"线程消毒器"选项。
看来,新的Swift编译器版本在某些文件中有一个问题,正如我们的团队忽略的某些"已知问题"中指出的那样(对我们感到羞耻(?)!
。*Known Issues The Swift compiler may crash during a build when the Thread Sanitizer is enabled. (48719789) Workaround: Disable Thread Sanitizer in the Scheme Editor’s Diagnostics tab.
只是禁用"线程消毒"选项使Swift感到高兴,并且不再崩溃了。
现在让我们希望苹果尽快解决此问题。问候。