[SourceKit] SourceKit crashes immediatelly after opening attached project

Originator:hello
Number:rdar://24350386 Date Originated:26-Jan-2016
Status:Open Resolved:
Product:Xcode Product Version:7.2 and 7.3 beta
Classification: Reproducible:Always
 
Summary:
- For the last several Xcode releases, it’s been impossible to develop on the attached project without SourceKit immediately crashing.

Steps to Reproduce:
- Unzip attached file.
- Open `ReactiveCocoa.xcworkspace`.
- Select `ReactiveCocoa-iOS` scheme.
- Open `SignalProducer.swift`

Expected Results:
- You can easily edit the file with syntax highlighting and autocompletion.

Actual Results:
- SourceKit crashes right away:

Thread 5 Crashed:
0   com.apple.SourceKitService    	0x0000000107614b7f (anonymous namespace)::ExprWalker::walkToExprPre(swift::Expr*) + 575
1   com.apple.SourceKitService    	0x000000010776abda swift::Expr::walk(swift::ASTWalker&) + 26
2   com.apple.SourceKitService    	0x000000010760e9a9 swift::constraints::ConstraintSystem::applySolution(swift::constraints::Solution&, swift::Expr*, swift::Type, bool, bool, bool) + 473
3   com.apple.SourceKitService    	0x0000000107693b2e swift::TypeChecker::typeCheckExpression(swift::Expr*&, swift::DeclContext*, swift::Type, swift::ContextualTypePurpose, swift::OptionSet<swift::TypeCheckExprFlags, unsigned int>, swift::ExprTypeCheckListener*) + 782
4   com.apple.SourceKitService    	0x000000010762da9a (anonymous namespace)::FailureDiagnosis::typeCheckChildIndependently(swift::Expr*, swift::Type, swift::ContextualTypePurpose, swift::OptionSet<TCCFlags, unsigned int>, swift::ExprTypeCheckListener*) + 1002
5   com.apple.SourceKitService    	0x0000000107632656 (anonymous namespace)::FailureDiagnosis::visitApplyExpr(swift::ApplyExpr*) + 1318
6   com.apple.SourceKitService    	0x0000000107629488 swift::ASTVisitor<(anonymous namespace)::FailureDiagnosis, bool, void, void, void, void, void>::visit(swift::Expr*) + 264
7   com.apple.SourceKitService    	0x0000000107624ae2 swift::constraints::ConstraintSystem::diagnoseFailureForExpr(swift::Expr*) + 82
8   com.apple.SourceKitService    	0x0000000107628f82 swift::constraints::ConstraintSystem::salvage(llvm::SmallVectorImpl<swift::constraints::Solution>&, swift::Expr*) + 4194
9   com.apple.SourceKitService    	0x000000010768e1b0 swift::TypeChecker::solveForExpression(swift::Expr*&, swift::DeclContext*, swift::Type, swift::FreeTypeVariableBinding, swift::ExprTypeCheckListener*, swift::constraints::ConstraintSystem&, llvm::SmallVectorImpl<swift::constraints::Solution>&, swift::OptionSet<swift::TypeCheckExprFlags, unsigned int>) + 736
10  com.apple.SourceKitService    	0x0000000107693a42 swift::TypeChecker::typeCheckExpression(swift::Expr*&, swift::DeclContext*, swift::Type, swift::ContextualTypePurpose, swift::OptionSet<swift::TypeCheckExprFlags, unsigned int>, swift::ExprTypeCheckListener*) + 546
11  com.apple.SourceKitService    	0x000000010762da9a (anonymous namespace)::FailureDiagnosis::typeCheckChildIndependently(swift::Expr*, swift::Type, swift::ContextualTypePurpose, swift::OptionSet<TCCFlags, unsigned int>, swift::ExprTypeCheckListener*) + 1002
12  com.apple.SourceKitService    	0x0000000107624b28 swift::constraints::ConstraintSystem::diagnoseFailureForExpr(swift::Expr*) + 152
13  com.apple.SourceKitService    	0x0000000107628f82 swift::constraints::ConstraintSystem::salvage(llvm::SmallVectorImpl<swift::constraints::Solution>&, swift::Expr*) + 4194
14  com.apple.SourceKitService    	0x000000010768e1b0 swift::TypeChecker::solveForExpression(swift::Expr*&, swift::DeclContext*, swift::Type, swift::FreeTypeVariableBinding, swift::ExprTypeCheckListener*, swift::constraints::ConstraintSystem&, llvm::SmallVectorImpl<swift::constraints::Solution>&, swift::OptionSet<swift::TypeCheckExprFlags, unsigned int>) + 736
15  com.apple.SourceKitService    	0x0000000107693a42 swift::TypeChecker::typeCheckExpression(swift::Expr*&, swift::DeclContext*, swift::Type, swift::ContextualTypePurpose, swift::OptionSet<swift::TypeCheckExprFlags, unsigned int>, swift::ExprTypeCheckListener*) + 546
16  com.apple.SourceKitService    	0x00000001076e5deb swift::ASTVisitor<(anonymous namespace)::StmtChecker, void, swift::Stmt*, void, void, void, void>::visit(swift::Stmt*) + 4411
17  com.apple.SourceKitService    	0x00000001076e4dbb swift::ASTVisitor<(anonymous namespace)::StmtChecker, void, swift::Stmt*, void, void, void, void>::visit(swift::Stmt*) + 267
18  com.apple.SourceKitService    	0x00000001076e3a3b swift::TypeChecker::typeCheckFunctionBodyUntil(swift::FuncDecl*, swift::SourceLoc) + 347
19  com.apple.SourceKitService    	0x00000001076e42ea swift::TypeChecker::typeCheckAbstractFunctionBody(swift::AbstractFunctionDecl*) + 186
20  com.apple.SourceKitService    	0x000000010767cd86 typeCheckFunctionsAndExternalDecls(swift::TypeChecker&) + 182
21  com.apple.SourceKitService    	0x000000010767d9e5 swift::performTypeChecking(swift::SourceFile&, swift::TopLevelContext&, swift::OptionSet<swift::TypeCheckingFlags, unsigned int>, unsigned int) + 1781
22  com.apple.SourceKitService    	0x00000001072a10c2 swift::CompilerInstance::performSema() + 4738
23  com.apple.SourceKitService    	0x000000010716663e void SourceKit::WorkQueue::DispatchData::callAndDelete<(anonymous namespace)::ASTProducer::getASTUnitAsync(SourceKit::SwiftASTManager::Implementation&, llvm::ArrayRef<llvm::IntrusiveRefCntPtr<SourceKit::ImmutableTextSnapshot> >, std::__1::function<void (llvm::IntrusiveRefCntPtr<SourceKit::ASTUnit>, llvm::StringRef)>)::$_2>(void*) + 5806
24  libdispatch.dylib             	0x00007fff915bf33f _dispatch_client_callout + 8
25  libdispatch.dylib             	0x00007fff915cd03a _dispatch_block_invoke + 474
26  com.apple.SourceKitService    	0x00000001089acbbf executeBlock(void*) + 15
27  com.apple.SourceKitService    	0x000000010723b58d ExecuteOnThread_Dispatch(void*) + 13
28  libsystem_pthread.dylib       	0x00007fff98f84c13 _pthread_body + 131
29  libsystem_pthread.dylib       	0x00007fff98f84b90 _pthread_start + 168
30  libsystem_pthread.dylib       	0x00007fff98f82375 thread_start + 13


Regression:
This has been happening at least since Xcode 7.2, although SourceKit has never really been stable.

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!