I have a sandboxed, document-based app. Things usually work as intended, but sometimes the app crashes with EXC_BAD_ACCESS
, after producing multiple sandbox errors.
I haven't found any information about the specific errors or on how to avoid them.
[scoped] handle 0: sandbox_extension_release error [22: Invalid argument]
Appname [96446:12385639] [scoped] <0x600002e4ba20 file:///....(url here)>: internal sandbox error for <StopAccessing>
Appname[96446:12386186] [scoped] Scoped bookmarks can only be created for existing files or directories
Appname[96446:12386810] [default] sandbox_extension_consume returned 12
sandbox_extension_consume returned 12
sandbox_extension_consume returned 12
... ad nauseam
I'm not using any custom writing methods in my NSDocument
subclass and the URL that it has accessed before stopping access, does in fact exist.
The most cryptic error is sandbox_extension_consume returned 12
. There is no information about it available anywhere, and until recently, it didn't cause any problems, but now it has started crashing the app, giving the aforementioned bad access.
What am I doing wrong and where? What is sandbox_extension_consume
and why does it return 12
?