This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Title: Debugging with LLDB doesn't work for universal2 installer on macOS Big Sur
Type: behavior Stage: needs patch
Components: Build, macOS Versions: Python 3.9
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: ned.deily, ronaldoussoren
Priority: normal Keywords:

Created on 2021-05-25 14:20 by ronaldoussoren, last changed 2022-04-11 14:59 by admin.

Messages (3)
msg394356 - (view) Author: Ronald Oussoren (ronaldoussoren) * (Python committer) Date: 2021-05-25 14:20
I've installed python 3.9.5 using the universal2 installer on my M1 MacBook.

Debugging this python using lldb doesn't work because the debugger cannot attach to the (newly launched) binary.  This appears to be due to a missing entitlement in the signed executable.

Background: (in particular the first reply).
msg394417 - (view) Author: Ned Deily (ned.deily) * (Python committer) Date: 2021-05-26 07:21
There's a reason for that. What the discussion in that link fails to note is that elsewhere Apple warns that that entitlement is understandably prohibited in distributions submitted to the Apple notarization service. See the "Avoid the Get-Task-Allow Entitlement" section here: I haven't verified that that is still the case but I'd be surprised if it weren't.

I think one solution (and possibly the best) might be to manually re-codesign the installed binaries if you need to use lldb with the binaries. If someone comes up with something that works, we could document it somewhere with appropriate warnings about security risks and advice to reinstall when finished.
msg394441 - (view) Author: Ronald Oussoren (ronaldoussoren) * (Python committer) Date: 2021-05-26 14:53
Should we add documentation about this? 

The truly annoying bit about that discussion is that its probably easier to just install gdb and use that to debug extensions.
Date User Action Args
2022-04-11 14:59:46adminsetgithub: 88400
2021-05-26 14:53:38ronaldoussorensetmessages: + msg394441
2021-05-26 07:21:28ned.deilysetmessages: + msg394417
2021-05-25 14:20:50ronaldoussorencreate