Closed swift-ci closed 5 years ago
cc @akyrtzi
Crashes the typechecker with assertion, reproduced from master 07b1905d22088730d09be5a5d3e76438a7c4a36c:
$ cat /tmp/crash.swift
class C {
@IBOutlet weak var c: C
}
$ $raswift -typecheck /tmp/crash.swift -module-cache-path /tmp/mcp
Assertion failed: (T->getOptionalObjectType() && "optional type is required"), function get, file /Users/argiris/proj/opensource/swift/src/swift/lib/AST/ASTContext.cpp, line 3496.
Stack dump:
0. Program arguments: /Users/argiris/proj/opensource/swift/nbuild/Release+Asserts/bin/swift -frontend -typecheck -primary-file /tmp/crash.swift -target x86_64-apple-darwin18.5.0 -enable-objc-interop -module-cache-path /tmp/mcp -color-diagnostics -module-name crash
1. While type-checking 'C' (at /tmp/crash.swift:1:1)
2. While type-checking declaration 0x7fc5b30221b0 (at /tmp/crash.swift:2:18)
0 swift 0x000000010a3a2a35 llvm::sys::PrintStackTrace(llvm::raw_ostream&) + 37
1 swift 0x000000010a3a1978 llvm::sys::RunSignalHandlers() + 248
2 swift 0x000000010a3a3042 SignalHandler(int) + 258
3 libsystem_platform.dylib 0x00007fff6dcf8b5d _sigtramp + 29
4 libsystem_platform.dylib 0x0000000000003ba0 _sigtramp + 2452664416
5 libsystem_c.dylib 0x00007fff6dbb76a6 abort + 127
6 libsystem_c.dylib 0x00007fff6db8010d basename_r + 0
7 swift 0x00000001079ad3e1 swift::ReferenceStorageType::get(swift::Type, swift::ReferenceOwnership, swift::ASTContext const&) + 849
8 swift 0x000000010765f9e5 swift::TypeChecker::checkReferenceOwnershipAttr(swift::VarDecl*, swift::ReferenceOwnershipAttr*) + 1013
9 swift 0x00000001076cd783 swift::TypeChecker::coercePatternToType(swift::Pattern*&, swift::TypeResolution, swift::Type, swift::TypeResolutionOptions, swift::TypeLoc) + 2051
10 swift 0x00000001076cca17 swift::TypeChecker::typeCheckPattern(swift::Pattern*, swift::DeclContext*, swift::TypeResolutionOptions) + 519
11 swift 0x000000010769a161 validatePatternBindingEntries(swift::TypeChecker&, swift::PatternBindingDecl*) + 609
12 swift 0x00000001076926f0 (anonymous namespace)::DeclChecker::visit(swift::Decl*) + 832
13 swift 0x000000010769f19b (anonymous namespace)::DeclChecker::visitClassDecl(swift::ClassDecl*) + 267
14 swift 0x00000001076925ba (anonymous namespace)::DeclChecker::visit(swift::Decl*) + 522
15 swift 0x00000001076923a6 swift::TypeChecker::typeCheckDecl(swift::Decl*) + 38
16 swift 0x0000000107732d99 swift::performTypeChecking(swift::SourceFile&, swift::TopLevelContext&, swift::OptionSet<swift::TypeCheckingFlags, unsigned int>, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int) + 985
17 swift 0x0000000106ec07a6 swift::CompilerInstance::parseAndTypeCheckMainFileUpTo(swift::SourceFile::ASTStage_t, swift::PersistentParserState&, swift::DelayedParsingCallbacks*, swift::OptionSet<swift::TypeCheckingFlags, unsigned int>) + 502
18 swift 0x0000000106ebf123 swift::CompilerInstance::parseAndCheckTypesUpTo(swift::CompilerInstance::ImplicitImports const&, swift::SourceFile::ASTStage_t) + 371
19 swift 0x0000000106ebe7a7 swift::CompilerInstance::performSemaUpTo(swift::SourceFile::ASTStage_t) + 615
20 swift 0x000000010661499f performCompile(swift::CompilerInstance&, swift::CompilerInvocation&, llvm::ArrayRef<char const*>, int&, swift::FrontendObserver*, swift::UnifiedStatsReporter*) + 1679
cc @xedin
This is declaration checker crasher.
/cc @DougGregor
Attachment: Download
Environment
Using February 3rd Trunk built with Xcode 10.2 beta 2 (10P91b)Additional Detail from JIRA
| | | |------------------|-----------------| |Votes | 0 | |Component/s | Compiler, Source Tooling | |Labels | Bug, FoundByStressTester, TypeChecker | |Assignee | None | |Priority | Medium | md5: 57dea54130f528373f07a99955b43839is duplicated by:
Issue Description:
Detected unexpected failure: SourceKit crashed request: CursorInfo in /Users/me/Desktop/Refrigerator/Refrigerator/View Controllers/BeveragesViewController.swift (modified: concurrent) at offset 444 with args: -incremental -module-name Refrigerator -Onone -enable-batch-mode -enforce-exclusivity=checked -DDEBUG -sdk /Applications/xcode_beta/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk -target x86_64-apple-ios11.2-simulator -g -module-cache-path /Users/me/Library/Developer/Xcode/DerivedData/ModuleCache.noindex -Xfrontend -serialize-debugging-options -enable-testing -index-store-path /Users/me/Library/Developer/Xcode/DerivedData/Refrigerator-cogitanvthedtnflcnsyjazrxsuh/Index/DataStore -swift-version 5 -Xlinker -rpath -Xlinker /usr/lib/swift -I /Users/me/Library/Developer/Xcode/DerivedData/Refrigerator-cogitanvthedtnflcnsyjazrxsuh/Build/Products/Debug-iphonesimulator -F /Users/me/Library/Developer/Xcode/DerivedData/Refrigerator-cogitanvthedtnflcnsyjazrxsuh/Build/Products/Debug-iphonesimulator -c -j4 /Users/me/Desktop/Refrigerator/Refrigerator/Views/BeverageCategoryLabel.swift /Users/me/Desktop/Refrigerator/Refrigerator/View Models/BeverageCategoryViewModel.swift /Users/me/Desktop/Refrigerator/Refrigerator/Views/BeverageCell.swift /Users/me/Desktop/Refrigerator/Refrigerator/View Models/BeverageViewModel.swift /Users/me/Desktop/Refrigerator/Refrigerator/Coordinators/BeveragesFlowCoordinator.swift /Users/me/Desktop/Refrigerator/Refrigerator/View Controllers/BeveragesViewController.swift /Users/me/Desktop/Refrigerator/Refrigerator/Strings/BeverageCategoryString.swift /Users/me/Desktop/Refrigerator/Refrigerator/Extensions/UIColor.swift /Users/me/Desktop/Refrigerator/Refrigerator/View Models/BeveragesViewModel.swift /Users/me/Desktop/Refrigerator/Refrigerator/Coordinators/AppCoordinator.swift /Users/me/Desktop/Refrigerator/Refrigerator/Strings/Localizable.swift /Users/me/Desktop/Refrigerator/Refrigerator/AppDelegate.swift -output-file-map /Users/me/Library/Developer/Xcode/DerivedData/Refrigerator-cogitanvthedtnflcnsyjazrxsuh/Build/Intermediates.noindex/Refrigerator.build/Debug-iphonesimulator/Refrigerator.build/Objects-normal/x86_64/Refrigerator-OutputFileMap.json -parseable-output -serialize-diagnostics -emit-dependencies -emit-module -emit-module-path /Users/me/Library/Developer/Xcode/DerivedData/Refrigerator-cogitanvthedtnflcnsyjazrxsuh/Build/Intermediates.noindex/Refrigerator.build/Debug-iphonesimulator/Refrigerator.build/Objects-normal/x86_64/Refrigerator.swiftmodule -Xcc -I/Users/me/Library/Developer/Xcode/DerivedData/Refrigerator-cogitanvthedtnflcnsyjazrxsuh/Build/Intermediates.noindex/Refrigerator.build/Debug-iphonesimulator/Refrigerator.build/swift-overrides.hmap -Xcc -iquote -Xcc /Users/me/Library/Developer/Xcode/DerivedData/Refrigerator-cogitanvthedtnflcnsyjazrxsuh/Build/Intermediates.noindex/Refrigerator.build/Debug-iphonesimulator/Refrigerator.build/Refrigerator-generated-files.hmap -Xcc -I/Users/me/Library/Developer/Xcode/DerivedData/Refrigerator-cogitanvthedtnflcnsyjazrxsuh/Build/Intermediates.noindex/Refrigerator.build/Debug-iphonesimulator/Refrigerator.build/Refrigerator-own-target-headers.hmap -Xcc -I/Users/me/Library/Developer/Xcode/DerivedData/Refrigerator-cogitanvthedtnflcnsyjazrxsuh/Build/Intermediates.noindex/Refrigerator.build/Debug-iphonesimulator/Refrigerator.build/Refrigerator-all-non-framework-target-headers.hmap -Xcc -ivfsoverlay -Xcc /Users/me/Library/Developer/Xcode/DerivedData/Refrigerator-cogitanvthedtnflcnsyjazrxsuh/Build/Intermediates.noindex/Refrigerator.build/Debug-iphonesimulator/Refrigerator.build/all-product-headers.yaml -Xcc -iquote -Xcc /Users/me/Library/Developer/Xcode/DerivedData/Refrigerator-cogitanvthedtnflcnsyjazrxsuh/Build/Intermediates.noindex/Refrigerator.build/Debug-iphonesimulator/Refrigerator.build/Refrigerator-project-headers.hmap -Xcc -I/Users/me/Library/Developer/Xcode/DerivedData/Refrigerator-cogitanvthedtnflcnsyjazrxsuh/Build/Products/Debug-iphonesimulator/include -Xcc -I/Users/me/Library/Developer/Xcode/DerivedData/Refrigerator-cogitanvthedtnflcnsyjazrxsuh/Build/Intermediates.noindex/Refrigerator.build/Debug-iphonesimulator/Refrigerator.build/DerivedSources-normal/x86_64 -Xcc -I/Users/me/Library/Developer/Xcode/DerivedData/Refrigerator-cogitanvthedtnflcnsyjazrxsuh/Build/Intermediates.noindex/Refrigerator.build/Debug-iphonesimulator/Refrigerator.build/DerivedSources/x86_64 -Xcc -I/Users/me/Library/Developer/Xcode/DerivedData/Refrigerator-cogitanvthedtnflcnsyjazrxsuh/Build/Intermediates.noindex/Refrigerator.build/Debug-iphonesimulator/Refrigerator.build/DerivedSources -Xcc -DDEBUG=1 -emit-objc-header -emit-objc-header-path /Users/me/Library/Developer/Xcode/DerivedData/Refrigerator-cogitanvthedtnflcnsyjazrxsuh/Build/Intermediates.noindex/Refrigerator.build/Debug-iphonesimulator/Refrigerator.build/Objects-normal/x86_64/Refrigerator-Swift.h -import-objc-header /Users/me/Desktop/Refrigerator/Refrigerator/Refrigerator-Bridging-Header.h -pch-output-dir /Users/me/Library/Developer/Xcode/DerivedData/Refrigerator-cogitanvthedtnflcnsyjazrxsuh/Build/Intermediates.noindex/PrecompiledHeaders -working-directory /Users/me/Desktop/Refrigerator