Using swiftc's -driver-show-incremental flag causes Xcode to crash

Originator:keithbsmiley
Number:rdar://32833857 Date Originated:17-Jun-2017 11:13
Status:Duplicate of 30605969 (open) Resolved:
Product:Developer Tools Product Version:Xcode 9.0 beta 1 (9M136h)
Classification:Crash/Hang/Data Loss Reproducible:Sometimes
 
Summary:
If you're interested in debugging swift incremental compilation issues, one nice flag for the compiler you can use is `-driver-show-incremental`. When doing this in Xcode, Xcode occasionally crashes.

Steps to Reproduce:
1. Create a new Swift project
2. Add `-driver-show-incremental` to `OTHER_SWIFT_FLAGS`
3. Compile it a few times, changing things each time

Expected Results:
Xcode happily runs, and has extra log output.


Actual Results:
Xcode crashes with this stacktrace:

2017-02-19 08:43:13.041 xcodebuild[12733:349003]  DVTAssertions: ASSERTION FAILURE in /Library/Caches/com.apple.xbs/Sources/IDELanguageSupport/IDELanguageSupport-11752/XCLanguageSupport/XCSwiftCommandOutputParser.m:230
Details:  (subcommand) should not be nil.
Object:   <XCSwiftCommandOutputParser: 0x7fb03681d380>
Method:   -handleCommandExitedMessage:didSignal:error:
Thread:   <NSThread: 0x7fb036c0ae50>{number = 2, name = (null)}
Hints: None
Backtrace:
  0   -[DVTAssertionHandler handleFailureInMethod:object:fileName:lineNumber:assertionSignature:messageFormat:arguments:] (in DVTFoundation)
  1   _DVTAssertionHandler (in DVTFoundation)
  2   _DVTAssertionFailureHandler (in DVTFoundation)
  3   -[XCSwiftCommandOutputParser handleCommandExitedMessage:didSignal:error:] (in XCLanguageSupport)
  4   -[XCSwiftCommandOutputParser handleMessage:error:] (in XCLanguageSupport)
  5   -[XCSwiftCommandOutputParser writeBytes:length:] (in XCLanguageSupport)
  6   -[XCLineBufferedOutputStream writeBytes:length:] (in DevToolsCore)
  7   -[XCWorkQueueCommandSubprocessInvocation handleOutputBytes:length:] (in DevToolsCore)
  8   -[XCWorkQueueCommandLocalSubprocessInvocation handleOutputFileDescriptorActivity] (in DevToolsCore)
  9   -[Xcode3BuildTask main] (in DevToolsCore)
 10   -[__NSOperationInternal _start:] (in Foundation)
 11   __NSOQSchedule_f (in Foundation)
 12   _dispatch_client_callout (in libdispatch.dylib)
 13   _dispatch_queue_serial_drain (in libdispatch.dylib)
 14   _dispatch_queue_invoke (in libdispatch.dylib)
 15   _dispatch_root_queue_drain (in libdispatch.dylib)
 16   _dispatch_worker_thread3 (in libdispatch.dylib)
 17   _pthread_wqthread (in libsystem_pthread.dylib)
 18   start_wqthread (in libsystem_pthread.dylib)

Version:
Xcode 9.0 beta 1 (9M136h)

Notes:
See https://bugs.swift.org/browse/SR-4001 for more details

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!