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
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.
I've tried setting the optimization level to "Fastest, Unchecked" or "Fastest", the segmentation fault still occurs. If I set the optimization level to "None"; the project builds.
This code worked fine before Swift 1.2 in both schemes.
Anyone have any insight into what is going on here?
UPDATE: It looks like Xcode 6.3.1 has fixed my seg fault issues.