codesign failing with "Trace/BPT trap: 5" since Sierra upgrade

Since I updated my Mac to Sierra, attempting to codesign anything (for OSX) results in an error message Trace/BPT trap: 5


Internet searching seems to indicate this error message is related to dynamic libraries, but running otool -L did not tell me anything that is missing, i.e. I go this:


> otool -L /usr/bin/codesign

/usr/bin/codesign:

/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 1348.28.0)

/System/Library/Frameworks/Security.framework/Versions/A/Security (compatibility version 1.0.0, current version 57740.31.2)

/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 307.4.0)

/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1238.0.0)


All those files are available on my system.


When I run codesign -s with the same developer ID as always (which keychain says is valid through 2019) all I see is that Trace/BPT trap: 5 message with no explanation. I've attempted to fully uninstall and reinstall xcode, made sure I have every Mac update, etc. and nothing has helped. I deleted all expired certificates from keychain in case they were causing problems (some Google searching referenced that). I'm at wit's end, because there are no details provided by the programmer and I've no clue how to debug this.


I really appreciate any help!

codesign failing with "Trace/BPT trap: 5" since Sierra upgrade
 
 
Q