Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/cocoa/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Cocoa 沙盒继承进程中的NSOpenPanel崩溃_Cocoa_Appstore Sandbox_Nsopenpanel - Fatal编程技术网

Cocoa 沙盒继承进程中的NSOpenPanel崩溃

Cocoa 沙盒继承进程中的NSOpenPanel崩溃,cocoa,appstore-sandbox,nsopenpanel,Cocoa,Appstore Sandbox,Nsopenpanel,我在沙箱中运行了一个应用程序,它使用NSTask启动了一个助手应用程序包(助手包含在应用程序包中) 使用正确的权限,主应用程序可以使用NSTask启动helper,沙箱将被继承而不会崩溃。唯一的问题似乎是当我打开NSOpenPanel时,下面出现了崩溃。请注意,使用NSOpenPanel时,调用方应用程序不会崩溃,只是帮助程序 这看起来像是系统中的一个bug,因此,如果有人在找到解决方法之前遇到了这个问题,那么可能会发生这种情况 以下是主应用程序的权利: <?xml version="1.

我在沙箱中运行了一个应用程序,它使用NSTask启动了一个助手应用程序包(助手包含在应用程序包中)

使用正确的权限,主应用程序可以使用NSTask启动helper,沙箱将被继承而不会崩溃。唯一的问题似乎是当我打开NSOpenPanel时,下面出现了崩溃。请注意,使用NSOpenPanel时,调用方应用程序不会崩溃,只是帮助程序

这看起来像是系统中的一个bug,因此,如果有人在找到解决方法之前遇到了这个问题,那么可能会发生这种情况

以下是主应用程序的权利:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>com.apple.security.app-sandbox</key>
    <true/>
    <key>com.apple.security.device.usb</key>
    <true/>
    <key>com.apple.security.files.bookmarks.app-scope</key>
    <true/>
    <key>com.apple.security.device.serial</key>
    <true/>
    <key>com.apple.security.network.client</key>
    <true/>
    <key>com.apple.security.files.user-selected.read-write</key>
    <true/>
</dict>
</plist>

com.apple.security.app-sandbox
com.apple.security.device.usb
com.apple.security.files.bookmarks.app-scope
com.apple.security.device.serial
com.apple.security.network.client
com.apple.security.files.user-selected.read-write
帮助者的权利:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>com.apple.security.app-sandbox</key>
    <true/>
    <key>com.apple.security.inherit</key>
    <true/>
</dict>
</plist>

com.apple.security.app-sandbox
com.apple.security.inherit
NSOpenPanel打开时发生崩溃:

