0

Faulting code:

myTask = [NSTask launchedTaskWithLaunchPath: appPath arguments: initArray];

Where myTask is a global static NSTask* myTask = NULL; and initArray is a global static NSMutableArray *initArray = NULL; and appPath is a local NSString*

Exception Type:        EXC_GUARD
Exception Codes:       0x4000000200000001, 0x326e91a2a5c769eb
Exception Subtype:     GUARD_TYPE_FD, id=0x326e91a2a5c769eb, fd=1, flavor=0x00000002 (DUP)

Top of stack:

0   libsystem_kernel.dylib          0x00007fff2033848e dup + 10
1   com.apple.Foundation            0x00007fff2126df14 -[NSConcreteTask launchWithDictionary:error:] + 2491
2   com.apple.Foundation            0x00007fff21294c89 +[NSTask launchedTaskWithLaunchPath:arguments:] + 146

This issue is not reproducible and this code has not been changed since years. Please suggest some ways to debug this.

Additional info: Parent app which is launching this task has its output stream and error stream set to a log file but both the streams have been set after this app gets launched.

  • I don't understand. Is `initArray` nil when called? Because according to the doc, it should raises an exception: https://developer.apple.com/documentation/foundation/nstask/1414375-launchedtaskwithlaunchpath – Larme Mar 31 '21 at 07:44
  • initArray is not null. It has arguments that needs to be passed to mytask. – Monika Nainwal Apr 01 '21 at 11:02

0 Answers0