Sandboxed Carbon app & NSOpen / NSSavePanel causes crashes & odd behaviour

Originator:martincrane
Number:rdar://10396334 Date Originated:04-Nov-2011 01:59 PM
Status:Open Resolved:No
Product:Mac OS X Product Version:10.7 and on
Classification:Crash/Hang/Data Loss Reproducible:Always
 
I've pasted the report sent to Apple, in which I supplied a demo app and project with source code, that demonstrates the issues with both NSOpenPanel and NSSavePanel.

Summary: NSOpenPanel & NSSavePanel in a sandboxed Carbon app causes crashes & odd behaviour

Steps to Reproduce: Enable sandboxing in a Carbon app and use NSOpenPanel & NSSavePanel. 

Issues to reproduce using supplied example app:

1. Select "New" from File menu and the NSSavePanel is displayed in minimised state
2. Click in the menubar and notice that the NSSavePanel becomes de-activated. Release the moue and the panel becomes activated again.
3. Select 'Minimize' from the Window menu, then click in the minimised window in the Dock. Notice how the window and Save button flickers now and the window is unresponsive to user input (e.g. mouse)
4. Click out of app into (e.g.) Finder and back again. Notice how app crashes. 
5. Re-run app and select "New" from File menu.
6. Choose "Close" from File menu. Notice how NSSavePanel window closes, but does not exit runModal, leaving host app in unusable (and un-Quit-able) state

Similar problems can be seen when using the New Folder button from the expanded NSSavePanel window, and also from the NSOpenPanel - choose Open from the File menu to see these. Just play with it a while and it will be very obvious what is broken. Yet, un-checkinbg the sandbox checkbox makes all these issues disappear.

Expected Results: Correct operation

Actual Results:Very buggy behaviour, including (but not limited to) crashing, activation issues, unresponsive UI

Regression:N/A

Notes:The very same code is working perfectly if sandboxing is disabled.

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!