Refencing an object weakly during dealloc leads to a runtime trap/crash.

Originator:steipete
Number:rdar://19029811 Date Originated:19-Nov-2014 02:45 PM
Status:Open Resolved:
Product:iOS Product Version:iOS 8.1.1
Classification:Crash/Hang/Data Loss Reproducible:Always
 
Summary:
Referencing an object weakly during dealloc leads to a runtime trap/crash. 

Steps to Reproduce:
Run the provided, super small example, see it’s crashing.

Expected Results:
Weak should be the object or nil.

Actual Results:
Crash.

Regression:
Always crashed.

Notes:
From http://opensource.apple.com/source/objc4/objc4-646/runtime/objc-weak.mm i see that this was a conscious decision, but it’s still a source of hard-to-debug bugs and something that is quite unexpected. weak should in that case be either the object or nil, but not cause an abort.

Comments

Example: http://cl.ly/2X3E431V360K


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!