Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Swift: segmentation fault when compiling for Archive from iOS 7

I've always had this issue so I started creating a new single-view application, in Swift, for both iPhone and iPad. When the target is iOS 8.1 everything works fine, but if I set iOS 7.1 (or 7), i get a Segmentation fault. This happens when i go to Product > Archive, when i Run the project in the simulator or my device, everything is fine. I tried with both iOS 7 and 8 simulators and it compiles. As I said, the problem is not in the code since it behaves this way even with a newly created project.

CompileSwift normal armv7 /Users/francesco/Documents/XCode Projects/Prova/Prova/ViewController.swift
cd /Users/francesco/Documents/XCode Projects/Prova
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift -frontend -c -primary-file "/Users/francesco/Documents/XCode Projects/Prova/Prova/ViewController.swift" "/Users/francesco/Documents/XCode Projects/Prova/Prova/AppDelegate.swift" -target armv7-apple-ios7.1 -target-cpu cortex-a8 -target-abi apcs-gnu -sdk /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk -I /Users/francesco/Library/Developer/Xcode/DerivedData/Prova-argzihphsooyijfpeustrrhxmfmk/Build/Intermediates/ArchiveIntermediates/Prova/BuildProductsPath/Release-iphoneos -F /Users/francesco/Library/Developer/Xcode/DerivedData/Prova-argzihphsooyijfpeustrrhxmfmk/Build/Intermediates/ArchiveIntermediates/Prova/BuildProductsPath/Release-iphoneos -g -module-cache-path /Users/francesco/Library/Developer/Xcode/DerivedData/ModuleCache -Xcc -I/Users/francesco/Library/Developer/Xcode/DerivedData/Prova-argzihphsooyijfpeustrrhxmfmk/Build/Intermediates/ArchiveIntermediates/Prova/IntermediateBuildFilesPath/Prova.build/Release-iphoneos/Prova.build/swift-overrides.hmap -Xcc -iquote -Xcc /Users/francesco/Library/Developer/Xcode/DerivedData/Prova-argzihphsooyijfpeustrrhxmfmk/Build/Intermediates/ArchiveIntermediates/Prova/IntermediateBuildFilesPath/Prova.build/Release-iphoneos/Prova.build/Prova-generated-files.hmap -Xcc -I/Users/francesco/Library/Developer/Xcode/DerivedData/Prova-argzihphsooyijfpeustrrhxmfmk/Build/Intermediates/ArchiveIntermediates/Prova/IntermediateBuildFilesPath/Prova.build/Release-iphoneos/Prova.build/Prova-own-target-headers.hmap -Xcc -I/Users/francesco/Library/Developer/Xcode/DerivedData/Prova-argzihphsooyijfpeustrrhxmfmk/Build/Intermediates/ArchiveIntermediates/Prova/IntermediateBuildFilesPath/Prova.build/Release-iphoneos/Prova.build/Prova-all-target-headers.hmap -Xcc -iquote -Xcc /Users/francesco/Library/Developer/Xcode/DerivedData/Prova-argzihphsooyijfpeustrrhxmfmk/Build/Intermediates/ArchiveIntermediates/Prova/IntermediateBuildFilesPath/Prova.build/Release-iphoneos/Prova.build/Prova-project-headers.hmap -Xcc -I/Users/francesco/Library/Developer/Xcode/DerivedData/Prova-argzihphsooyijfpeustrrhxmfmk/Build/Intermediates/ArchiveIntermediates/Prova/BuildProductsPath/Release-iphoneos/include -Xcc -I/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include -Xcc -I/Users/francesco/Library/Developer/Xcode/DerivedData/Prova-argzihphsooyijfpeustrrhxmfmk/Build/Intermediates/ArchiveIntermediates/Prova/IntermediateBuildFilesPath/Prova.build/Release-iphoneos/Prova.build/DerivedSources/armv7 -Xcc -I/Users/francesco/Library/Developer/Xcode/DerivedData/Prova-argzihphsooyijfpeustrrhxmfmk/Build/Intermediates/ArchiveIntermediates/Prova/IntermediateBuildFilesPath/Prova.build/Release-iphoneos/Prova.build/DerivedSources -emit-module-doc-path /Users/francesco/Library/Developer/Xcode/DerivedData/Prova-argzihphsooyijfpeustrrhxmfmk/Build/Intermediates/ArchiveIntermediates/Prova/IntermediateBuildFilesPath/Prova.build/Release-iphoneos/Prova.build/Objects-normal/armv7/ViewController~partial.swiftdoc -O -module-name Prova -emit-module-path /Users/francesco/Library/Developer/Xcode/DerivedData/Prova-argzihphsooyijfpeustrrhxmfmk/Build/Intermediates/ArchiveIntermediates/Prova/IntermediateBuildFilesPath/Prova.build/Release-iphoneos/Prova.build/Objects-normal/armv7/ViewController~partial.swiftmodule -serialize-diagnostics-path /Users/francesco/Library/Developer/Xcode/DerivedData/Prova-argzihphsooyijfpeustrrhxmfmk/Build/Intermediates/ArchiveIntermediates/Prova/IntermediateBuildFilesPath/Prova.build/Release-iphoneos/Prova.build/Objects-normal/armv7/ViewController.dia -emit-dependencies-path /Users/francesco/Library/Developer/Xcode/DerivedData/Prova-argzihphsooyijfpeustrrhxmfmk/Build/Intermediates/ArchiveIntermediates/Prova/IntermediateBuildFilesPath/Prova.build/Release-iphoneos/Prova.build/Objects-normal/armv7/ViewController.d -o /Users/francesco/Library/Developer/Xcode/DerivedData/Prova-argzihphsooyijfpeustrrhxmfmk/Build/Intermediates/ArchiveIntermediates/Prova/IntermediateBuildFilesPath/Prova.build/Release-iphoneos/Prova.build/Objects-normal/armv7/ViewController.o

