Crash when loading NSViewController view with NSArrayController
Crash when loading NSViewController view with NSArrayController
- Subject: Crash when loading NSViewController view with NSArrayController
- From: Markus Spoettl <email@hidden>
- Date: Sat, 29 Sep 2012 14:58:20 +0200
Hi,
I need help.
I'm still stuck with a crash a posted here a couple of weeks back and there is
some more information now but I'm still at a loss understanding what is going on.
The crash happens when calling [viewController loadView] during the nib decoding
process of an NSArrayController. The array controller in question is bound to a
read only array property of FileOwner and a number of controls are bound to the
array controller's "selection" proxy.
Not sure what the cause might be, I removed all bindings (array controller and
control values bindings) and retested. The crash still occurs. Then I removed
the NSArrayController from the nib and the crash was gone. I added back a new
NSArrayController to rule out the IB object was corrupt, it didn't have any
connections or bindings set up, the crash came back.
I then thought, since I don't understand what is going, I set up the
NSArrayController manually in the view controller, creating a new instance when
creating the view controller, and setting up bindings manually in the view
controller's -awakeFromNib.
To my surprise, the crash came back when I call
[arrayController bind:@"contentArray" toObject:self withKeyPath:@"activities"
options:options];
to bind the manually created arrayController to its content. The crash looks
very similar.
The crash is difficult to reproduce, it requires opening the window that
contains the view controller many times (20-50) in quick succession. It never
happens instantly when showing it the first time, but it's not deterministic
otherwise. The crash happens with all my different view controllers as soon as
they have an NSArrayController in their XIB. Other view controllers work fine.
I'm quoting 3 stack traces below, the first with NSArrayController and
connections/bindings, the second with a fresh NSArrayController without
connections/bindings, the third with a manually set up NSArrayController binding
in source.
I did a debugging session with guard scribble, edges and zombies, also tried
guard malloc, nothing turns up anything.
I hope someone can make sense of it, I sure can't. Thanks for any help!
Regards
Markus
----------------------------------------------------------------------------
Crash with existing NSArrayController, bound to array property, controls bound
to controller selection proxy
#0 0x00007fff8a9ff150 in objc_msgSend_vtable5 ()
#1 0x00007fff8a3d2648 in NSKeyValueNotifyObserver ()
#2 0x00007fff8a3cc7b3 in -[NSObject(NSKeyValueObservingPrivate)
_notifyObserversForKeyPath:change:] ()
#3 0x00007fff8b845ce3 in -[NSController _notifyObserversForKeyPath:change:] ()
#4 0x00007fff8bab056a in -[NSArrayController
didChangeValuesForArrangedKeys:objectKeys:indexKeys:] ()
#5 0x00007fff8baae491 in -[NSArrayController initWithCoder:] ()
#6 0x00007fff8a3c9797 in _decodeObjectBinary ()
#7 0x00007fff8a3c8ab2 in _decodeObject ()
#8 0x00007fff8b83ba6f in -[NSNibConnector initWithCoder:] ()
#9 0x00007fff8b8434c4 in -[NSNibOutletConnector initWithCoder:] ()
#10 0x00007fff8a3c9797 in _decodeObjectBinary ()
#11 0x00007fff8a3ca976 in -[NSKeyedUnarchiver _decodeArrayOfObjectsForKey:] ()
#12 0x00007fff8a3a145c in -[NSArray(NSArray) initWithCoder:] ()
#13 0x00007fff8a3c9797 in _decodeObjectBinary ()
#14 0x00007fff8a3c8ab2 in _decodeObject ()
#15 0x00007fff8b83a8aa in -[NSIBObjectData initWithCoder:] ()
#16 0x00007fff8a3c9797 in _decodeObjectBinary ()
#17 0x00007fff8a3c8ab2 in _decodeObject ()
#18 0x00007fff8b9634bc in -[NSNib instantiateNibWithExternalNameTable:] ()
#19 0x00007fff8b963288 in -[NSNib instantiateNibWithOwner:topLevelObjects:] ()
#20 0x00007fff8b9627cf in -[NSViewController loadView] ()
#21 0x00007fff8b95e4ae in -[NSViewController view] ()
#22 0x00000001002a304f in -[SOShapeWindowController orderFrontWindow] at
/Users/markus/Projects/rubiTrack/../SOFramework/controls/SOShapeWindowController.m:298
#23 0x00000001000102d8 in -[RubiWindowController
showAuxiliaryWindowWithController:activity:invokedBySelector:] at
/Users/markus/Projects/rubiTrack/src/RubiWindowController.m:1074
#24 0x0000000100010918 in -[RubiWindowController showCurrentActivityOptions:] at
/Users/markus/Projects/rubiTrack/src/RubiWindowController.m:1164
#25 0x0000000100010a6e in -[RubiWindowController editCurrentActivityType:] at
/Users/markus/Projects/rubiTrack/src/RubiWindowController.m:1191
#26 0x00007fff8053770d in -[NSObject performSelector:withObject:] ()
#27 0x00007fff8b934f7e in -[NSApplication sendAction:to:from:] ()
#28 0x000000010005926a in -[ActivityCollectionViewController
collectionItemController:didPressButton:] at
/Users/markus/Projects/rubiTrack/src/ActivityCollectionViewController.m:610
#29 0x000000010020ae29 in -[CollectionItemController
sendButtonPressMessageWithEvent:button:contextRect:] at
/Users/markus/Projects/rubiTrack/src/CollectionItemController.m:646
#30 0x000000010020ba96 in -[CollectionItemController mouseUp:atLocation:] at
/Users/markus/Projects/rubiTrack/src/CollectionItemController.m:817
#31 0x0000000100058fbe in -[ActivityCollectionViewController
collectionView:mouseUp:atLocation:ofItem:withIndex:inLayer:isSelected:] at
/Users/markus/Projects/rubiTrack/src/ActivityCollectionViewController.m:578
#32 0x0000000100205d63 in -[SOCollectionView mouseUp:] at
/Users/markus/Projects/rubiTrack/../SOFramework/collection/SOCollectionView.m:1886
#33 0x00007fff8b8fe40e in -[NSWindow sendEvent:] ()
#34 0x00007fff8b897a55 in -[NSApplication sendEvent:] ()
#35 0x00007fff8b82e0c6 in -[NSApplication run] ()
#36 0x00007fff8baaa244 in NSApplicationMain ()
#37 0x000000010000a992 in main at /Users/markus/Projects/rubiTrack/src/main.m:22
#38 0x0000000100001614 in start ()
----------------------------------------------------------------------------
Crash with new NSArrayController, no connections, no bindings
#0 0x00007fff8a9ff150 in objc_msgSend_vtable5 ()
#1 0x00007fff8a3d2648 in NSKeyValueNotifyObserver ()
#2 0x00007fff8a3cc7b3 in -[NSObject(NSKeyValueObservingPrivate)
_notifyObserversForKeyPath:change:] ()
#3 0x00007fff8b845ce3 in -[NSController _notifyObserversForKeyPath:change:] ()
#4 0x00007fff8bab056a in -[NSArrayController
didChangeValuesForArrangedKeys:objectKeys:indexKeys:] ()
#5 0x00007fff8baae491 in -[NSArrayController initWithCoder:] ()
#6 0x00007fff8a3c9797 in _decodeObjectBinary ()
#7 0x00007fff8a3ca976 in -[NSKeyedUnarchiver _decodeArrayOfObjectsForKey:] ()
#8 0x00007fff8a3a145c in -[NSArray(NSArray) initWithCoder:] ()
#9 0x00007fff8a3c9797 in _decodeObjectBinary ()
#10 0x00007fff8a3c8ab2 in _decodeObject ()
#11 0x00007fff8b83a8dc in -[NSIBObjectData initWithCoder:] ()
#12 0x00007fff8a3c9797 in _decodeObjectBinary ()
#13 0x00007fff8a3c8ab2 in _decodeObject ()
#14 0x00007fff8b9634bc in -[NSNib instantiateNibWithExternalNameTable:] ()
#15 0x00007fff8b963288 in -[NSNib instantiateNibWithOwner:topLevelObjects:] ()
#16 0x00007fff8b9627cf in -[NSViewController loadView] ()
#17 0x00007fff8b95e4ae in -[NSViewController view] ()
#18 0x00000001002a3b4f in -[SOShapeWindowController orderFrontWindow] at
/Users/markus/Projects/rubiTrack/../SOFramework/controls/SOShapeWindowController.m:298
#19 0x0000000100010dd8 in -[RubiWindowController
showAuxiliaryWindowWithController:activity:invokedBySelector:] at
/Users/markus/Projects/rubiTrack/src/RubiWindowController.m:1074
#20 0x0000000100011418 in -[RubiWindowController showCurrentActivityOptions:] at
/Users/markus/Projects/rubiTrack/src/RubiWindowController.m:1164
#21 0x000000010001156e in -[RubiWindowController editCurrentActivityType:] at
/Users/markus/Projects/rubiTrack/src/RubiWindowController.m:1191
#22 0x00007fff8053770d in -[NSObject performSelector:withObject:] ()
#23 0x00007fff8b934f7e in -[NSApplication sendAction:to:from:] ()
#24 0x0000000100059d6a in -[ActivityCollectionViewController
collectionItemController:didPressButton:] at
/Users/markus/Projects/rubiTrack/src/ActivityCollectionViewController.m:610
#25 0x000000010020b929 in -[CollectionItemController
sendButtonPressMessageWithEvent:button:contextRect:] at
/Users/markus/Projects/rubiTrack/src/CollectionItemController.m:646
#26 0x000000010020c596 in -[CollectionItemController mouseUp:atLocation:] at
/Users/markus/Projects/rubiTrack/src/CollectionItemController.m:817
#27 0x0000000100059abe in -[ActivityCollectionViewController
collectionView:mouseUp:atLocation:ofItem:withIndex:inLayer:isSelected:] at
/Users/markus/Projects/rubiTrack/src/ActivityCollectionViewController.m:578
#28 0x0000000100206863 in -[SOCollectionView mouseUp:] at
/Users/markus/Projects/rubiTrack/../SOFramework/collection/SOCollectionView.m:1886
#29 0x00007fff8b8fe40e in -[NSWindow sendEvent:] ()
#30 0x00007fff8b897a55 in -[NSApplication sendEvent:] ()
#31 0x00007fff8b82e0c6 in -[NSApplication run] ()
#32 0x00007fff8baaa244 in NSApplicationMain ()
#33 0x000000010000b492 in main at /Users/markus/Projects/rubiTrack/src/main.m:22
#34 0x0000000100002114 in start ()
----------------------------------------------------------------------------
Crash when calling -bind::: in a manually created NSArrayController (stack from #8)
#0 0x00007fff8a9ff150 in objc_msgSend_vtable5 ()
#1 0x00007fff8a3d2648 in NSKeyValueNotifyObserver ()
#2 0x00007fff8a3cc7b3 in -[NSObject(NSKeyValueObservingPrivate)
_notifyObserversForKeyPath:change:] ()
#3 0x00007fff8b845ce3 in -[NSController _notifyObserversForKeyPath:change:] ()
#4 0x00007fff8bab056a in -[NSArrayController
didChangeValuesForArrangedKeys:objectKeys:indexKeys:] ()
#5 0x00007fff8bab1f51 in -[NSArrayController setContent:] ()
#6 0x00007fff8bab19e4 in -[NSArrayDetailBinder
_refreshDetailContentInBackground:] ()
#7 0x00007fff8b84a643 in -[NSObject(NSKeyValueBindingCreation)
bind:toObject:withKeyPath:options:] ()
#8 0x00000001002d490d in -[ActivityOptionsViewController awakeFromNib] at
/Users/markus/Projects/rubiTrack/src/ActivityOptionsWindowController.m:71
#9 0x00007fff8b843a41 in -[NSIBObjectData
nibInstantiateWithOwner:topLevelObjects:] ()
#10 0x00007fff8b96351b in -[NSNib instantiateNibWithExternalNameTable:] ()
#11 0x00007fff8b963288 in -[NSNib instantiateNibWithOwner:topLevelObjects:] ()
#12 0x00007fff8b9627cf in -[NSViewController loadView] ()
#13 0x00007fff8b95e4ae in -[NSViewController view] ()
#14 0x00000001002a398f in -[SOShapeWindowController orderFrontWindow] at
/Users/markus/Projects/rubiTrack/../SOFramework/controls/SOShapeWindowController.m:298
#15 0x0000000100010c18 in -[RubiWindowController
showAuxiliaryWindowWithController:activity:invokedBySelector:] at
/Users/markus/Projects/rubiTrack/src/RubiWindowController.m:1074
#16 0x0000000100011258 in -[RubiWindowController showCurrentActivityOptions:] at
/Users/markus/Projects/rubiTrack/src/RubiWindowController.m:1164
#17 0x00000001000113ae in -[RubiWindowController editCurrentActivityType:] at
/Users/markus/Projects/rubiTrack/src/RubiWindowController.m:1191
#18 0x00007fff8053770d in -[NSObject performSelector:withObject:] ()
#19 0x00007fff8b934f7e in -[NSApplication sendAction:to:from:] ()
#20 0x0000000100059baa in -[ActivityCollectionViewController
collectionItemController:didPressButton:] at
/Users/markus/Projects/rubiTrack/src/ActivityCollectionViewController.m:610
#21 0x000000010020b769 in -[CollectionItemController
sendButtonPressMessageWithEvent:button:contextRect:] at
/Users/markus/Projects/rubiTrack/src/CollectionItemController.m:646
#22 0x000000010020c3d6 in -[CollectionItemController mouseUp:atLocation:] at
/Users/markus/Projects/rubiTrack/src/CollectionItemController.m:817
#23 0x00000001000598fe in -[ActivityCollectionViewController
collectionView:mouseUp:atLocation:ofItem:withIndex:inLayer:isSelected:] at
/Users/markus/Projects/rubiTrack/src/ActivityCollectionViewController.m:578
#24 0x00000001002066a3 in -[SOCollectionView mouseUp:] at
/Users/markus/Projects/rubiTrack/../SOFramework/collection/SOCollectionView.m:1886
#25 0x00007fff8b8fe40e in -[NSWindow sendEvent:] ()
#26 0x00007fff8b897a55 in -[NSApplication sendEvent:] ()
#27 0x00007fff8b82e0c6 in -[NSApplication run] ()
#28 0x00007fff8baaa244 in NSApplicationMain ()
#29 0x000000010000b2d2 in main at /Users/markus/Projects/rubiTrack/src/main.m:22
#30 0x0000000100001f54 in start ()
--
__________________________________________
Markus Spoettl
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden