Tuesday, October 30, 2012

Unable to find Mach task port for process-id

When we try to build and run any project under Xcode and if we get an error like "Unable to find Mach task port for process-id 274: (os/kern) failure (0x5)", then it is mainly due to some issues in validating cryptographic certificates. As written in the Building GDB for Darwin article the Darwin kernel refuses to allow GDB to debug another process if the user don't have special rights. Kernel allows a root user to debug. The latest method to allow GDB to control another process is to sign it with any system-trusted code signing authority. I got this error because of wrong system date. If system date is wrong, then verifying cryptographic signature fails.