Open Reboot-Codes opened 2 years ago
This issue is happening to us as well. Full log: Process: Python [77193] Path: /Library/Frameworks/Python.framework/Versions/3.9/Resources/Python.app/Contents/MacOS/Python Identifier: Python Version: 3.9.7 (3.9.7) Code Type: ARM-64 (Native) Parent Process: zsh [77164] Responsible: Terminal [33568] User ID: 501
Date/Time: 2021-12-01 10:21:30.458 +0000 OS Version: macOS 11.5.2 (20G95) Report Version: 12 Anonymous UUID: CDDC8D6B-FC39-9760-22A3-6002733EAC4F
Sleep/Wake UUID: 7DD7B2C3-F27B-4D2A-9E1D-2BEA324D304D
Time Awake Since Boot: 730000 seconds Time Since Wake: 430 seconds
System Integrity Protection: enabled
Crashed Thread: 0 Dispatch queue: com.apple.main-thread
Exception Type: EXC_BAD_ACCESS (SIGSEGV) Exception Codes: KERN_INVALID_ADDRESS at 0xc1370002613058d4 -> 0x00000002613058d4 (possible pointer authentication failure) Exception Note: EXC_CORPSE_NOTIFY
Termination Signal: Segmentation fault: 11 Termination Reason: Namespace SIGNAL, Code 0xb Terminating Process: exc handler [77193]
VM Regions Near 0x2613058d4: unused shlib TEXT 217da4000-21a9fc000 [ 44.3M] r--/r-- SM=COW system shared lib TEXT not used by this process --> VM_ALLOCATE fc0000000-1000000000 [ 1.0G] ---/--- SM=COW
Thread 0 Crashed:: Dispatch queue: com.apple.main-thread 0 libsystem_platform.dylib 0x00000001824c2968 _platform_memmove + 40 1 com.apple.CoreFoundation 0x0000000182579ff4 CFDataGetBytes + 216 2 libffi.dylib 0x000000018f340050 ffi_call_SYSV + 80 3 libffi.dylib 0x000000018f3489e4 ffi_call_int + 948 4 _ctypes.cpython-39-darwin.so 0x000000010618a934 _ctypes_callproc + 1404 5 _ctypes.cpython-39-darwin.so 0x0000000106183c84 PyCFuncPtr_call + 1184 6 org.python.python 0x0000000105053e80 _PyObject_MakeTpCall + 360 7 org.python.python 0x0000000105128464 call_function + 512 8 org.python.python 0x0000000105125d78 _PyEval_EvalFrameDefault + 23316 9 org.python.python 0x000000010512937c _PyEval_EvalCode + 3072 10 org.python.python 0x00000001050545fc _PyFunction_Vectorcall + 256 11 org.python.python 0x0000000105053ca8 _PyObject_FastCallDictTstate + 272 12 org.python.python 0x0000000105054980 _PyObject_Call_Prepend + 148 13 org.python.python 0x00000001050b6268 slot_tp_init + 216 14 org.python.python 0x00000001050ad2c4 type_call + 352 15 org.python.python 0x0000000105053e80 _PyObject_MakeTpCall + 360 16 org.python.python 0x0000000105128464 call_function + 512 17 org.python.python 0x0000000105125df4 _PyEval_EvalFrameDefault + 23440 18 org.python.python 0x0000000105054678 function_code_fastcall + 112 19 org.python.python 0x0000000105053ca8 _PyObject_FastCallDictTstate + 272 20 org.python.python 0x0000000105054980 _PyObject_Call_Prepend + 148 21 org.python.python 0x00000001050b6268 slot_tp_init + 216 22 org.python.python 0x00000001050ad2c4 type_call + 352 23 org.python.python 0x0000000105053e80 _PyObject_MakeTpCall + 360 24 org.python.python 0x0000000105128464 call_function + 512 25 org.python.python 0x0000000105125df4 _PyEval_EvalFrameDefault + 23440 26 org.python.python 0x000000010512937c _PyEval_EvalCode + 3072 27 org.python.python 0x000000010512019c PyEval_EvalCode + 80 28 org.python.python 0x000000010511cf78 builtin_exec + 672 29 org.python.python 0x0000000105095464 cfunction_vectorcall_FASTCALL + 248 30 org.python.python 0x0000000105126070 _PyEval_EvalFrameDefault + 24076 31 org.python.python 0x000000010512937c _PyEval_EvalCode + 3072 32 org.python.python 0x00000001050545fc _PyFunction_Vectorcall + 256 33 org.python.python 0x0000000105128404 call_function + 416 34 org.python.python 0x0000000105125d78 _PyEval_EvalFrameDefault + 23316 35 org.python.python 0x0000000105054678 function_code_fastcall + 112 36 org.python.python 0x0000000105128404 call_function + 416 37 org.python.python 0x0000000105125d54 _PyEval_EvalFrameDefault + 23280 38 org.python.python 0x0000000105054678 function_code_fastcall + 112 39 org.python.python 0x0000000105128404 call_function + 416 40 org.python.python 0x0000000105125df4 _PyEval_EvalFrameDefault + 23440 41 org.python.python 0x0000000105054678 function_code_fastcall + 112 42 org.python.python 0x0000000105128404 call_function + 416 43 org.python.python 0x0000000105125df4 _PyEval_EvalFrameDefault + 23440 44 org.python.python 0x0000000105054678 function_code_fastcall + 112 45 org.python.python 0x0000000105055640 object_vacall + 320 46 org.python.python 0x00000001050557d0 _PyObject_CallMethodIdObjArgs + 112 47 org.python.python 0x000000010514e3d0 PyImport_ImportModuleLevelObject + 1300 48 org.python.python 0x000000010511bfa4 builtin_import + 108 49 org.python.python 0x0000000105095d18 cfunction_call + 84 50 org.python.python 0x0000000105054428 _PyObject_Call + 172 51 org.python.python 0x0000000105126070 _PyEval_EvalFrameDefault + 24076 52 org.python.python 0x000000010512937c _PyEval_EvalCode + 3072 53 org.python.python 0x00000001050545fc _PyFunction_Vectorcall + 256 54 org.python.python 0x0000000105128404 call_function + 416 55 org.python.python 0x0000000105125df4 _PyEval_EvalFrameDefault + 23440 56 org.python.python 0x000000010512937c _PyEval_EvalCode + 3072 57 org.python.python 0x00000001050545fc _PyFunction_Vectorcall + 256 58 org.python.python 0x0000000105055640 object_vacall + 320 59 org.python.python 0x00000001050557d0 _PyObject_CallMethodIdObjArgs + 112 60 org.python.python 0x000000010514e4e0 PyImport_ImportModuleLevelObject + 1572 61 org.python.python 0x00000001051249cc _PyEval_EvalFrameDefault + 18280 62 org.python.python 0x000000010512937c _PyEval_EvalCode + 3072 63 org.python.python 0x000000010512019c PyEval_EvalCode + 80 64 org.python.python 0x000000010511cf78 builtin_exec + 672 65 org.python.python 0x0000000105095464 cfunction_vectorcall_FASTCALL + 248 66 org.python.python 0x0000000105126070 _PyEval_EvalFrameDefault + 24076 67 org.python.python 0x000000010512937c _PyEval_EvalCode + 3072 68 org.python.python 0x00000001050545fc _PyFunction_Vectorcall + 256 69 org.python.python 0x0000000105128404 call_function + 416 70 org.python.python 0x0000000105125d78 _PyEval_EvalFrameDefault + 23316 71 org.python.python 0x0000000105054678 function_code_fastcall + 112 72 org.python.python 0x0000000105128404 call_function + 416 73 org.python.python 0x0000000105125d54 _PyEval_EvalFrameDefault + 23280 74 org.python.python 0x0000000105054678 function_code_fastcall + 112 75 org.python.python 0x0000000105128404 call_function + 416 76 org.python.python 0x0000000105125df4 _PyEval_EvalFrameDefault + 23440 77 org.python.python 0x0000000105054678 function_code_fastcall + 112 78 org.python.python 0x0000000105128404 call_function + 416 79 org.python.python 0x0000000105125df4 _PyEval_EvalFrameDefault + 23440 80 org.python.python 0x0000000105054678 function_code_fastcall + 112 81 org.python.python 0x0000000105055640 object_vacall + 320 82 org.python.python 0x00000001050557d0 _PyObject_CallMethodIdObjArgs + 112 83 org.python.python 0x000000010514e3d0 PyImport_ImportModuleLevelObject + 1300 84 org.python.python 0x00000001051249cc _PyEval_EvalFrameDefault + 18280 85 org.python.python 0x000000010512937c _PyEval_EvalCode + 3072 86 org.python.python 0x000000010512019c PyEval_EvalCode + 80 87 org.python.python 0x000000010511ccd0 builtin_eval + 656 88 org.python.python 0x0000000105095464 cfunction_vectorcall_FASTCALL + 248 89 org.python.python 0x0000000105128404 call_function + 416 90 org.python.python 0x0000000105125df4 _PyEval_EvalFrameDefault + 23440 91 org.python.python 0x000000010512937c _PyEval_EvalCode + 3072 92 org.python.python 0x000000010512019c PyEval_EvalCode + 80 93 org.python.python 0x0000000105165c74 PyRun_SimpleFileExFlags + 1236 94 org.python.python 0x0000000105182d14 Py_RunMain + 1708 95 org.python.python 0x00000001051831dc pymain_main + 340 96 org.python.python 0x0000000105183258 Py_BytesMain + 40 97 libdyld.dylib 0x0000000182495430 start + 4
Thread 1: 0 libsystem_pthread.dylib 0x00000001824725cc start_wqthread + 0
Thread 2: 0 libsystem_pthread.dylib 0x00000001824725cc start_wqthread + 0
Thread 0 crashed with ARM Thread State (64-bit): x0: 0x000000010d71edc0 x1: 0xc1370002613058d4 x2: 0x000000010761f790 x3: 0x000000010d71ede0 x4: 0x000000010761f790 x5: 0x0000000000000000 x6: 0x000000010d71edc0 x7: 0x0000000104df4040 x8: 0xc13700010509c8a4 x9: 0x000000015c269030 x10: 0x00000001ed2a4700 x11: 0x00007ffffffffff8 x12: 0x0000000000000020 x13: 0x0000000000000110 x14: 0x0000000000000006 x15: 0x0000000105298b10 x16: 0x00000001824c2940 x17: 0x00000001ed9d8860 x18: 0x0000000000000000 x19: 0x000000000000001e x20: 0x000000016b067650 x21: 0x0000000000000008 x22: 0x000000016b067648 x23: 0x000000016b0676f0 x24: 0x0000000000000003 x25: 0x0000000000000008 x26: 0x0000000000000008 x27: 0x0000000000000003 x28: 0x000000016b0676a0 fp: 0x000000016b0674e0 lr: 0x0000000182579ff4 sp: 0x000000016b0674e0 pc: 0x00000001824c2968 cpsr: 0x20000000 far: 0xc1370002613058d4 esr: 0x92000004
Binary Images:
0x104d94000 - 0x104d97fff +org.python.python (3.9.7 - 3.9.7)
External Modification Summary: Calls made by other processes targeting this process: task_for_pid: 0 thread_create: 0 thread_set_state: 0 Calls made by this process: task_for_pid: 0 thread_create: 0 thread_set_state: 0 Calls made by all processes on this machine: task_for_pid: 0 thread_create: 0 thread_set_state: 0
VM Region Summary: ReadOnly portion of Libraries: Total=782.6M resident=0K(0%) swapped_out_or_unallocated=782.6M(100%) Writable regions: Total=940.4M written=0K(0%) resident=0K(0%) swapped_out=0K(0%) unallocated=940.4M(100%)
VIRTUAL REGION
REGION TYPE SIZE COUNT (non-coalesced) =========== ======= ======= Activity Tracing 256K 1 Dispatch continuations 64.0M 1 Foundation 16K 1 Kernel Alloc Once 32K 1 MALLOC 113.1M 28 MALLOC guard page 96K 5 MALLOC_MEDIUM (reserved) 720.0M 6 reserved VM address space (unallocated) STACK GUARD 48K 3 Stack 17.1M 3 VM_ALLOCATE 1.0G 104 AUTH 826K 192 AUTH_CONST 12.2M 352 DATA 9113K 425 DATA_CONST 14.3M 433 DATA_DIRTY 1197K 145 __FONT_DATA 4K 1 LINKEDIT 494.8M 93 OBJC_CONST 2333K 175 __OBJC_RO 75.1M 1 OBJC_RW 2576K 1 TEXT 287.8M 457 UNICODE 588K 1 mapped file 37.9M 7 shared memory 272K 10 =========== ======= ======= TOTAL 2.8G 2446 TOTAL, minus reserved VM space 2.1G 2446
Model: MacBookAir10,1, BootROM 6723.140.2, proc 8:4:4 processors, 16 GB, SMC Graphics: kHW_AppleM1Item, Apple M1, spdisplays_builtin Memory Module: LPDDR4 AirPort: spairport_wireless_card_type_airport_extreme, wl0: Jul 7 2021 00:48:27 version 18.50.40.10.7.8.121 FWID 01-f5ad2691 Bluetooth: Version 8.0.5d7, 3 services, 27 devices, 1 incoming serial ports Network Service: Wi-Fi, AirPort, en0 USB Device: USB 3.1 Bus USB Device: USB 3.1 Bus Thunderbolt Bus: MacBook Air, Apple Inc. Thunderbolt Bus: MacBook Air, Apple Inc.
This might be an M Series problem/arm64 problem.
May or may not be related. Crashes on MacOS for me as well: #562
This crash occurs for me on M1 Macs too, I tracked it down using:
import faulthandler; faulthandler.enable()
Once I commented out the line:
Carbon.CFDataGetBytes(k_layout, CFRange(0, k_layout_size), ctypes.byref(k_layout_buffer))
It stopped SIGSEGV/SEGFAULTING.
I haven't yet figured out the cause or how to fix it other than commenting out that line - maybe the Carbon API is less supported on ARM chips, I dunno?
Importing
keyboard
will crash Python on macOS.How to reproduce
python
interpreterimport keyboard
Both the interpreter and a
.py
file will crash python.Here is a gist that contains the macOS debug output. However the interpreter will also spit out the following after reading the import line:
Context
macOS v12.0.1 (21A559) Processor: M1 Arch: arm64 Python Version: 3.9.7 PiP Version: 21.3.1 Python Install Path: /opt/homebrew/lib/python3.9/