将Xcode从8.2.1升级到8.3后,每次创建RMActionController实例时,RMAction库都会发生错误。
例如:
func showRedeem() {
let actionController = RMActionController(style: .white)!
actionController.title = "TITLE"
let confirmAction = RMAction(title: "Confirm", style: .cancel) // #1
actionController.addAction(confirmAction!) // #2
self.present(actionController, animated: true, completion: nil)
}
当我评论#1和#2时,编译成功!
和编译日志:
0 swift 0x000000010b081eb7 PrintStackTraceSignalHandler(void*) + 39
1 swift 0x000000010b081366 SignalHandler(int) + 646
2 libsystem_platform.dylib 0x00007fffd1021b3a _sigtramp + 26
3 libsystem_platform.dylib 0x00007ffd6147c3f0 _sigtramp + 2420484304
4 swift 0x0000000108ef2848 swift::GenericSignature::getSubstitutionMap(llvm::ArrayRef<swift::Substitution>, swift::SubstitutionMap&) const + 88
5 swift 0x0000000108728228 swift::Lowering::SILGenFunction::buildThunkType(swift::Lowering::ManagedValue, swift::CanTypeWrapper<swift::SILFunctionType>, swift::CanTypeWrapper<swift::SILFunctionType>&, swift::GenericEnvironment*&, swift::SubstitutionMap&, swift::SubstitutionMap&) + 1064
6 swift 0x000000010872b901 createThunk(swift::Lowering::SILGenFunction&, swift::SILLocation, swift::Lowering::ManagedValue, swift::Lowering::AbstractionPattern, swift::CanTypeWrapper<swift::AnyFunctionType>, swift::Lowering::AbstractionPattern, swift::CanTypeWrapper<swift::AnyFunctionType>, swift::Lowering::TypeLowering const&) + 289
7 swift 0x0000000108729531 (anonymous namespace)::Transform::transform(swift::Lowering::ManagedValue, swift::Lowering::AbstractionPattern, swift::CanType, swift::Lowering::AbstractionPattern, swift::CanType, swift::Lowering::SGFContext) + 1617
8 swift 0x000000010872b7c3 swift::Lowering::ManagedValue llvm::function_ref<swift::Lowering::ManagedValue (swift::Lowering::SILGenFunction&, swift::SILLocation, swift::Lowering::ManagedValue, swift::SILType)>::callback_fn<(anonymous namespace)::Transform::transform(swift::Lowering::ManagedValue, swift::Lowering::AbstractionPattern, swift::CanType, swift::Lowering::AbstractionPattern, swift::CanType, swift::Lowering::SGFContext)::$_5>(long, swift::Lowering::SILGenFunction&, swift::SILLocation, swift::Lowering::ManagedValue, swift::SILType) + 163
9 swift 0x00000001086c94d1 swift::Lowering::SILGenFunction::emitOptionalToOptional(swift::SILLocation, swift::Lowering::ManagedValue, swift::SILType, llvm::function_ref<swift::Lowering::ManagedValue (swift::Lowering::SILGenFunction&, swift::SILLocation, swift::Lowering::ManagedValue, swift::SILType)>) + 1217
10 swift 0x00000001087296f6 (anonymous namespace)::Transform::transform(swift::Lowering::ManagedValue, swift::Lowering::AbstractionPattern, swift::CanType, swift::Lowering::AbstractionPattern, swift::CanType, swift::Lowering::SGFContext) + 2070
11 swift 0x0000000108728ecb swift::Lowering::SILGenFunction::emitOrigToSubstValue(swift::SILLocation, swift::Lowering::ManagedValue, swift::Lowering::AbstractionPattern, swift::CanType, swift::Lowering::SGFContext) + 155
12 swift 0x0000000108692f01 (anonymous namespace)::ScalarResultPlan::finish(swift::Lowering::SILGenFunction&, swift::SILLocation, swift::CanType, llvm::ArrayRef<swift::Lowering::ManagedValue>&) + 641
13 swift 0x0000000108692250 swift::Lowering::SILGenFunction::emitApply(swift::SILLocation, swift::Lowering::ManagedValue, llvm::ArrayRef<swift::Substitution>, llvm::ArrayRef<swift::Lowering::ManagedValue>, swift::CanTypeWrapper<swift::SILFunctionType>, swift::Lowering::AbstractionPattern, swift::CanType, swift::Lowering::ApplyOptions, llvm::Optional<swift::SILFunctionTypeRepresentation>, llvm::Optional<swift::ForeignErrorConvention> const&, swift::Lowering::SGFContext) + 8736
14 swift 0x0000000108697eb1 (anonymous namespace)::CallEmission::apply(swift::Lowering::SGFContext) + 8449
15 swift 0x00000001086e32ec swift::ASTVisitor<(anonymous namespace)::RValueEmitter, swift::Lowering::RValue, void, void, void, void, void, swift::Lowering::SGFContext>::visit(swift::Expr*, swift::Lowering::SGFContext) + 124
16 swift 0x000000010869afea (anonymous namespace)::ArgEmitter::emit(swift::Lowering::ArgumentSource&&, swift::Lowering::AbstractionPattern) + 1322
17 swift 0x000000010869fc64 (anonymous namespace)::ArgEmitter::emitShuffle(swift::Expr*, swift::Expr*, llvm::ArrayRef<swift::TupleTypeElt>, swift::ConcreteDeclRef, llvm::ArrayRef<swift::Expr*>, llvm::ArrayRef<int>, llvm::ArrayRef<unsigned int>, swift::Type, swift::Lowering::AbstractionPattern) + 5380
18 swift 0x000000010869d676 (anonymous namespace)::ArgEmitter::emitExpanded(swift::Lowering::ArgumentSource&&, swift::Lowering::AbstractionPattern) + 1958
19 swift 0x000000010869abde (anonymous namespace)::ArgEmitter::emit(swift::Lowering::ArgumentSource&&, swift::Lowering::AbstractionPattern) + 286
20 swift 0x000000010869a246 (anonymous namespace)::CallSite::emit(swift::Lowering::SILGenFunction&, swift::Lowering::AbstractionPattern, (anonymous namespace)::ParamLowering&, llvm::SmallVectorImpl<swift::Lowering::ManagedValue>&, llvm::SmallVectorImpl<std::__1::pair<swift::Lowering::LValue, swift::SILLocation> >&, llvm::Optional<swift::ForeignErrorConvention> const&, swift::ImportAsMemberStatus const&) && + 438
21 swift 0x000000010869759b (anonymous namespace)::CallEmission::apply(swift::Lowering::SGFContext) + 6123
22 swift 0x00000001086e32ec swift::ASTVisitor<(anonymous namespace)::RValueEmitter, swift::Lowering::RValue, void, void, void, void, void, swift::Lowering::SGFContext>::visit(swift::Expr*, swift::Lowering::SGFContext) + 124
23 swift 0x00000001086e310c swift::Lowering::SILGenFunction::emitExprInto(swift::Expr*, swift::Lowering::Initialization*) + 188
24 swift 0x00000001086d0b56 swift::Lowering::SILGenFunction::emitPatternBinding(swift::PatternBindingDecl*, unsigned int) + 198
25 swift 0x0000000108740388 swift::ASTVisitor<(anonymous namespace)::StmtEmitter, void, void, void, void, void, void>::visit(swift::Stmt*) + 14712
26 swift 0x00000001086ff979 swift::Lowering::SILGenFunction::emitFunction(swift::FuncDecl*) + 409
27 swift 0x0000000108680d2b swift::Lowering::SILGenModule::emitFunction(swift::FuncDecl*)::$_1::operator()(swift::SILFunction*) const + 1867
28 swift 0x000000010867f902 swift::Lowering::SILGenModule::emitFunction(swift::FuncDecl*) + 642
29 swift 0x000000010874539b (anonymous namespace)::SILGenType::emitType() + 971
30 swift 0x0000000108744f6d swift::Lowering::SILGenModule::visitNominalTypeDecl(swift::NominalTypeDecl*) + 29
31 swift 0x000000010868d33b swift::Lowering::SILGenModule::emitSourceFile(swift::SourceFile*, unsigned int) + 1483
32 swift 0x000000010868ef19 swift::SILModule::constructSIL(swift::ModuleDecl*, swift::SILOptions&, swift::FileUnit*, llvm::Optional<unsigned int>, bool, bool) + 1593
33 swift 0x0000000107ea10b2 swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) + 42402
34 swift 0x0000000107e5088c main + 9052
35 libdyld.dylib 0x00007fffd0e12235 start + 1
36 libdyld.dylib 0x00000000000000d4 start + 790552224
Stack dump:
0. Program arguments: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift -frontend -c -filelist /var/folders/yv/m9thf9fs3qg012jlp4sw3zd00000gn/T/sources-bbebe3 -primary-file /Path/ios/x/x/Code/ViewController/StrategyGroupViewController.swift -target x86_64-apple-ios9.0 -enable-objc-interop -sdk /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator10.3.sdk -I /Users/tericky/Library/Developer/Xcode/DerivedData/x-fqcvlvimnhlizjcywfllclinonjz/Build/Products/Debug-iphonesimulator -F /Users/tericky/Library/Developer/Xcode/DerivedData/x-fqcvlvimnhlizjcywfllclinonjz/Build/Products/Debug-iphonesimulator -F /Users/tericky/Library/Developer/Xcode/DerivedData/x-fqcvlvimnhlizjcywfllclinonjz/Build/Products/Debug-iphonesimulator/ACTabScrollView -F /Users/tericky/Library/Developer/Xcode/DerivedData/x-fqcvlvimnhlizjcywfllclinonjz/Build/Products/Debug-iphonesimulator/AMScrollingNavbar -F /Users/tericky/Library/Developer/Xcode/DerivedData/x-fqcvlvimnhlizjcywfllclinonjz/Build/Products/Debug-iphonesimulator/ARChromeActivity -F /Users/tericky/Library/Developer/Xcode/DerivedData/x-fqcvlvimnhlizjcywfllclinonjz/Build/Products/Debug-iphonesimulator/Alamofire -F /Users/tericky/Library/Developer/Xcode/DerivedData/x-fqcvlvimnhlizjcywfllclinonjz/Build/Products/Debug-iphonesimulator/AsyncSwift -F /Users/tericky/Library/Developer/Xcode/DerivedData/x-fqcvlvimnhlizjcywfllclinonjz/Build/Products/Debug-iphonesimulator/Bolts -F /Users/tericky/Library/Developer/Xcode/DerivedData/x-fqcvlvimnhlizjcywfllclinonjz/Build/Products/Debug-iphonesimulator/Cheetah -F /Users/tericky/Library/Developer/Xcode/DerivedData/x-fqcvlvimnhlizjcywfllclinonjz/Build/Products/Debug-iphonesimulator/EZSwipeController -F /Users/tericky/Library/Developer/Xcode/DerivedData/x-fqcvlvimnhlizjcywfllclinonjz/Build/Products/Debug-iphonesimulator/FBSDKCoreKit -F /Users/tericky/Library/Developer/Xcode/DerivedData/x-fqcvlvimnhlizjcywfllclinonjz/Build/Products/Debug-iphonesimulator/FBSDKLoginKit -F /Users/tericky/Library/Developer/Xcode/DerivedData/x-fqcvlvimnhlizjcywfllclinonjz/Build/Products/Debug-iphonesimulator/FBSDKShareKit -F /Users/tericky/Library/Developer/Xcode/DerivedData/x-fqcvlvimnhlizjcywfllclinonjz/Build/Products/Debug-iphonesimulator/FSCalendar -F /Users/tericky/Library/Developer/Xcode/DerivedData/x-fqcvlvimnhlizjcywfllclinonjz/Build/Products/Debug-iphonesimulator/GTMOAuth2 -F /Users/tericky/Library/Developer/Xcode/DerivedData/x-fqcvlvimnhlizjcywfllclinonjz/Build/Products/Debug-iphonesimulator/GTMSessionFetcher -F /Users/tericky/Library/Developer/Xcode/DerivedData/x-fqcvlvimnhlizjcywfllclinonjz/Build/Products/Debug-iphonesimulator/GoogleToolboxForMac -F /Users/tericky/Library/Developer/Xcode/DerivedData/x-fqcvlvimnhlizjcywfllclinonjz/Build/Products/Debug-iphonesimulator/IQKeyboardManagerSwift -F /Users/tericky/Library/Developer/Xcode/DerivedData/x-fqcvlvimnhlizjcywfllclinonjz/Build/Products/Debug-iphonesimulator/JGProgressHUD -F /Users/tericky/Library/Developer/Xcode/DerivedData/x-fqcvlvimnhlizjcywfllclinonjz/Build/Products/Debug-iphonesimulator/KCFloatingActionButton -F /Users/tericky/Library/Developer/Xcode/DerivedData/x-fqcvlvimnhlizjcywfllclinonjz/Build/Products/Debug-iphonesimulator/KINWebBrowser -F /Users/tericky/Library/Developer/Xcode/DerivedData/x-fqcvlvimnhlizjcywfllclinonjz/Build/Products/Debug-iphonesimulator/LicensesViewController -F /Users/tericky/Library/Developer/Xcode/DerivedData/x-fqcvlvimnhlizjcywfllclinonjz/Build/Products/Debug-iphonesimulator/Localize-Swift -F /Users/tericky/Library/Developer/Xcode/DerivedData/x-fqcvlvimnhlizjcywfllclinonjz/Build/Products/Debug-iphonesimulator/M13ProgressSuite -F /Users/tericky/Library/Developer/Xcode/DerivedData/x-fqcvlvimnhlizjcywfllclinonjz/Build/Products/Debug-iphonesimulator/MarqueeLabel -F /Users/tericky/Library/Developer/Xcode/DerivedData/x-fqcvlvimnhlizjcywfllclinonjz/Build/Products/Debug-iphonesimulator/PromiseKit -F /Users/tericky/Library/Developer/Xcode/DerivedData/x-fqcvlvimnhlizjcywfllclinonjz/Build/Products/Debug-iphonesimulator/RMActionController -F /Users/tericky/Library/Developer/Xcode/DerivedData/x-fqcvlvimnhlizjcywfllclinonjz/Build/Products/Debug-iphonesimulator/RMDateSelectionViewController -F /Users/tericky/Library/Developer/Xcode/DerivedData/x-fqcvlvimnhlizjcywfllclinonjz/Build/Products/Debug-iphonesimulator/RMPickerViewController -F /Users/tericky/Library/Developer/Xcode/DerivedData/x-fqcvlvimnhlizjcywfllclinonjz/Build/Products/Debug-iphonesimulator/Realm -F /Users/tericky/Library/Developer/Xcode/DerivedData/x-fqcvlvimnhlizjcywfllclinonjz/Build/Products/Debug-iphonesimulator/RealmSwift -F /Users/tericky/Library/Developer/Xcode/DerivedData/x-fqcvlvimnhlizjcywfllclinonjz/Build/Products/Debug-iphonesimulator/SDWebImage -F /Users/tericky/Library/Developer/Xcode/DerivedData/x-fqcvlvimnhlizjcywfllclinonjz/Build/Products/Debug-iphonesimulator/ScrollableGraphView -F /Users/tericky/Library/Developer/Xcode/DerivedData/x-fqcvlvimnhlizjcywfllclinonjz/Build/Products/Debug-iphonesimulator/SideMenu -F /Users/tericky/Library/Developer/Xcode/DerivedData/x-fqcvlvimnhlizjcywfllclinonjz/Build/Products/Debug-iphonesimulator/SnapKit -F /Users/tericky/Library/Developer/Xcode/DerivedData/x-fqcvlvimnhlizjcywfllclinonjz/Build/Products/Debug-iphonesimulator/Spring -F /Users/tericky/Library/Developer/Xcode/DerivedData/x-fqcvlvimnhlizjcywfllclinonjz/Build/Products/Debug-iphonesimulator/SwiftDate -F /Users/tericky/Library/Developer/Xcode/DerivedData/x-fqcvlvimnhlizjcywfllclinonjz/Build/Products/Debug-iphonesimulator/SwiftyJSON -F /Users/tericky/Library/Developer/Xcode/DerivedData/x-fqcvlvimnhlizjcywfllclinonjz/Build/Products/Debug-iphonesimulator/SwiftyStoreKit -F /Users/tericky/Library/Developer/Xcode/DerivedData/x-fqcvlvimnhlizjcywfllclinonjz/Build/Products/Debug-iphonesimulator/TTGSnackbar -F /Users/tericky/Library/Developer/Xcode/DerivedData/x-fqcvlvimnhlizjcywfllclinonjz/Build/Products/Debug-iphonesimulator/TUSafariActivity -F /Path/ios/x/Pods/Crashlytics/iOS -F /Path/ios/x/Pods/FBAudienceNetwork -F /Path/ios/x/Pods/Fabric/iOS -F /Path/ios/x/Pods/FirebaseAnalytics/Frameworks -F /Path/ios/x/Pods/FirebaseAuth/Frameworks -F /Path/ios/x/Pods/FirebaseCore/Frameworks -F /Path/ios/x/Pods/FirebaseDatabase/Frameworks -F /Path/ios/x/Pods/FirebaseInstanceID/Frameworks -F /Path/ios/x/Pods/Google/Frameworks -F /Path/ios/x/Pods/GoogleSignIn/Frameworks -F /Path/ios/x/Pods/TwitterCore/iOS -F /Path/ios/x/Pods/TwitterKit/iOS -F /Path/ios/x/SDK/Line/LineAdapter -enable-testing -g -module-cache-path /Users/tericky/Library/Developer/Xcode/DerivedData/ModuleCache -D COCOAPODS -D DEBUG -serialize-debugging-options -Xcc -I/Users/tericky/Library/Developer/Xcode/DerivedData/x-fqcvlvimnhlizjcywfllclinonjz/Build/Intermediates/x.build/Debug-iphonesimulator/x.build/swift-overrides.hmap -Xcc -iquote -Xcc /Users/tericky/Library/Developer/Xcode/DerivedData/x-fqcvlvimnhlizjcywfllclinonjz/Build/Intermediates/x.build/Debug-iphonesimulator/x.build/x-generated-files.hmap -Xcc -I/Users/tericky/Library/Developer/Xcode/DerivedData/x-fqcvlvimnhlizjcywfllclinonjz/Build/Intermediates/x.build/Debug-iphonesimulator/x.build/x-own-target-headers.hmap -Xcc -I/Users/tericky/Library/Developer/Xcode/DerivedData/x-fqcvlvimnhlizjcywfllclinonjz/Build/Intermediates/x.build/Debug-iphonesimulator/x.build/x-all-non-framework-target-headers.hmap -Xcc -ivfsoverlay -Xcc /Users/tericky/Library/Developer/Xcode/DerivedData/x-fqcvlvimnhlizjcywfllclinonjz/Build/Intermediates/x.build/all-product-headers.yaml -Xcc -iquote -Xcc /Users/tericky/Library/Developer/Xcode/DerivedData/x-fqcvlvimnhlizjcywfllclinonjz/Build/Intermediates/x.build/Debug-iphonesimulator/x.build/x-project-headers.hmap -Xcc -I/Users/tericky/Library/Developer/Xcode/DerivedData/x-fqcvlvimnhlizjcywfllclinonjz/Build/Products/Debug-iphonesimulator/include -Xcc -I/Path/ios/x/Pods/Firebase/Core/Sources -Xcc -I/Path/ios/x/Pods/Google/Headers -Xcc -I/Path/ios/x/Pods/Headers/Public -Xcc -I/Path/ios/x/Pods/Headers/Public/Crashlytics -Xcc -I/Path/ios/x/Pods/Headers/Public/FBAudienceNetwork -Xcc -I/Path/ios/x/Pods/Headers/Public/Fabric -Xcc -I/Path/ios/x/Pods/Headers/Public/Firebase -Xcc -I/Path/ios/x/Pods/Headers/Public/FirebaseAnalytics -Xcc -I/Path/ios/x/Pods/Headers/Public/FirebaseAuth -Xcc -I/Path/ios/x/Pods/Headers/Public/FirebaseCore -Xcc -I/Path/ios/x/Pods/Headers/Public/FirebaseDatabase -Xcc -I/Path/ios/x/Pods/Headers/Public/FirebaseInstanceID -Xcc -I/Path/ios/x/Pods/Headers/Public/Google -Xcc -I/Path/ios/x/Pods/Headers/Public/GoogleSignIn -Xcc -I/Path/ios/x/Pods/Headers/Public/TwitterCore -Xcc -I/Path/ios/x/Pods/Headers/Public/TwitterKit -Xcc -I/Users/tericky/Library/Developer/Xcode/DerivedData/x-fqcvlvimnhlizjcywfllclinonjz/Build/Intermediates/x.build/Debug-iphonesimulator/x.build/DerivedSources/x86_64 -Xcc -I/Users/tericky/Library/Developer/Xcode/DerivedData/x-fqcvlvimnhlizjcywfllclinonjz/Build/Intermediates/x.build/Debug-iphonesimulator/x.build/DerivedSources -Xcc -DDEBUG=1 -Xcc -DCOCOAPODS=1 -Xcc -DDEBUG=1 -Xcc -DGTM_OAUTH2_USE_FRAMEWORK_IMPORTS=1 -Xcc -working-directory/Path/ios/x -emit-module-doc-path /Users/tericky/Library/Developer/Xcode/DerivedData/x-fqcvlvimnhlizjcywfllclinonjz/Build/Intermediates/x.build/Debug-iphonesimulator/x.build/Objects-normal/x86_64/StrategyGroupViewController~partial.swiftdoc -serialize-diagnostics-path /Users/tericky/Library/Developer/Xcode/DerivedData/x-fqcvlvimnhlizjcywfllclinonjz/Build/Intermediates/x.build/Debug-iphonesimulator/x.build/Objects-normal/x86_64/StrategyGroupViewController.dia -import-objc-header /Path/ios/x/x/x-Bridging-Header.h -Onone -module-name NoQ_Themepark -emit-module-path /Users/tericky/Library/Developer/Xcode/DerivedData/x-fqcvlvimnhlizjcywfllclinonjz/Build/Intermediates/x.build/Debug-iphonesimulator/x.build/Objects-normal/x86_64/StrategyGroupViewController~partial.swiftmodule -emit-dependencies-path /Users/tericky/Library/Developer/Xcode/DerivedData/x-fqcvlvimnhlizjcywfllclinonjz/Build/Intermediates/x.build/Debug-iphonesimulator/x.build/Objects-normal/x86_64/StrategyGroupViewController.d -emit-reference-dependencies-path /Users/tericky/Library/Developer/Xcode/DerivedData/x-fqcvlvimnhlizjcywfllclinonjz/Build/Intermediates/x.build/Debug-iphonesimulator/x.build/Objects-normal/x86_64/StrategyGroupViewController.swiftdeps -o /Users/tericky/Library/Developer/Xcode/DerivedData/x-fqcvlvimnhlizjcywfllclinonjz/Build/Intermediates/x.build/Debug-iphonesimulator/x.build/Objects-normal/x86_64/StrategyGroupViewController.o
1. While emitting SIL for 'showRedeem' at /Path/ios/x/x/Code/ViewController/StrategyGroupViewController.swift:400:5
我该怎么办?
答案 0 :(得分:0)
从调试我自己的Segmentation Fault 11问题,我看到一个常见的建议,有时可行的是删除/重新安装你的依赖 - 这从来没有帮助过我,但值得尝试。
快速浏览一下RMActionController
项目,您可能需要调查在步骤#1中使用操作处理程序闭包创建操作(即使只是一个空的闭包),看看是否有帮助,例如。
let confirmAction = RMAction(title: "Confirm", style: .cancel, andHandler: { _ in }) // #1
如果做不到这一点,您还可以在bugs.swift.org上提交错误报告,但团队需要一个可重复性最小的示例,而不仅仅是指出第三方库无法正常工作。