I use NSTask to run my helper application. At 99%, one of my client systems works fine, but two returned to me, letting me know that not. One of them was good enough to allow me to look into the problem on the remote desktop.
I tried many other NSPipe / NSFileHandle combinations for StandardOutput / StandardError to make sure that the problem is not with filling these buffers. Example 1 and 2 . I assume this is not connected because it works fine on many systems, and _dyld_start is too early in the application lifecycle to fill a StandardOutput / StandardError.
Other notes about the problem:
- Running the helper application from the terminal works great.
- Attaching and detaching gdb from a stuck process and after it works is fine, and when it is finished, NSTask starts after -waitUntilExit.
- Using fork (2) and execv (3) instead of NSTask allows you to start and run a helper tone.
- The parent process is sandboxed, but I think the previous reports are not sandboxed in Mac OS X 10.6 / 10.7.
Screenshot from an example process from Activity Monitor:

Any hints or debugging tips to understand why the helper is stuck in _dyld_start are welcome!
source
share