NSTask from a stand-alone helbox application does not work with "Failed to install Sandbox profile data"

Im working on a Mac OS application consisting of a main application and an assistant:

Backup.app/
└── Contents
    ├── Library
    │   └── LoginItems
    │       └── BackupHelper.app
    ├── MacOS
    │   └── Backup

Backup.app : ask the user to choose the path and save the application’s security tab. BackupHelper.app : backup this path.

both Backup.app and BackupHelper.app are isolated. The backupHelper application is registered to log in using SMLoginItemSetEnabled.

When BackupHelper.app needs to access the bookmark saved by Backup.app,
I want it to call Backup.app (with some parameters) to get the final NSURL (the one with the applesecurityscope parameter)

Backup.app NSTask, NSTaskTerminationReasonUncaughtSignal :

Process:         Backup [18095]
Path:            /Applications/Backup.app/Contents/MacOS/Backup
Identifier:      Backup
Version:         1.0 (1)
Code Type:       X86-64 (Native)
Parent Process:  BackupHelper [18093]
Responsible:     BackupHelper [18093]
User ID:         501

Date/Time:       2013-11-04 10:23:06.016 +0100
OS Version:      Mac OS X 10.9 (13A603)
Report Version:  11
Anonymous UUID:  84A150C3-31C4-BE29-AAC9-338910633B1C

Crashed Thread:  0  Dispatch queue: com.apple.main-thread

Exception Type:  EXC_BAD_INSTRUCTION (SIGILL)
Exception Codes: 0x0000000000000001, 0x0000000000000000

Application Specific Information:
Could not set sandbox profile data: Operation not permitted (1)

Application Specific Signatures:
SYSCALL_SET_PROFILE

Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0   libxpc.dylib                       0x00007fff9079c5a1 _xpc_runtime_init_once + 2482
1   libdispatch.dylib                  0x00007fff8e59c2ad _dispatch_client_callout + 8
2   libdispatch.dylib                  0x00007fff8e59c21c dispatch_once_f + 79 

Backup.app, NSTask, . , Backup.app?

!

+4

All Articles