Xcode8 - application crashes in insane spot. Magically works after clearing build folder

Originator:markd
Number:rdar://27142991 Date Originated:7/1/2016
Status:Open Resolved:
Product:Developer Tools Product Version:Version 8.0 beta (8S128d)
Classification:Crash/Hang/Data Loss Reproducible:Sometimes
 
Summary:
Xcode seems to frequently pollute the build folder, leading to weird behavior, and lost time debugging, when cleaning the build folder makes the app work correctly.

Attached is a movie showing what I've seen fairly often in Xcode 7, and now in Xcode 8 - application behaves very strangely .  Given my litany of blame, I blame myself first before the tools.  I burn some time trying to debug.

I then clean the build folder, and stuff magically works again.

Steps to Reproduce:
1. Program normally



Expected Results:
2. program builds normally. Program stays in a stable state

Actual Results:
3. Get a weird crash
4. Debug said weird crash for awhile
5. Doubt your sanity
6. Perhaps bring in other people and burn their time
7. Decide to purge the build folder
8. Things magically work.

Version:
Version 8.0 beta (8S128d)
10.11.4 (15E65)


Notes:
It's really not that big a deal - just purge your build folder all the time, but
when it happens day-in, day-out, it's just another heavy-sigh
death-of-a-thousand-cuts that makes using Xcode unpleasant.


Configuration:
Happened all the time in Xcode 7.

Attachments:
'ClassMaker.zip' and 'dead-chicken.mp4' were successfully uploaded.

Comments

Happened again: https://vimeo.com/173203208

video: https://vimeo.com/173119504


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!