ITADN

`samply` process killed on macOS due to codesigning issue

#714Closedandrej 创建于 2025-11-17
A
andrejcommented
Trying to run `samply record ./my-program`, I get this output: ``` zsh: killed samply record ./my-program ``` It looks like only the `samply` parent process is killed. The `./my-program` child process continues to run (detached from `stdin`) and produces output, but no profiling is done. Looking at the system logs (Console.app), it looks like this might be a codesigning issue. The following are what I think are relevant messages (especially the last one). ``` ... --- client log create type 309 result success: /Users/andreroesti/Library/Logs/DiagnosticReports/samply-2025-11-17-071823.ips --- no MetricKit for process samply type 309 bundleId (null) --- Sending event: com.apple.stability.crash {"exceptionCodes":"0x0000000000000032, 0x00000001052cf024(\n 50,\n 4381798436\n)EXC_BAD_ACCESSSIGKILL (Code Signature Invalid)UNKNOWN_0x32 at 0x00000001052cf024","incidentID":"567227F0-6376-4F7C-91D7-66632C39A015","logwritten":1,"process":"samply","responsibleApp":"Electron","terminationReasonExceptionCode":"0x2","terminationReasonNamespace":"CODESIGNING"} ``` Here's the "crash report" mentioned in the log: [samply-2025-11-17-071823.ips.txt](https://github.com/user-attachments/files/23585299/samply-2025-11-17-071823.ips.txt) <details> <summary>I did do the `samply setup` step to do codesigning during setup:</summary> ``` % samply setup On macOS, attaching to an existing process is only allowed to binaries with the com.apple.security.cs.debugger entitlement. The samply binary will be signed with this entitlement for your local machine only. The following command will be run: codesign --force --options runtime --sign - \ --entitlements entitlements.xml /Users/andreroesti/.cargo/bin/samply entitlements.xml contains: <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>com.apple.security.cs.debugger</key> <true/> </dict> </plist> Press any key to continue, or Ctrl-C to cancel. Code signing successful! ``` </details> I don't fully understand codesigning, so any help in how to troubleshoot this is appreciated. <details> <summary>I've also tried attaching a debugger, but it didn't let me:</summary> ``` (lldb) run error: process exited with status -1 (attach failed (Not allowed to attach to process. Look in the console messages (Console.app), near the debugserver entries, when the attach failed. The subsystem that denied the attach permission will likely have logged an informative message about why it was denied.)) ``` From the Console.app: ``` macOSTaskPolicy: (com.apple.debugserver) may not get the task control port of (samply) (pid: 80431): (samply) is hardened, (samply) doesn't have get-task-allow, (com.apple.debugserver) is a declared debugger(com.apple.debugserver) is not a declared read-only debugger ``` </details> OS version is macOS 12.7.6. I know it's a bit older but it's the newest that is supported for my hardware. Happy to try any additional things, just let me know what to try!
关闭于 2025-11-19 1 条评论