Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
802 views
in Technique[技术] by (71.8m points)

xcode - Swift Project Builds and runs but fails to Archive

I have a xcode project and running on the device, debug build everything is fine.

However when i try to archive the project im getting a segfault from the Swift Compiler:

0  swift                    0x0000000105c36608 llvm::sys::PrintStackTrace(__sFILE*) + 40
1  swift                    0x0000000105c36af4 SignalHandler(int) + 452
2  libsystem_platform.dylib 0x00007fff852705aa _sigtramp + 26
3  libsystem_platform.dylib 0x0000000000000002 _sigtramp + 2061040242
4  swift                    0x0000000105f51896            swift::TypeBase::getTypeOfMember(swift::Module*, swift::ValueDecl const*,    swift::LazyResolver*, swift::Type) + 534
5  swift                    0x00000001050eee38 swift::SILType::getFieldType(swift::VarDecl*, swift::SILModule&) const + 56
6  swift                    0x00000001051a1252 (anonymous namespace)::SILSROA::run() + 3602
7  swift                    0x000000010516b116 swift::SILPassManager::runFunctionPasses(llvm::ArrayRef<swift::SILFunctionTransform*>) + 310
8  swift                    0x000000010516b6f9 swift::SILPassManager::runOneIteration() + 761
9  swift                    0x000000010516b92b swift::SILPassManager::run() + 251
10 swift                    0x000000010516afbc swift::runSILOptimizationPasses(swift::SILModule&, swift::SILOptions const&) + 1644
11 swift                    0x0000000104ffb141 frontend_main(llvm::ArrayRef<char const*>, char const*, void*) + 3537
12 swift                    0x0000000104ffa35d main + 1533
13 libdyld.dylib            0x00007fff885d75fd start + 1
14 libdyld.dylib            0x0000000000000052 start + 2007140950

I have seen people talking about certain synta that can cause this kind of error, but does anyone know how to try and track down which bit(s) of the code is causing the segfault?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

I had a similar issue and the "solution" was to turn swift compiler code generation optimization level to -Onone in build settings for the release configuration. This is as of Xcode 6.0.1. Turning off swift compiler optimization


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...