My program runs a small Unix routine using NSTask. He does this by getting a path with
NSString * path = [[NSBundle mainBundle] pathForAuxiliaryExecutable:@"appName"];
and then passing this path to
[task setLaunchPath: path];
Works great almost all the time. But I get random crash reports where the "path" is zero. Not that the subroutine will work, that the OS cannot find it?
How could this happen? I thought it was cosmic rays for the first time, but it happened about four times. Everything in this executable file (so far).
FYI, the program will sign the code, but is distributed outside the Mac Store. This is built using Xcode 7; the corresponding build phase Copy Executables
, where I copy and encode five such executables. When I look at the firmware, five programs sit on MacOS; There are no more duplicates in the program. The missing size is 176K.
source
share