Release方案编译时的Swift 1.2分段错误 [英] Swift 1.2 segmentation fault on compile of Release scheme

查看:110
本文介绍了Release方案编译时的Swift 1.2分段错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚升级到Swift 1.2,当我尝试使用Release方案编译iOS应用程序时,我收到分段错误:11。

I've just upgraded to Swift 1.2 and when I attempt to compile the iOS application using the Release scheme I receive a "segmentation fault: 11".

0  swift                    0x00000001105a9a08 llvm::sys::PrintStackTrace(__sFILE*) + 40
1  swift                    0x00000001105a9ee4 SignalHandler(int) + 452
2  libsystem_platform.dylib 0x00007fff9a724f1a _sigtramp + 26
3  libsystem_platform.dylib 0x00007fff4fd6f6b0 _sigtramp + 3043272624
4  swift                    0x00000001100e837a (anonymous namespace)::DCE::markControllingTerminatorsLive(swift::SILBasicBlock*) + 346
5  swift                    0x00000001100e8109 (anonymous namespace)::DCE::markValueLive(swift::ValueBase*) + 201
6  swift                    0x00000001100e791f (anonymous namespace)::DCE::run() + 1983
7  swift                    0x000000011008f55e swift::SILPassManager::runFunctionPasses(llvm::ArrayRef<swift::SILFunctionTransform*>) + 1310
8  swift                    0x000000011008ffe9 swift::SILPassManager::runOneIteration() + 633
9  swift                    0x000000011008ea56 swift::runSILOptimizationPasses(swift::SILModule&) + 790
10 swift                    0x000000010fe92ee7 frontend_main(llvm::ArrayRef<char const*>, char const*, void*) + 4695
11 swift                    0x000000010fe91ae6 main + 1814
12 libdyld.dylib            0x00007fff995665c9 start + 1

当我使用Dev / Debug方案时,应用程序编译并运行完美。

The application compiles and runs perfectly when I use the Dev/Debug scheme.

我缩小了编译器问题单个文件和几行代码。

I have narrowed the compiler issue down to a single file and a couple lines of code.

let directPhoneType = PhoneNumber.Codes.Contacts["D"]
phoneTypes = phoneTypes.filter { $0 != directPhoneType }

我试过更改过滤代码周围(使用元素输入等),但每次尝试都会导致分段错误。我们的应用程序中还有其他过滤逻辑可编译正常。

I've tried changing the filtering code around (using "element in", etc), but each attempt causes the segmentation fault still. There is other filtering logic throughout our application that compiles fine.

如果我删除过滤代码或将其更改为手动过滤手机类型的循环,则应用程序运行正常在发布方案中。

If I remove the filtering code or change it to a loop that manually filters the phone types, the Application runs fine in the Release scheme.

我尝试将优化级别设置为最快,未选中或最快,仍然会发生分段错误。如果我将优化级别设置为无;项目构建。

在两种方案中,此代码在Swift 1.2之前运行良好。

This code worked fine before Swift 1.2 in both schemes.

任何人对这里发生的事情有任何了解吗?

Anyone have any insight into what is going on here?

更新:看起来Xcode 6.3.1修复了我的seg故障问题。

UPDATE: It looks like Xcode 6.3.1 has fixed my seg fault issues.

推荐答案

遇到同样的问题,没有类似于你的代码。关闭整个模块优化(默认情况下已关闭)解决了我的问题,这意味着我仍然可以使用最快的优化设置进行存档。

Ran into the same problem, without having code similar to yours. Turning off whole module optimization (which is off by default) solved the issue for me, meaning I'm still able to archive with fastest optimization settings.

这篇关于Release方案编译时的Swift 1.2分段错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