Xcode Using Terminal Console will Deadlock and Hang

Originator:PaulSolt
Number:rdar://31862232 Date Originated:4/27/17
Status:Open Resolved:
Product:Xcode Product Version:8.3.2
Classification:Deadlock/Hang Reproducible:Sometimes
 
Summary: 

Xcode will deadlock if you switch the console output to use Terminal. This happens after a few code/build/run phases when I'm doing my unit tests, and it's a huge time waster.

In the video I uploaded it all happens within the first minute, but it can be hard to reproduce. I was unable to reproduce in the remainder of the video. There's some kind of deadlock potential and I'm not sure what. In the video you can see that no Terminal output appears for the failing test, instead Xcode has somehow got itself stuck.

The only workaround is to Force Quit Xcode.

Here is a sample unit test project using Google Mock that I did for fun, and it demonstrates the issue.

You can't stop the process with Terminal through Xcode. Closing the windows doesn't seem to help, maybe I have to force quit some Terminal process... not really sure.

Steps to Reproduce:
1. Switch from Console to Terminal in Schemes/Debug
2. Write unit test/code
3. Build and run
4. Repeat 2-100 times

Expected Results:
1. Code should compile and run
2. Output should be displayed

Actual Results:
1. Xcode deadlocks running the Terminal process
2. I cannot write new code
3. I have to Force Quit Xcode to get anything to respond


Version:
Xcode 8.3.2 Sierra 10.12.4


Notes:
Using Terminal for output is currently useless at this point. It's too buggy and deadlock prone to be productive.

Configuration:
MacBook Pro 2016

Attachments:
'Deadlock bug scheme setup Terminal.png', 'XcodeExternalTerminalDeadlock_GMock_UnitTest.mp4', 'sysdiagnose_2017.04.26_08-29-07-0400_57055.tar.gz' and 'SampleXcodeProject.zip' were successfully uploaded.

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!