Stack dump:
0.  Program arguments: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift -frontend -c -primary-file /Users/francesco/Documents/XCode Projects/Prova/Prova/ViewController.swift /Users/francesco/Documents/XCode Projects/Prova/Prova/AppDelegate.swift -target armv7-apple-ios7.1 -target-cpu cortex-a8 -target-abi apcs-gnu -sdk /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk -I /Users/francesco/Library/Developer/Xcode/DerivedData/Prova-argzihphsooyijfpeustrrhxmfmk/Build/Intermediates/ArchiveIntermediates/Prova/BuildProductsPath/Release-iphoneos -F /Users/francesco/Library/Developer/Xcode/DerivedData/Prova-argzihphsooyijfpeustrrhxmfmk/Build/Intermediates/ArchiveIntermediates/Prova/BuildProductsPath/Release-iphoneos -g -module-cache-path /Users/francesco/Library/Developer/Xcode/DerivedData/ModuleCache -Xcc -I/Users/francesco/Library/Developer/Xcode/DerivedData/Prova-argzihphsooyijfpeustrrhxmfmk/Build/Intermediates/ArchiveIntermediates/Prova/IntermediateBuildFilesPath/Prova.build/Release-iphoneos/Prova.build/swift-overrides.hmap -Xcc -iquote -Xcc /Users/francesco/Library/Developer/Xcode/DerivedData/Prova-argzihphsooyijfpeustrrhxmfmk/Build/Intermediates/ArchiveIntermediates/Prova/IntermediateBuildFilesPath/Prova.build/Release-iphoneos/Prova.build/Prova-generated-files.hmap -Xcc -I/Users/francesco/Library/Developer/Xcode/DerivedData/Prova-argzihphsooyijfpeustrrhxmfmk/Build/Intermediates/ArchiveIntermediates/Prova/IntermediateBuildFilesPath/Prova.build/Release-iphoneos/Prova.build/Prova-own-target-headers.hmap -Xcc -I/Users/francesco/Library/Developer/Xcode/DerivedData/Prova-argzihphsooyijfpeustrrhxmfmk/Build/Intermediates/ArchiveIntermediates/Prova/IntermediateBuildFilesPath/Prova.build/Release-iphoneos/Prova.build/Prova-all-target-headers.hmap -Xcc -iquote -Xcc /Users/francesco/Library/Developer/Xcode/DerivedData/Prova-argzihphsooyijfpeustrrhxmfmk/Build/Intermediates/ArchiveIntermediates/Prova/IntermediateBuildFilesPath/Prova.build/Release-iphoneos/Prova.build/Prova-project-headers.hmap -Xcc -I/Users/francesco/Library/Developer/Xcode/DerivedData/Prova-argzihphsooyijfpeustrrhxmfmk/Build/Intermediates/ArchiveIntermediates/Prova/BuildProductsPath/Release-iphoneos/include -Xcc -I/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include -Xcc -I/Users/francesco/Library/Developer/Xcode/DerivedData/Prova-argzihphsooyijfpeustrrhxmfmk/Build/Intermediates/ArchiveIntermediates/Prova/IntermediateBuildFilesPath/Prova.build/Release-iphoneos/Prova.build/DerivedSources/armv7 -Xcc -I/Users/francesco/Library/Developer/Xcode/DerivedData/Prova-argzihphsooyijfpeustrrhxmfmk/Build/Intermediates/ArchiveIntermediates/Prova/IntermediateBuildFilesPath/Prova.build/Release-iphoneos/Prova.build/DerivedSources -emit-module-doc-path /Users/francesco/Library/Developer/Xcode/DerivedData/Prova-argzihphsooyijfpeustrrhxmfmk/Build/Intermediates/ArchiveIntermediates/Prova/IntermediateBuildFilesPath/Prova.build/Release-iphoneos/Prova.build/Objects-normal/armv7/ViewController~partial.swiftdoc -O -module-name Prova -emit-module-path /Users/francesco/Library/Developer/Xcode/DerivedData/Prova-argzihphsooyijfpeustrrhxmfmk/Build/Intermediates/ArchiveIntermediates/Prova/IntermediateBuildFilesPath/Prova.build/Release-iphoneos/Prova.build/Objects-normal/armv7/ViewController~partial.swiftmodule -serialize-diagnostics-path /Users/francesco/Library/Developer/Xcode/DerivedData/Prova-argzihphsooyijfpeustrrhxmfmk/Build/Intermediates/ArchiveIntermediates/Prova/IntermediateBuildFilesPath/Prova.build/Release-iphoneos/Prova.build/Objects-normal/armv7/ViewController.dia -emit-dependencies-path /Users/francesco/Library/Developer/Xcode/DerivedData/Prova-argzihphsooyijfpeustrrhxmfmk/Build/Intermediates/ArchiveIntermediates/Prova/IntermediateBuildFilesPath/Prova.build/Release-iphoneos/Prova.build/Objects-normal/armv7/ViewController.d -o /Users/francesco/Library/Developer/Xcode/DerivedData/Prova-argzihphsooyijfpeustrrhxmfmk/Build/Intermediates/ArchiveIntermediates/Prova/IntermediateBuildFilesPath/Prova.build/Release-iphoneos/Prova.build/Objects-normal/armv7/ViewController.o 
1.  While type-checking 'ViewController' at /Users/francesco/Documents/XCode Projects/Prova/Prova/ViewController.swift:11:1

Command failed due to signal: Segmentation fault: 11

Does anybody have any idea about this issue?

UPDATE: I can target armv7s and arm64 to iOS 7, armv7 is what causes the issue; if armv7 is targeted to iOS 8 and others to iOS 7, everything works. That's not a good solution since it's more important to support older OSs on older devices, in my opinion.

like image 452
FrCr Avatar asked Nov 04 '14 09:11

FrCr


2 Answers

I had the same problem until someone told me that it's a problem with the certificates. Go to the Dev Center and regenerate your Certificates & Provisioning Profiles. After that it should work!

like image 85
Hannes Avatar answered Oct 22 '22 21:10

Hannes


Closing Xcode and opening another project, then loading back this one, solved the issue. It was a bug, I guess.

like image 2
FrCr Avatar answered Oct 22 '22 20:10

FrCr