Segmentation fault casting [UIApplicationLaunchOptionsKey: Any] to [AnyHashable: AnyObject]

Originator:nakioparkour
Number:rdar://30261147 Date Originated:30-Jan-2017 12:31 PM
Status:Open Resolved:
Product:Xcode Product Version:8.2.1
Classification: Reproducible:Always
 
Summary:
Building with "Single-File Optimization" Swift compiler crashes with "Segmentation fault: 11".  
Issue is fixed removing a cast from `[UIApplicationLaunchOptionsKey: Any]` to `[AnyHashable: AnyObject]`.

Steps to Reproduce:


Expected Results:
Project built successfully

Actual Results:
Swift compiler crashes

Version:
Xcode 8.2.1 and Xcode 8.3 beta

Configuration:
AdHoc with "Fast, Single-File Optimization" as Optimisation Level

Trace:
0  swift                    0x0000000104cce3ad PrintStackTraceSignalHandler(void*) + 45
1  swift                    0x0000000104ccdb56 SignalHandler(int) + 790
2  libsystem_platform.dylib 0x00007fffd3154bba _sigtramp + 26
3  libsystem_platform.dylib 0x0000000000000040 _sigtramp + 753579168
4  swift                    0x000000010200fde3 swift::CastOptimizer::optimizeUnconditionalCheckedCastAddrInst(swift::UnconditionalCheckedCastAddrInst*) + 1699
5  swift                    0x0000000102098d4d processFunction(swift::SILFunction&, bool, unsigned int) + 1917
6  swift                    0x000000010209fc9f (anonymous namespace)::ConstantPropagation::run() + 47
7  swift                    0x000000010202e89e swift::SILPassManager::runOneIteration() + 5166
8  swift                    0x00000001020341f6 swift::runSILOptimizationPasses(swift::SILModule&) + 3462
9  swift                    0x0000000101cdb0e2 performCompile(swift::CompilerInstance&, swift::CompilerInvocation&, llvm::ArrayRef<char const*>, int&, swift::FrontendObserver*) + 20114
10 swift                    0x0000000101cd42b3 swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) + 17859
11 swift                    0x0000000101c905cf main + 8239
12 libdyld.dylib            0x00007fffd2f48255 start + 1
Stack dump:
0.	Program arguments: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift -frontend -emit-bc -filelist /var/folders/m7/kzdcwc2559960r9g12hn7m8m0000gn/T/sources-f7a1ad -target arm64-apple-ios9.0 -Xllvm -aarch64-use-tbi -enable-objc-interop -sdk /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS10.2.sdk -I /Users/carlos/Library/Developer/Xcode/DerivedData/Lyst-fdcwgbzpiwhsxtbyxrzdtlylrgkp/Build/Intermediates/ArchiveIntermediates/Lyst/BuildProductsPath/Release-iphoneos -F /Users/carlos/Library/Developer/Xcode/DerivedData/Lyst-fdcwgbzpiwhsxtbyxrzdtlylrgkp/Build/Intermediates/ArchiveIntermediates/Lyst/BuildProductsPath/Release-iphoneos -F /Users/carlos/Library/Developer/Xcode/DerivedData/Lyst-fdcwgbzpiwhsxtbyxrzdtlylrgkp/Build/Intermediates/ArchiveIntermediates/Lyst/BuildProductsPath/Release-iphoneos/Analyst -F /Users/carlos/Library/Developer/Xcode/DerivedData/Lyst-fdcwgbzpiwhsxtbyxrzdtlylrgkp/Build/Intermediates/ArchiveIntermediates/Lyst/BuildProductsPath/Release-iphoneos/BDKCollectionIndexView -F /Users/carlos/Library/Developer/Xcode/DerivedData/Lyst-fdcwgbzpiwhsxtbyxrzdtlylrgkp/Build/Intermediates/ArchiveIntermediates/Lyst/BuildProductsPath/Release-iphoneos/GAFramework -F /Users/carlos/Library/Developer/Xcode/DerivedData/Lyst-fdcwgbzpiwhsxtbyxrzdtlylrgkp/Build/Intermediates/ArchiveIntermediates/Lyst/BuildProductsPath/Release-iphoneos/NKOActivityIndicatorView -F /Users/carlos/Projects/LST-Lyst-iOS/Lyst/../Pods/Crashlytics/iOS -F /Users/carlos/Projects/LST-Lyst-iOS/Lyst/../Pods/Fabric/iOS -F /Users/carlos/Projects/LST-Lyst-iOS/Lyst/../Carthage/Build/iOS -g -module-cache-path /Users/carlos/Library/Developer/Xcode/DerivedData/ModuleCache -D COCOAPODS -D COCOAPODS -D APPSTORE -debug-time-function-bodies -serialize-debugging-options -Xcc -I/Users/carlos/Library/Developer/Xcode/DerivedData/Lyst-fdcwgbzpiwhsxtbyxrzdtlylrgkp/Build/Intermediates/ArchiveIntermediates/Lyst/IntermediateBuildFilesPath/Lyst.build/Release-iphoneos/Lyst.build/swift-overrides.hmap -Xcc -iquote -Xcc /Users/carlos/Library/Developer/Xcode/DerivedData/Lyst-fdcwgbzpiwhsxtbyxrzdtlylrgkp/Build/Intermediates/ArchiveIntermediates/Lyst/IntermediateBuildFilesPath/Lyst.build/Release-iphoneos/Lyst.build/Lyst-generated-files.hmap -Xcc -I/Users/carlos/Library/Developer/Xcode/DerivedData/Lyst-fdcwgbzpiwhsxtbyxrzdtlylrgkp/Build/Intermediates/ArchiveIntermediates/Lyst/IntermediateBuildFilesPath/Lyst.build/Release-iphoneos/Lyst.build/Lyst-own-target-headers.hmap -Xcc -I/Users/carlos/Library/Developer/Xcode/DerivedData/Lyst-fdcwgbzpiwhsxtbyxrzdtlylrgkp/Build/Intermediates/ArchiveIntermediates/Lyst/IntermediateBuildFilesPath/Lyst.build/Release-iphoneos/Lyst.build/Lyst-all-non-framework-target-headers.hmap -Xcc -ivfsoverlay -Xcc /Users/carlos/Library/Developer/Xcode/DerivedData/Lyst-fdcwgbzpiwhsxtbyxrzdtlylrgkp/Build/Intermediates/ArchiveIntermediates/Lyst/IntermediateBuildFilesPath/Lyst.build/all-product-headers.yaml -Xcc -iquote -Xcc /Users/carlos/Library/Developer/Xcode/DerivedData/Lyst-fdcwgbzpiwhsxtbyxrzdtlylrgkp/Build/Intermediates/ArchiveIntermediates/Lyst/IntermediateBuildFilesPath/Lyst.build/Release-iphoneos/Lyst.build/Lyst-project-headers.hmap -Xcc -I/Users/carlos/Library/Developer/Xcode/DerivedData/Lyst-fdcwgbzpiwhsxtbyxrzdtlylrgkp/Build/Intermediates/ArchiveIntermediates/Lyst/BuildProductsPath/Release-iphoneos/include -Xcc -I/Users/carlos/Projects/LST-Lyst-iOS/Lyst/../Pods/Headers/Public -Xcc -I/Users/carlos/Projects/LST-Lyst-iOS/Lyst/../Pods/Headers/Public/Crashlytics -Xcc -I/Users/carlos/Projects/LST-Lyst-iOS/Lyst/../Pods/Headers/Public/Fabric -Xcc -I/Users/carlos/Library/Developer/Xcode/DerivedData/Lyst-fdcwgbzpiwhsxtbyxrzdtlylrgkp/Build/Intermediates/ArchiveIntermediates/Lyst/IntermediateBuildFilesPath/Lyst.build/Release-iphoneos/Lyst.build/DerivedSources/arm64 -Xcc -I/Users/carlos/Library/Developer/Xcode/DerivedData/Lyst-fdcwgbzpiwhsxtbyxrzdtlylrgkp/Build/Intermediates/ArchiveIntermediates/Lyst/IntermediateBuildFilesPath/Lyst.build/Release-iphoneos/Lyst.build/DerivedSources -Xcc -DAPPSTORE=1 -Xcc -DCOCOAPODS=1 -Xcc -DAPPSTORE=1 -Xcc -working-directory/Users/carlos/Projects/LST-Lyst-iOS/Lyst -emit-module-doc-path /Users/carlos/Library/Developer/Xcode/DerivedData/Lyst-fdcwgbzpiwhsxtbyxrzdtlylrgkp/Build/Intermediates/ArchiveIntermediates/Lyst/IntermediateBuildFilesPath/Lyst.build/Release-iphoneos/Lyst.build/Objects-normal/arm64/Lyst.swiftdoc -O -module-name Lyst -emit-module-path /Users/carlos/Library/Developer/Xcode/DerivedData/Lyst-fdcwgbzpiwhsxtbyxrzdtlylrgkp/Build/Intermediates/ArchiveIntermediates/Lyst/IntermediateBuildFilesPath/Lyst.build/Release-iphoneos/Lyst.build/Objects-normal/arm64/Lyst.swiftmodule -emit-objc-header-path /Users/carlos/Library/Developer/Xcode/DerivedData/Lyst-fdcwgbzpiwhsxtbyxrzdtlylrgkp/Build/Intermediates/ArchiveIntermediates/Lyst/IntermediateBuildFilesPath/Lyst.build/Release-iphoneos/Lyst.build/Objects-normal/arm64/Lyst-Swift.h -serialize-diagnostics-path /Users/carlos/Library/Developer/Xcode/DerivedData/Lyst-fdcwgbzpiwhsxtbyxrzdtlylrgkp/Build/Intermediates/ArchiveIntermediates/Lyst/IntermediateBuildFilesPath/Lyst.build/Release-iphoneos/Lyst.build/Objects-normal/arm64/LSTCheckoutController.dia -emit-dependencies-path /Users/carlos/Library/Developer/Xcode/DerivedData/Lyst-fdcwgbzpiwhsxtbyxrzdtlylrgkp/Build/Intermediates/ArchiveIntermediates/Lyst/IntermediateBuildFilesPath/Lyst.build/Release-iphoneos/Lyst.build/Objects-normal/arm64/LSTCheckoutController.d -num-threads 4 -output-filelist /var/folders/m7/kzdcwc2559960r9g12hn7m8m0000gn/T/outputs-3774d4 
1.	While running pass #751115 SILFunctionTransform "Constant Propagation" on SILFunction "@_TTSg5VSC29UIApplicationLaunchOptionsKeyS_s8Hashable5UIKit_P__CSo8NSObjectS2_S0_10ObjectiveC_Ps9AnyObject____TFs17_dictionaryUpCastu2_Rxs8Hashable0_S_rFGVs10Dictionaryxq__GS0_q0_q1__".

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!