2015-12-09 10:35:56.879 Desktops[29807:22090051] -[NSVBSavePanel init] caught non-fatal NSObjectNotAvailableException 'service com.apple.appkit.xpc.openAndSavePanelService failed to init an instance of NSOpenPanelService on behalf of <NSLayerCentricRemoteView: 0x1077fd0> due to {
    callStackSymbols = (
    0   CoreFoundation                      0x00007fff8f375e32 __exceptionPreprocess + 178
    1   libobjc.A.dylib                     0x00007fff855084fa objc_exception_throw + 48
    2   CoreFoundation                      0x00007fff8f3dc65d +[NSException raise:format:] + 205
    3   com.apple.appkit.xpc.openAndSavePanelService 0x000000010879493a com.apple.appkit.xpc.openAndSavePanelService + 6458
    4   AppKit                              0x00007fff87e4a662 -[NSViewController _loadViewIfRequired] + 75
    5   AppKit                              0x00007fff87e4a5cd -[NSViewController view] + 30
    6   ViewBridge                          0x00007fff9180dbab -[NSViewServiceMarshal _bootstrap:replyData:] + 11432
    7   ViewBridge                          0x00007fff9180efb5 -[NSViewServiceMarshal bootstrap:withReply:] + 124
    8   CoreFoundation                      0x00007fff8f2e7b5c __invoking___ + 140
    9   CoreFoundation                      0x00007fff8f2e79ee -[NSInvocation invoke] + 286
    10  CoreFoundation                      0x00007fff8f302e36 -[NSInvocation invokeWithTarget:] + 54
    11  ViewBridge                          0x00007fff91847f01 -[NSVB_ViewServiceImplicitAnimationDecodingProxy forwardInvocation:] + 264
    12  CoreFoundation                      0x00007fff8f2e6472 ___forwarding___ + 514
    13  CoreFoundation                      0x00007fff8f2e61e8 _CF_forwarding_prep_0 + 120
    14  CoreFoundation                      0x00007fff8f2e7b5c __invoking___ + 140
    15  CoreFoundation                      0x00007fff8f2e79ee -[NSInvocation invoke] + 286
    16  CoreFoundation                      0x00007fff8f302e36 -[NSInvocation invokeWithTarget:] + 54
    17  ViewBridge                          0x00007fff918189fa -[NSVB_QueueingProxy forwardInvocation:] + 323
    18  CoreFoundation                      0x00007fff8f2e6472 ___forwarding___ + 514
    19  CoreFoundation                      0x00007fff8f2e61e8 _CF_forwarding_prep_0 + 120
    20  CoreFoundation                      0x00007fff8f2e7b5c __invoking___ + 140
    21  CoreFoundation                      0x00007fff8f2e79ee -[NSInvocation invoke] + 286
    22  CoreFoundation                      0x00007fff8f302e36 -[NSInvocation invokeWithTarget:] + 54
    23  CoreFoundation                      0x00007fff8f2e6472 ___forwarding___ + 514
    24  CoreFoundation                      0x00007fff8f2e61e8 _CF_forwarding_prep_0 + 120
    25  CoreFoundation                      0x00007fff8f2e7b5c __invoking___ + 140
    26  CoreFoundation                      0x00007fff8f2e79ee -[NSInvocation invoke] + 286
    27  ViewBridge                          0x00007fff918573db withHintInProgress + 501
    28  ViewBridge                          0x00007fff91857161 __deferNSXPCInvocationOntoMainThread_block_invoke_2 + 220
    29  ViewBridge                          0x00007fff917f5c3f +[NSViewServiceApplication withHostPID:invoke:] + 46
    30  ViewBridge                          0x00007fff9185702f __deferNSXPCInvocationOntoMainThread_block_invoke + 129
    31  ViewBridge                          0x00007fff91856c3a __deferBlockOntoMainThread_block_invoke_2 + 448
    32  CoreFoundation                      0x00007fff8f30b4dc __CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK__ + 12
    33  CoreFoundation                      0x00007fff8f2eadf5 __CFRunLoopDoBlocks + 341
    34  CoreFoundation                      0x00007fff8f2eab5b __CFRunLoopRun + 2347
    35  CoreFoundation                      0x00007fff8f2e9fc8 CFRunLoopRunSpecific + 296
    36  HIToolbox                           0x00007fff86193d55 RunCurrentEventLoopInMode + 235
    37  HIToolbox                           0x00007fff86193b8f ReceiveNextEventCommon + 432
    38  HIToolbox                           0x00007fff861939cf _BlockUntilNextEventMatchingListInModeWithFilter + 71
    39  AppKit                              0x00007fff87e01d96 _DPSNextEvent + 1067
    40  AppKit                              0x00007fff87e011c5 -[NSApplication _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 454
    41  ViewBridge                          0x00007fff917f6c11 -[NSViewServiceApplication nextEventMatchingMask:untilDate:inMode:dequeue:] + 73
    42  AppKit                              0x00007fff87df5d28 -[NSApplication run] + 682
    43  AppKit                              0x00007fff87dbefbe NSApplicationMain + 1176
    44  libxpc.dylib                        0x00007fff91ee24f2 _xpc_objc_main + 793
    45  libxpc.dylib                        0x00007fff91ee0f1e xpc_main + 494
    46  ViewBridge                          0x00007fff9181c7b7 xpc_connection_handler + 0
    47  ViewBridge                          0x00007fff917faac9 NSViewServiceApplicationMain + 2818
    48  com.apple.appkit.xpc.openAndSavePanelService 0x00000001087996ec main + 208
    49  libdyld.dylib                       0x00007fff896d85ad start + 1
    50  ???                                 0x0000000000000001 0x0 + 1
);
    name = NSInternalInconsistencyException;
    reason = "+[NSOpenAndSavePanelService loadViewToService:isOpenPanel:appCentric:] : failed entitlements check";
    userInfo = "<null>";
}' with backtrace (
    0   CoreFoundation                      0x904a2c19 __raiseError + 201
    1   libobjc.A.dylib                     0x99387f11 objc_exception_throw + 276
    2   ViewBridge                          0x981b5cff __62-[NSRemoteViewBase advanceToConfigPhase:awaitingWindowRights:]_block_invoke + 0
    3   ViewBridge                          0x981b4518 -[NSRemoteViewBase advanceToConfigPhase] + 49
    4   ViewBridge                          0x981b6645 -[NSRemoteViewBase viewServiceMarshalProxy:withDetailedErrorHandler:] + 228
    5   ViewBridge                          0x981b6ace -[NSRemoteViewBase viewServiceMarshalProxy:withErrorHandler:] + 109
    6   ViewBridge                          0x981b62ce -[NSRemoteViewBase viewServiceMarshalProxy:] + 48
    7   ViewBridge                          0x981a88b5 -[NSRemoteViewBase bridge] + 255
    8   AppKit                              0x94e7e03c -[NSVBSavePanel init] + 689
    9   AppKit                              0x94e7dcfd +[NSSavePanel newRemotePanel] + 357
    10  AppKit                              0x94e7d94f +[NSSavePanel _crunchyRawUnbonedPanel] + 108
    11  AppKit                              0x94e7d8de +[NSOpenPanel openPanel] + 33
    12  Desktops                            0x000c7935 -[TDesktopInfoController choosePicture:] + 101
    13  libobjc.A.dylib                     0x993819e4 -[NSObject performSelector:withObject:] + 70
    14  AppKit                              0x94e7d556 __36-[NSApplication sendAction:to:from:]_block_invoke + 51
    15  libsystem_trace.dylib               0x9a8b13c9 _os_activity_initiate + 85
    16  AppKit                              0x94e7d477 -[NSApplication sendAction:to:from:] + 610
    17  AppKit                              0x94e90e69 -[NSControl sendAction:to:] + 102
    18  AppKit                              0x94e90d5d __26-[NSCell _sendActionFrom:]_block_invoke + 176
    19  libsystem_trace.dylib               0x9a8b13c9 _os_activity_initiate + 85
    20  AppKit                              0x94e90c8c -[NSCell _sendActionFrom:] + 161
    21  AppKit                              0x950ed08d __48-[NSCell trackMouse:inRect:ofView:untilMouseUp:]_block_invoke1010 + 43
    22  libsystem_trace.dylib               0x9a8b13c9 _os_activity_initiate + 85
    23  AppKit                              0x94e8f039 -[NSCell trackMouse:inRect:ofView:untilMouseUp:] + 2744
    24  AppKit                              0x94edb64b -[NSButtonCell trackMouse:inRect:ofView:untilMouseUp:] + 809
    25  AppKit                              0x94e8d668 -[NSControl mouseDown:] + 693
    26  AppKit                              0x9547abff -[NSWindow _handleMouseDownEvent:isDelayedEvent:] + 6266
    27  AppKit                              0x9547c406 -[NSWindow _reallySendEvent:isDelayedEvent:] + 2303
    28  AppKit                              0x94e1971f -[NSWindow sendEvent:] + 567
    29  AppKit                              0x94d94bf2 -[NSApplication sendEvent:] + 2919
    30  AppKit                              0x94be807b -[NSApplication run] + 1159
    31  AppKit                              0x94bae6a4 NSApplicationMain + 1630
    32  Desktops                            0x0007b27e +[TAppController Main] + 46
    33  Desktops                            0x00011f7a PASCALMAIN + 90
    34  Desktops                            0x00011f10 main + 32
    35  Desktops                            0x00011ecd start + 253
    36  Desktops                            0x00011df8 start + 40
)
2015-12-09 10:35:56.879台式机[29807:22090051]-[NSVBSavePanel init]捕获到非致命的NSObjectNotAvailableException'服务com.apple.appkit.xpc.openAndSavePanelService未能代表初始化NSOpenPanelService的实例,原因是:{
callStackSymbols=(
0 CoreFoundation 0x00007fff8f375e32例外预处理+178
1 libobjc.A.dylib 0x00007fff855084fa objc_异常_抛出+48
2 CoreFoundation 0x00007fff8f3dc65d+[N异常提升:格式:][205
3 com.apple.appkit.xpc.openAndSavePanelService 0x000000010879493a com.apple.appkit.xpc.openAndSavePanelService+6458
4应用套件0x00007fff87e4a662-[NSViewController\u LoadViewIf Required]+75
5应用套件0x00007fff87e4a5cd-[NSViewController视图]+30
6 ViewBridge 0x00007fff9180dbab-[NSViewServiceMarshall\u引导:replyData:+11432
7 ViewBridge 0x00007fff9180efb5-[NSViewServiceMarshall引导:带回复:][124
8 CoreFoundation 0x00007fff8f2e7b5c_uuuuuuuuuuuuu调用+140
9 CoreFoundation 0x00007fff8f2e79ee-[NSInvocation invoke]+286
10 CoreFoundation 0x00007fff8f302e36-[NSInvocation invokeWithTarget:+54
11 ViewBridge 0x00007fff91847f01-[NSVB_ViewServiceImplicationDecodingProxy forwardInvocation:+264
12 CoreFoundation 0x00007fff8f2e6472转发+514
13 CoreFoundation 0x00007fff8f2e61e8 _CF_转发_准备_0+120
14 CoreFoundation 0x00007fff8f2e7b5c_uuuuuuuuuuuuu调用+140
15 CoreFoundation 0x00007fff8f2e79ee-[NSInvocation调用]+286
16 CoreFoundation 0x00007fff8f302e36-[NSInvocation invokeWithTarget:+54
17 ViewBridge 0x00007fff918189fa-[NSVB_QueueingProxy forwardInvocation::+323
18 CoreFoundation 0x00007fff8f2e6472转发+514
19 CoreFoundation 0x00007fff8f2e61e8 _CF_转发_准备_0+120
20 CoreFoundation 0x00007fff8f2e7b5c___调用___+140
21 CoreFoundation 0x00007fff8f2e79ee-[NSInvocation invoke]+286
22 CoreFoundation 0x00007fff8f302e36-[NSInvocation invokeWithTarget:+54
23 CoreFoundation 0x00007fff8f2e6472转发+514
24 CoreFoundation 0x00007fff8f2e61e8 _CF_转发_准备_0+120
25 CoreFoundation 0x00007fff8f2e7b5c___调用___+140
26 CoreFoundation 0x00007fff8f2e79ee-[NSInvocation invoke]+286
27视图桥0x00007fff918573db,带HINTInProgress+501
28 ViewBridge 0x00007fff91857161延迟XPCINOTIONTOMAIN线程块调用2+220
29 ViewBridge 0x00007fff917f5c3f+[NSViewServiceApplication withHostPID:invoke:][46
30 ViewBridge 0x00007fff9185702f延迟xpcinocationMainThread块调用+129
31 ViewBridge 0x00007fff91856c3a u延迟块到主线程u块u调用2+448
32 CoreFoundation 0x00007fff8f30b4dc\uuuu CFRUNLOOP\u正在调用\u OUT\u到\u块\uuuuu+12
33 CoreFoundation 0x00007fff8f2eadf5\uuu CFRunLoopDoBlocks+341
34 CoreFoundation 0x00007fff8f2eab5b__CFRunLoopRun+2347
35 CoreFoundation 0x00007fff8f2e9fc8 CFRunLoopRunSpecific+296
36 HIToolbox 0x00007fff86193d55 RunCurrentEventLoopInMode+235
37 HIToolbox 0x00007fff86193b8f接收下一个EventCommon+432
38 HIToolbox 0x00007fff861939cf _块直到外部事件匹配列表输入模式与过滤器+71
39应用套件0x00007fff87e01d96 _dpsnextent+1067
40应用套件0x00007fff87e011c5-[n应用程序_nexteventmachinegeventmask:untilDate:inMode:dequeue:+454
41 ViewBridge 0x00007fff917f6c11-[NSViewServiceApplication NextEventMatchingTask:untilDate:inMode:dequeue:+73
42应用套件0x00007fff87df5d28-[N应用程序运行]+682
43应用套件0x00007fff87dbefbe非应用程序主+1176
44 libxpc.dylib 0x00007fff91ee24f2\u xpc\u objc\u main+793
45 libxpc.dylib 0x00007fff91ee0f1e xpc_main+494
46伏