Exception from pboxd when navigating to Computer" in an Open Panel

Originator:kelan
Number:rdar://12184178 Date Originated:2012-08-27
Status:Open Resolved:
Product:Mac OS X SDK Product Version:Mac OS X 10.7.4
Classification:Serious Bug Reproducible:Always
 
Summary:

In an Open Panel in a Sandboxed app, going to the "Computer" level (e.g. by
pressing cmd-shift-C) causes the pboxd process to throw an uncaught exception.


Steps to Reproduce:

1. In a Sandboxed app, create a new NSOpenPanel.
2. Set a delegate on the instance, using -[NSOpenPanel setDelegate:].
    * It doesn't matter if the delegate actually implements any delegate methods or not.
3. Run it as a sheet, using -[NSOpenPanel
   beginSheetModalForWindow:completionHandler:].
4. When the sheet is visible, press cmd-shift-C to navigate to the top level
   ("Computer").  Or use the popup menu button at the top of the panel to navigate
   to that level.


Expected Results:

It should navigate to that level.


Actual Results:

The pboxd process throws an uncaught exception, and logs it to the Console.  See
output below.


Regression:

This doesn't happen if the app isn't Sandboxed.


Notes:

This is especially frustrating when 'NSApplicationShowExceptions' is enabled
(for the NSGlobalDomain), because then the System tries to show the Exception
window, but since the Open Panel is running as a sheet, it gets stuck in a bad
modal state, where any click on the panel (e.g. to dismiss it) causes the alert
beep.  The only way to get out of this is to Force Quit the app.

I attached a demo project that displays this behavior.


Console Output (picking Computer from the popup menu):

    8/27/12 4:10:43.773 PM com.apple.security.pboxd: *** -[__NSPlaceholderArray initWithObjects:count:]: attempt to insert nil object from objects[0]
    8/27/12 4:10:43.773 PM com.apple.security.pboxd: 2012-08-27 16:10:43.772 com.apple.security.pboxd[72348:1707] *** -[__NSPlaceholderArray initWithObjects:count:]: attempt to insert nil object from objects[0]
    8/27/12 4:10:43.775 PM com.apple.security.pboxd: (
        0   CoreFoundation                      0x00007fff88f1ef56 __exceptionPreprocess + 198
        1   libobjc.A.dylib                     0x00007fff887dad5e objc_exception_throw + 43
        2   CoreFoundation                      0x00007fff88ec79f1 -[__NSPlaceholderArray initWithObjects:count:] + 113
        3   CoreFoundation                      0x00007fff88eee313 +[NSArray arrayWithObject:] + 51
        4   com.apple.security.pboxd            0x000000010ceaf9d5 com.apple.security.pboxd + 18901
        5   FinderKit                           0x00007fff8275985e -[FIFinderViewGutsController setTargetPath:withViewStyle:] + 650
        6   FinderKit                           0x00007fff82758dca -[FIFinderViewGutsController setTargetNode:] + 527
        7   FinderKit                           0x00007fff8275d9e9 -[FIFinderViewGutsController finderLocationPopUp:didChangeToDirectoryURL:] + 91
        8   FinderKit                           0x00007fff82780b3e -[FILocationPopUp setTargetNode:] + 207
        9   FinderKit                           0x00007fff82780cb3 -[FILocationPopUp retargetFromMenuItem:] + 82
        10  CoreFoundation                      0x00007fff88f0e70d -[NSObject performSelector:withObject:] + 61
        11  AppKit                              0x00007fff8149ff7e -[NSApplication sendAction:to:from:] + 139
        12  AppKit                              0x00007fff8158cbfb -[NSMenuItem _corePerformAction] + 399
        13  AppKit                              0x00007fff8158c932 -[NSCarbonMenuImpl performActionWithHighlightingForItemAtIndex:] + 125
        14  AppKit                              0x00007fff8182bdd4 -[NSMenu _internalPerformActionForItemAtIndex:] + 38
        15  AppKit                              0x00007fff816baa91 -[NSCarbonMenuImpl _carbonCommandProcessEvent:handlerCallRef:] + 138
        16  AppKit                              0x00007fff81506e0b NSSLMMenuEventHandler + 339
        17  HIToolbox                           0x00007fff83268448 _ZL23DispatchEventToHandlersP14EventTargetRecP14OpaqueEventRefP14HandlerCallRec + 1263
        18  HIToolbox                           0x00007fff83267a54 _ZL30SendEventToEventTargetInternalP14OpaqueEventRefP20OpaqueEventTargetRefP14HandlerCallRec + 446
        19  HIToolbox                           0x00007fff8327e8f3 SendEventToEventTarget + 76
        20  HIToolbox                           0x00007fff832c499d _ZL18SendHICommandEventjPK9HICommandjjhPKvP20OpaqueEventTargetRefS5_PP14OpaqueEventRef + 398
        21  HIToolbox                           0x00007fff833ac035 SendMenuCommandWithContextAndModifiers + 56
        22  HIToolbox                           0x00007fff833f37a9 SendMenuItemSelectedEvent + 253
        23  HIToolbox                           0x00007fff832bda6b _ZL19FinishMenuSelectionP13SelectionDataP10MenuResultS2_ + 101
        24  HIToolbox                           0x00007fff833ec1e1 _ZL19PopUpMenuSelectCoreP8MenuData5PointdS1_tjPK4RecttjS4_S4_PK10__CFStringPP13OpaqueMenuRefPt + 1660
        25  HIToolbox                           0x00007fff833ec4a0 _HandlePopUpMenuSelection7 + 621
        26  AppKit                              0x00007fff816bd75d _NSSLMPopUpCarbonMenu3 + 3860
        27  AppKit                              0x00007fff81a6b41e _NSPopUpCarbonMenu3 + 39
        28  AppKit                              0x00007fff816bb8c2 -[NSCarbonMenuImpl popUpMenu:atLocation:width:forView:withSelectedItem:withFont:withFlags:withOptions:] + 322
        29  AppKit                              0x00007fff8189c4bd -[NSPopUpButtonCell trackMouse:inRect:ofView:untilMouseUp:] + 564
        30  AppKit                              0x00007fff8149deaa -[NSControl mouseDown:] + 786
        31  AppKit                              0x00007fff81469348 -[NSWindow sendEvent:] + 6306
        32  AppKit                              0x00007fff81402a55 -[NSApplication sendEvent:] + 5593
        33  com.apple.security.pboxd            0x000000010ceb16a3 com.apple.security.pboxd + 26275
        34  AppKit                              0x00007fff813990c6 -[NSApplication run] + 555
        35  com.apple.security.pboxd            0x000000010ceada35 com.apple.security.pboxd + 10805
        36  com.apple.security.pboxd            0x000000010ceac3e4 com.apple.security.pboxd + 5092
    )


