A customer of my app sent me this strange crash report and I cannot figure out how this could ever crash. I cannot reproduce the problem myself, so am reliant on the crash report.
It crashes on the following very simple line of code:
UITextField *value = [[UITextField alloc] initWithFrame:frame];
The crash seems to be related to key-value-observing (KVO), but I am not doing anything with that here; it's a simply constructor!
The only possibility I could see, is that another thread is writing to a dealloc'ed object that happens to have the same memory address as an object that is created by the initWithFrame:
. But in the crash report, all other threads are quiet.
I have found other similar questions, but none of them have an answer.
Any ideas?
Here are the relevant parts from the crash report:
Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Subtype: KERN_INVALID_ADDRESS at 0x0000000000000010
Triggered by Thread: 0
Thread 0 name: Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0 libobjc.A.dylib 0x0000000181981b90 objc_msgSend + 16
1 Foundation 0x0000000182bf2454 -[NSObject(NSKeyValueObserverNotification) willChangeValueForKey:] + 324
2 QuartzCore 0x0000000184deb11c CA::Layer::set_delegate(objc_object*) + 72
3 UIKit 0x0000000187456f40 -[UIView _createLayerWithFrame:] + 580
4 UIKit 0x0000000187456a00 UIViewCommonInitWithFrame + 688
5 UIKit 0x00000001874566f0 -[UIView initWithFrame:] + 140
6 UIKit 0x000000018745dfb0 -[UILabel initWithFrame:] + 48
7 UIKit 0x0000000187542064 -[UITextField createTextLabelWithTextColor:] + 76
8 UIKit 0x0000000187541c30 -[UITextField initWithFrame:] + 416
9 Flyskyhy 0x00000001000e1f68 -[ElementView doInitWithUnit:] (ElementView.m:178)