hi all,
i'm currently facing a heap curruption in one of our externals, that appears (until now ;-)) only on macOS.
so i'd like to run with through the debugger of choice, which i figure is 'lldb'.
unfortunately, the system doesn't allow me to attach the debugger to the process, instead I get (in the Console.app):
default 19:02:06.024688+0200 kernel macOSTaskPolicy:
(com.apple.debugserver) may not get the task control port of (pd) (pid: 30725): (pd) is hardened, (pd) doesn't have get-task-allow, (com.apple.debugserver) is a declared debugger(com.apple.debugserver) is not a declared read-only debugger
now i'm not really knowledgable on macOS, so i've tried to run the script at [1] to add the "get-task-allow" entitlement, and now i get:
``` $ codesign -d --entitlements - Pd.app [Key] com.apple.security.get-task-allow [Value] [Bool] true ```
however, lldb still refuses to attach to the process.
the Pd is the one from millers homepage (I'd rather not compile it myself on that machine).
the external itself dlopen()s another library which depends on a couple of libs (all that is optional, and the dlopen()end library has been removed for debugging purposes). however, because of the dlopen() (and because we can), the external itself is also codesigned (but has no entitlements; dunno whether this is even possible with a single binary outside of a bundle)
any ideas?
ga,msdr IOhannes
[1] https://gist.github.com/talaviram/1f21e141a137744c89e81b58f73e23c3
On 7/8/25 19:20, IOhannes m zmoelnig via Pd-dev wrote:
now i'm not really knowledgable on macOS, so i've tried to run the script at [1] to add the "get-task-allow" entitlement, and now i get:
ah, ok, i needed to sign everything in bin/ and deep-sign the entire app as well (just like with the normal signing during build).
however, because of the dlopen() (and because we can), the external itself is also codesigned (but has no entitlements; dunno whether this is even possible with a single binary outside of a bundle)
it obviously is possible.
however, now that everything ( I think) is ad-hoc signed and has the correct entitlement, i still cannot load the external within lldb:
``` Process 31158 launched: 'Pd-0.56-0test1.app/Contents/Resources/bin/pd' (arm64) 2025-07-08 19:30:21.216721+0200 pd[31158:3320065] [plugin] AddInstanceForFactory: No factory registered for id <CFUUID 0x600000214240> F8BB1C28-BAE8-11D6-9C31-00039315CD46 foobar: can't load library ```
outside of lldb it seems to work nicely (but crashes)...
any more ideas?
gfadmr IOhannes
Actually, this came up on the list a year or two ago and I documented what worked for (and the person asking about) in mac/README.txt
https://github.com/pure-data/pure-data/blob/master/mac/README.txt#L240
I believe this worked fine for an external as that was the original questions about. The external should be built with debugging symbols of course so you can step into it with lldb.
On Jul 8, 2025, at 7:38 PM, IOhannes m zmoelnig via Pd-dev pd-dev@lists.iem.at wrote:
outside of lldb it seems to work nicely (but crashes)...
ah well. it kind of works if I start Pd as normal, and then attach lldb to the running PID.
but today it's too late to fix the actual issue :-/
fgmadrs IOhannes
-- please do not CC me for list-emails
pd-dev@lists.iem.at - the Pd developers' mailinglist https://lists.iem.at/hyperkitty/list/pd-dev@lists.iem.at/message/FEUKSJM2NFR...
-------- Dan Wilcox danomatika.com http://danomatika.com/ robotcowboy.com http://robotcowboy.com/
Am 8. Juli 2025 21:43:20 MESZ schrieb Dan Wilcox danomatika@gmail.com:
Actually, this came up on the list a year or two ago and I documented what worked for (and the person asking about) in mac/README.txt
https://github.com/pure-data/pure-data/blob/master/mac/README.txt#L240
I believe this worked fine for an external as that was the original questions about. The external should be built with debugging symbols of course so you can step into it with lldb.
doh. Indeed, you documented exactly what I needed. I did remember that the was talk about this, and looked up the mailing list archives, but couldn't find anything. I forgot about the documentation :-/ sorry for the noise.
I still wonder though, why I can't load the external within the debugger, but fine outside.
mfg.sfg.jfd IOhannes