Console output (pressing cmd-shift-C):

    8/27/12 4:12:06.016 PM com.apple.security.pboxd: *** -[__NSPlaceholderArray initWithObjects:count:]: attempt to insert nil object from objects[0]
    8/27/12 4:12:06.016 PM com.apple.security.pboxd: 2012-08-27 16:12:06.015 com.apple.security.pboxd[72348:1707] *** -[__NSPlaceholderArray initWithObjects:count:]: attempt to insert nil object from objects[0]
    8/27/12 4:12:06.017 PM com.apple.security.pboxd: (
        0   CoreFoundation                      0x00007fff88f1ef56 __exceptionPreprocess + 198
        1   libobjc.A.dylib                     0x00007fff887dad5e objc_exception_throw + 43
        2   CoreFoundation                      0x00007fff88ec79f1 -[__NSPlaceholderArray initWithObjects:count:] + 113
        3   CoreFoundation                      0x00007fff88eee313 +[NSArray arrayWithObject:] + 51
        4   com.apple.security.pboxd            0x000000010ceaf9d5 com.apple.security.pboxd + 18901
        5   FinderKit                           0x00007fff8275985e -[FIFinderViewGutsController setTargetPath:withViewStyle:] + 650
        6   FinderKit                           0x00007fff82758dca -[FIFinderViewGutsController setTargetNode:] + 527
        7   FinderKit                           0x00007fff8275d9e9 -[FIFinderViewGutsController finderLocationPopUp:didChangeToDirectoryURL:] + 91
        8   FinderKit                           0x00007fff82780b3e -[FILocationPopUp setTargetNode:] + 207
        9   FinderKit                           0x00007fff827818ba -[FILocationPopUp performKeyEquivalent:] + 643
        10  FinderKit                           0x00007fff8275b07d -[FIFinderViewGutsController performKeyEquivalent:] + 49
        11  FinderKit                           0x00007fff8275f78c -[FIFinderView performKeyEquivalent:] + 27
        12  AppKit                              0x00007fff81bfb1f9 -[NSNavFinderViewFileBrowser performKeyEquivalent:] + 27
        13  AppKit                              0x00007fff818d5cd5 -[NSSavePanel performKeyEquivalent:] + 1189
        14  AppKit                              0x00007fff815091ca -[NSApplication _handleKeyEquivalent:] + 611
        15  AppKit                              0x00007fff81402536 -[NSApplication sendEvent:] + 4282
        16  com.apple.security.pboxd            0x000000010ceb1663 com.apple.security.pboxd + 26211
        17  AppKit                              0x00007fff813990c6 -[NSApplication run] + 555
        18  com.apple.security.pboxd            0x000000010ceada35 com.apple.security.pboxd + 10805
        19  com.apple.security.pboxd            0x000000010ceac3e4 com.apple.security.pboxd + 5092
    )

Comments


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!