在 Swift 3 中存档项目并获得 "command failed due to signal segmentation fault 11"
Archive project in Swift 3 and get "command failed due to signal segmentation fault 11"
我更新了 Swift 3 的代码,运行 在设备上一切正常,但是当我存档项目时,在清理和删除交付的数据后,出现错误 "command failed due to signal segmentation fault 11"
我的日志
0 swift 0x000000010a5ffb6d PrintStackTraceSignalHandler(void*) + 45
1 swift 0x000000010a5ff5b6 SignalHandler(int) + 470
2 libsystem_platform.dylib 0x00007fff9560152a _sigtramp + 26
3 libsystem_platform.dylib 0x00007fff5825ab50 _sigtramp + 3267728960
4 swift 0x0000000107d29432 swift::CastOptimizer::optimizeUnconditionalCheckedCastAddrInst(swift::UnconditionalCheckedCastAddrInst*) + 1554
5 swift 0x0000000107db144d processFunction(swift::SILFunction&, bool, unsigned int) + 1901
6 swift 0x0000000107db7f9f(匿名命名空间)::ConstantPropagation::运行() + 47
7 swift 0x0000000107d4862d swift::SILPassManager::runOneIteration() + 6077
8 swift 0x0000000107d4d7d6 swift::runSILOptimizationPasses(swift::SILModule&) + 3462
9 swift 0x0000000107a153cb performCompile(swift::CompilerInstance&, swift::CompilerInvocation&, llvm::ArrayRef, int&, swift::FrontendObserver*) + 20107
10 swift 0x0000000107a0e265 swift::performFrontend(llvm::ArrayRef, char const*, void*, swift::FrontendObserver*) + 17029
11 swift 0x00000001079cb82d 主 + 8685
12 libdyld.dylib 0x00007fff8936c5ad 开始 + 1
13 libdyld.dylib 0x000000000000006d 开始 + 1992899265
堆栈转储:
和这个
- 同时 运行在 SILFunction“@_TTSg5VSC29UIApplicationLaunchOptionsKeyS_s8Hashable5UIKit_P__CSo8NSObjectS2_S0_10ObjectiveC_Ps9AnyObject____TFs17_dictionaryUpCastu2_Rxs8Hashable0_S_rFGVs10Dictionaryxq__GS0_q0_q1__”上通过 #1059521 SILFunctionTransform "Constant Propagation"。
谁能帮忙或告诉我,我应该在哪里搜索错误?
在我的例子中,我将 launchOptions 作为函数参数传递给另一个 class inside
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool
迁移到 Swift 3 后,迁移器添加了转换以匹配等待参数的类型,该类型为 [NSObject : AnyObject]?
(pre Swift 3)
我所要做的只是更新我的自定义函数以将 [UIApplicationLaunchOptionsKey: Any]
作为参数并删除错误的转换。就这么简单
我不必牺牲任何优化级别(这甚至不应该是开发人员的最后手段,这绝对不是解决编译器 errors/segmentation 错误的方法)。删除 cast all 后,swift 的整个模块优化工作正常。
我更新了 Swift 3 的代码,运行 在设备上一切正常,但是当我存档项目时,在清理和删除交付的数据后,出现错误 "command failed due to signal segmentation fault 11"
我的日志
0 swift 0x000000010a5ffb6d PrintStackTraceSignalHandler(void*) + 45
1 swift 0x000000010a5ff5b6 SignalHandler(int) + 470
2 libsystem_platform.dylib 0x00007fff9560152a _sigtramp + 26
3 libsystem_platform.dylib 0x00007fff5825ab50 _sigtramp + 3267728960
4 swift 0x0000000107d29432 swift::CastOptimizer::optimizeUnconditionalCheckedCastAddrInst(swift::UnconditionalCheckedCastAddrInst*) + 1554
5 swift 0x0000000107db144d processFunction(swift::SILFunction&, bool, unsigned int) + 1901
6 swift 0x0000000107db7f9f(匿名命名空间)::ConstantPropagation::运行() + 47
7 swift 0x0000000107d4862d swift::SILPassManager::runOneIteration() + 6077
8 swift 0x0000000107d4d7d6 swift::runSILOptimizationPasses(swift::SILModule&) + 3462
9 swift 0x0000000107a153cb performCompile(swift::CompilerInstance&, swift::CompilerInvocation&, llvm::ArrayRef, int&, swift::FrontendObserver*) + 20107
10 swift 0x0000000107a0e265 swift::performFrontend(llvm::ArrayRef, char const*, void*, swift::FrontendObserver*) + 17029
11 swift 0x00000001079cb82d 主 + 8685
12 libdyld.dylib 0x00007fff8936c5ad 开始 + 1
13 libdyld.dylib 0x000000000000006d 开始 + 1992899265 堆栈转储:
和这个
- 同时 运行在 SILFunction“@_TTSg5VSC29UIApplicationLaunchOptionsKeyS_s8Hashable5UIKit_P__CSo8NSObjectS2_S0_10ObjectiveC_Ps9AnyObject____TFs17_dictionaryUpCastu2_Rxs8Hashable0_S_rFGVs10Dictionaryxq__GS0_q0_q1__”上通过 #1059521 SILFunctionTransform "Constant Propagation"。
谁能帮忙或告诉我,我应该在哪里搜索错误?
在我的例子中,我将 launchOptions 作为函数参数传递给另一个 class inside
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool
迁移到 Swift 3 后,迁移器添加了转换以匹配等待参数的类型,该类型为 [NSObject : AnyObject]?
(pre Swift 3)
我所要做的只是更新我的自定义函数以将 [UIApplicationLaunchOptionsKey: Any]
作为参数并删除错误的转换。就这么简单
我不必牺牲任何优化级别(这甚至不应该是开发人员的最后手段,这绝对不是解决编译器 errors/segmentation 错误的方法)。删除 cast all 后,swift 的整个模块优化工作正常。