Update: I *finally* got a bead on this.


The user running my main application has parental controls enabled. The user is 
allowed to run the main application, and can, but the helper task that is 
bundled inside the main application's bundle is not allowed to run. When the 
*task* launches, *it* crashes, but since it happens *while* fork/exec'ing, the 
crash *appears* to be main application crashing, but it's not.

When the task launches, the user is shown a dialog by the OS: "You don't have 
permission to use the application "mytask."" There are options to Always allow, 
allow once, and just ignore and move on. Allowing once, and even "Always allow" 
always results in the same message, and the task crashing. The permissions do 
not stick at all, probably because it's bundled inside the main .app package's 
Resource folder?

Any ideas what to do? 


--
Seth Willits





On Feb 4, 2013, at 11:26 AM, Seth Willits wrote:

> 
> In my app I have to launch background processes (bundled within my app's 
> Resources folder) to do some things, and I launch them with NSTask. Every now 
> and then I get a crash report which shows NSTask throws some fatal exception 
> which is not caught by a wrapping @try block.
> 
> 
> For example:
> 
> 
> 
> @try {
>       NSString * taskPath = [[[NSBundle mainBundle] resourcePath] 
> stringByAppendingPathComponent:@"mytask"];
>       task = [[NSTask alloc] init];
>       task.launchPath = taskPath;
>       task.arguments = @[aUUIDString];
>       [task launch];
> }
> @catch (NSException * e) {
>       ...
> }
> 
> 
> 
> And it crashes:
> 
> 
> Exception Type:  EXC_BREAKPOINT (SIGTRAP)
> Exception Codes: 0x0000000000000002, 0x0000000000000000
> 
> *** NSTask: Task create for path 
> '/Applications/App.app/Contents/Resources/mytask' failed: 22, "Invalid 
> argument". Terminating temporary process.
> *** multi-threaded process forked ***
> 
> Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
> 0   com.apple.Foundation              0x978142d8 
> ___NEW_PROCESS_COULD_NOT_BE_EXECD___ + 7
> 1   com.apple.Foundation              0x976d2e16 -[NSConcreteTask 
> launchWithDictionary:] + 4698
> 2   com.apple.Foundation              0x97744447 -[NSConcreteTask launch] + 40
> 

> 




--
Seth Willits




_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to