I am following the instructions to codesign gdb on my MBP however when I get to the end of the System certificate creation process, keychain says "Unknown Error = -2,147,414,007" and the certificate has not been created.

It creates a certificate fine for login location, but system fails.

What is the problem and how can I fix this?

up vote 2 down vote accepted

I got the same error, so I went through the process but created the certificate in the login keychain. Once this is done you can drag the certificate into the System keychain through the UI.

You will need to unlock your System keychain first if it is showing as a locked padlock: just right-click and select 'Unlock keychain "System"'.

You have to enter your password several times but eventually it works, and the corresponding codesign command works:

codesign -fs your-cert-name $(which gdb)
  • 2
    I've tried this, and I'm still getting the same thing unfortunately. Unable to find Mach task port for process-id 39655: (os/kern) failure (0x5). (please check gdb is codesigned - see taskgated(8)) – FlamingSquirrel Oct 30 '17 at 23:14
  • Did you unlock your System keychain first? I noticed my local one had the unlocked padlock symbol but the System one was locked. I unlocked it before trying to drag-and-drop the certificate. Also, check there aren’t more than one gdb binary, because you may be signing the wrong one: locate gdb – tastapod Nov 1 '17 at 8:52
  • Yeay! A different error this time During startup program terminated with signal ?, Unknown signal. When did gdb break on macOS? – FlamingSquirrel Nov 1 '17 at 12:51
  • Ok so it looks like you’re all set with code signing. No idea about the gdb error :) – tastapod Nov 2 '17 at 13:22
  • I'll mark as the accepted answer, this is probably an issue with gdb on my machine. I think for now I'll just debug on my linux VM! Thanks. – FlamingSquirrel Nov 2 '17 at 13:33

Your Answer


By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.