SourceKit crashing and Xcode crippled when project uses a dynamic framework (Xcode 7 beta 3)

Has anyone else encountered continuous crashing of SourceKit (not the editor per se) on Xcode 7 beta 3 when working with a project that uses a dynamic framework? My particular problem is when I use the Realm framework (https://github.com/realm/realm-cocoa/tree/swift-2.0), but from what I gather after research, it sounds like a more general problem.


The crashes manifests as various symptoms including, but not limited to:

  • Syntax highlighting disabled.
  • Code completion disabled.
  • Quickhelp documentation disabled.
  • The 'Report a Problem' dropdown constantly appearing.
  • import <FrameworkName> is marked with an error - could not build Objective-C module XXX.
  • Debugging functionality is crippled - breakpoints work, but variables cannot be examined. (This is the dealbreaker).


SourceKit logs in console show an error like below:

Crashed Thread:        8


Exception Type:        EXC_CRASH (SIGABRT)
Exception Codes:       0x0000000000000000, 0x0000000000000000


Application Specific Information:
Assertion failed: ((!FileContext || issue != Status::Malformed) && "error deserializing an individual record"), function error, file /Library/Caches/com.apple.xbs/Sources/swiftlang/swiftlang-700.0.45/src/swift/include/swift/Serialization/ModuleFile.h, line 352.


Trying to examine a var while debugging results in something like:

(lldb) po self
warning: Swift error in module MyProject:
    Swift had fatal errors constructing the ast context for this module: missing required modules: 'Realm.Private', 'Realm'
Debug info from this module will be unavailable in the debugger.
warning: Swift error in module MyProjectShared:
    Swift had fatal errors constructing the ast context for this module: missing required modules: 'Realm.Private', 'Realm'
Debug info from this module will be unavailable in the debugger.
warning: Swift error in module RealmSwift:
    Swift had fatal errors constructing the ast context for this module: missing required modules: 'Realm.Private', 'Realm'
Debug info from this module will be unavailable in the debugger.
error: Error in auto-import:
failed to get module 'MyProject' from AST context

I'm seeing exactly the same thing in Xcode 7 Beta 5. In my project this usually happens when I am editing Swift source such as:


print("x = \(x.somefunc())")


The editor looses functionality pretty consistently as I type the "x.".

Everything compiles without issue but it is annoying to loose the code completion and keep having the window jerk up and down when the report problem appears.

I couldn't find any crash logs anywhere.

SourceKit crashing and Xcode crippled when project uses a dynamic framework (Xcode 7 beta 3)
 
 
Q