Hi.
I'm trying to catch leaks in my C program and I get an error Failed to gain authorization
in the Leaks tool on Macbook Pro 13 M1 2020.
Xcode 12.5.1
Likewise, when I run leaks in the terminal, I get a warning Process is not debuggable
I am using the gcc
with -g
to compile my C code.
Earlier, on Macbook Pro 13 Intel 2014, I have successfully used the tool for similar tasks. Is this possible on the M1?
I wonder if I can use leaks with programs that are not compiled in Xcode?
Xcode is not in a privileged position when it comes to building and signing code. Anything it does should be achievable by other development tools.
In the build logs, I see the steps:
Sign <appname> Register execution policy exception for <appname>
This is a red herring. Xcode is registering its newly built code with the Execution Policy framework but that is a no-op on current systems [1].
After reading this thread, I'm guessing it's about code signing.
Yes, that’s most likely. Try this:
-
Create an entitlements file with the
com.apple.security.get-task-allow
entitlement:% /usr/libexec/PlistBuddy -c "Add :com.apple.security.get-task-allow bool true" tmp.entitlements File Doesn't Exist, Will Create: tmp.entitlements -
Sign your code with that entitlements:
% codesign -s - --entitlements tmp.entitlements -f /path/to/tool xxst: replacing existing signature
Does that help?
Share and Enjoy
—
Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"
[1] That might change in the future, of course, but I’ve no info to share on that front.