I'm trying to manually codesign a prebuilt binary of SQLite (sqlite3) using the following command:
codesign -s "Mac Developer" --entitlements sqlite3.entitlements sqlite3
However, when I try to run the result sqlite3, I get:
Illegal instruction: 4
What was I doing wrong?
There can be a variety of causes for an illegal instruction crash. In the case of code signing it typically means that the code has requested entitlements that aren’t covered by the provisioning profile, but in your case I suspect that you’re running into another snag, namely, that you’re trying to run sandboxed code from Terminal. That won’t work. The App Sandbox is an app sandbox; it does not support command line tools.
Back in your other thread I wrote:
Does your app use the sqlite3 tool directly (sublaunching it via NSTask, for example)?
The reason I asked this is that, once you add the sandbox inheritance entitlement (
com.apple.security.inherit
) to a command line tool, the only way to run that tool is by sublaunching it from your sandboxed app. You can’t run it from Terminal because in that context it has no sandbox to inherit.
Share and Enjoy
—
Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware
let myEmail = "eskimo" + "1" + "@apple.com"