Strange crashing bug
Strange crashing bug
- Subject: Strange crashing bug
- From: John Timmer <email@hidden>
- Date: Thu, 19 May 2005 13:29:49 -0400
Title: Strange crashing bug
I'm running into a bug that's preventing me from let users beta testing my app. I've filed it with Apple, but it's still open, and I'm hoping to get ideas for a workaround so I can get this into the hands of testers.
I'm working on a Core Data application for tracking animals. Each animal has a mother and father relationship, which may be another animal, or may be nil, if they were received via a shipment. Each animal also has a name value.
I've got a table view that shows all the animals, and includes columns for mother.name and father.name. If those values are nil, it inserts "undefined".
This works for display, and for some amount of sorting. If there's enough animals, however, sorting a few times on any of the fields crashes the app with stack trace 1 below. Deleting the mother.name and father.name columns allows unlimited resorting without crashes.
I thought it had something to do with coping with the nil values, so I created a single “nilAnimal” object for each managed object context. If the mother or father key is called for and is nil, the nilValue object is retrieved and returned; this has “undefined” set for its name value. Using this setup, whenever I try to load a saved file, the application crashes with stack trace 2 below.
None of these stack traces actually involve my code (they all seem to involve the table view bindings), and I can’t think of any other way of working around this. I could let people test it having removed the father and mother columns, but that will significantly limit its features. I could also eliminate sorting, but that would also be a significant limitation. Does anyone else have any suggestions for a work around?
Thanks,
John
Stack trace 1:
#0 0xfffeff20 in objc_msgSend_rtp
#1 0x929337e8 in _NSKeyValueObservationInfoGetForwarderForObserver
#2 0x929022a8 in -[NSObject(NSKeyValueObserverRegistration) removeObserver:forKeyPath:]
#3 0x93871474 in -[_NSModelObservingTracker _registerOrUnregister:observerNotificationsForModelObject:]
#4 0x93868ef4 in -[_NSModelObservingTracker clearAllModelObjectObserving]
#5 0x93868da0 in -[_NSModelObservingTracker setIndexReferenceModelObjectArray:clearAllModelObjectObserving:]
#6 0x9386b098 in -[NSTableBinder _updateContent]
#7 0x9386af1c in -[NSTableBinder _observeValueForKeyPath:ofObject:context:]
#8 0x9386ad00 in -[NSTableBinder observeValueForKeyPath:ofObject:change:context:]
#9 0x92902ca4 in -[NSObject(NSKeyValueObservingPrivate) _notifyObserversForKeyPath:change:]
#10 0x9386ed44 in -[NSController _notifyObserversForKeyPath:change:]
#11 0x9386eb5c in -[NSArrayController didChangeValuesForArrangedKeys:objectKeys:indexKeys:]
#12 0x93870a08 in -[NSArrayController setSortDescriptors:]
#13 0x92905690 in -[NSObject(NSKeyValueCoding) setValue:forKeyPath:]
#14 0x93870684 in -[NSBinder _setValue:forKeyPath:ofObject:mode:validateImmediately:raisesForNotApplicableKeys:error:]
#15 0x9387050c in -[NSBinder setValue:forBinding:error:]
#16 0x938703c0 in -[NSTableBinder tableView:didChangeToSortDescriptors:]
#17 0x93870304 in -[_NSBindingAdaptor tableView:didChangeToSortDescriptors:]
#18 0x937a7720 in -[NSTableView setSortDescriptors:]
#19 0x93a0cd60 in -[NSTableView _changeSortDescriptorsForClickOnColumn:]
#20 0x93a04540 in -[NSTableHeaderView _doModifySelectionWithEvent:onColumn:]
#21 0x93a04a60 in -[NSTableHeaderView _trackAndModifySelectionWithEvent:onColumn:stopOnReorderGesture:]
#22 0x93a06448 in -[NSTableHeaderView mouseDown:]
#23 0x93678d28 in -[NSWindow sendEvent:]
#24 0x93621f5c in -[NSApplication sendEvent:]
#25 0x936193f0 in -[NSApplication run]
#26 0x93709c1c in NSApplicationMain
#27 0x0000bcb8 in main at main.m:13
Stack trace 2:
#0 0x9072cf24 in CFRetain
#1 0x929026c0 in _NSKeyValueObservationInfoCreateByRemoving
#2 0x92902498 in -[NSObject(NSKeyValueObserverRegistration) _removeObserver:forProperty:]
#3 0x92902388 in -[NSObject(NSKeyValueObserverRegistration) removeObserver:forKeyPath:]
#4 0x929022d8 in -[NSObject(NSKeyValueObserverRegistration) removeObserver:forKeyPath:]
#5 0x93871474 in -[_NSModelObservingTracker _registerOrUnregister:observerNotificationsForModelObject:]
#6 0x93868ef4 in -[_NSModelObservingTracker clearAllModelObjectObserving]
#7 0x93868da0 in -[_NSModelObservingTracker setIndexReferenceModelObjectArray:clearAllModelObjectObserving:]
#8 0x9386b098 in -[NSTableBinder _updateContent]
#9 0x9386af1c in -[NSTableBinder _observeValueForKeyPath:ofObject:context:]
#10 0x9386ad00 in -[NSTableBinder observeValueForKeyPath:ofObject:change:context:]
#11 0x92902ca4 in -[NSObject(NSKeyValueObservingPrivate) _notifyObserversForKeyPath:change:]
#12 0x9386ed44 in -[NSController _notifyObserversForKeyPath:change:]
#13 0x9386eb5c in -[NSArrayController didChangeValuesForArrangedKeys:objectKeys:indexKeys:]
#14 0x93870a08 in -[NSArrayController setSortDescriptors:]
#15 0x93b4cbec in -[NSControllerConfigurationBinder _updateSortDescriptors:]
#16 0x93b4d0b0 in -[NSControllerConfigurationBinder _observeValueForKeyPath:ofObject:context:]
#17 0x92902ca4 in -[NSObject(NSKeyValueObservingPrivate) _notifyObserversForKeyPath:change:]
#18 0x9386ed44 in -[NSController _notifyObserversForKeyPath:change:]
#19 0x93af79e0 in -[NSObjectController setContent:]
#20 0x93af9268 in -[NSObjectController(NSManagedController) _performFetchWithRequest:merge:error:]
#21 0x93af9344 in -[NSObjectController(NSManagedController) fetchWithRequest:merge:error:]
#22 0x93af93d0 in -[NSObjectController(NSManagedController) _executeFetch:didCommitSuccessfully:actionSender:]
#23 0x909b1214 in objc_msgSendv
#24 0x92877da8 in -[NSInvocation invoke]
#25 0x92878358 in -[NSInvocation invokeWithTarget:]
#26 0x93ad3844 in _NSSendCommitEditingSelector
#27 0x93af6d5c in -[NSController _controllerEditor:didCommit:contextInfo:]
#28 0x909b1214 in objc_msgSendv
#29 0x92877da8 in -[NSInvocation invoke]
#30 0x92878358 in -[NSInvocation invokeWithTarget:]
#31 0x92886d18 in __NSFireDelayedPerform
#32 0x9075deb0 in __CFRunLoopDoTimer
#33 0x9074a828 in __CFRunLoopRun
#34 0x90749ddc in CFRunLoopRunSpecific
#35 0x93122ca0 in RunCurrentEventLoopInMode
#36 0x93122334 in ReceiveNextEventCommon
#37 0x931221a0 in BlockUntilNextEventMatchingListInMode
#38 0x9361d1a4 in _DPSNextEvent
#39 0x9361ce68 in -[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:]
#40 0x936193cc in -[NSApplication run]
#41 0x93709c1c in NSApplicationMain
#42 0x0000bc58 in main at main.m:13
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden