Skip to content

Rust included with Cryptography versions >= 3.4.8 on Conda-Forge causes SIGKILL (Code Signature Invalid) on macOS Monterey with M1 #6466

@TV4Fun

Description

@TV4Fun

I don't entirely blame cryptography for this, as it seems to really be an issue with macOS's extremely arbitrary and capricious implementation of System Integrity Protection, especially on M1 systems, which have very specific signature requirements for any Apple Silicon-native code, and which still seems to have some bugs to work out. Nevertheless, cryptography, and any other library that uses it is definitely impacted by this.

I actually encountered this issue while trying to use tensorboard. Any attempt to run it immediately resulted in it being killed. Tracing the cause of this was not easy. I found that when running an interactive Python shell, certain imports would cause python to be immediately killed. After tracing imports back through dozens of files across multiple libraries, I eventually isolated it to cryptography/hazmat/bindings/_rust.abi3.so, which macOS apparently doesn't like. I found this could be triggered from a Python shell with any version of cryptography >= 3.4.8 (I tested this with 3.4.8 and 35.0.0) by typing import cryptography.hazmat.bindings._rust. Running this inside of LLDB and looking at crash reports showed me the following:

-------------------------------------
Translated Report (Full Report Below)
-------------------------------------

Process:               lldb [3215]
Path:                  /Applications/Xcode-beta.app/Contents/Developer/usr/bin/lldb
Identifier:            lldb
Version:               ???
Code Type:             ARM-64 (Native)
Parent Process:        zsh [975]
Responsible:           iTerm2 [970]
User ID:               501

Date/Time:             2021-10-23 20:30:08.6105 -0700
OS Version:            macOS 12.0.1 (21A559)
Report Version:        12
Anonymous UUID:        B045E435-B976-0C10-F4E7-99CA5746C6FB

Sleep/Wake UUID:       270A104D-542D-4E13-8EC3-51A0F12F6AF0

Time Awake Since Boot: 4000 seconds
Time Since Wake:       751 seconds

System Integrity Protection: enabled

Crashed Thread:        12  <lldb.process.internal-state(pid=3219)>

Exception Type:        EXC_BAD_ACCESS (SIGKILL (Code Signature Invalid))
Exception Codes:       UNKNOWN_0x32 at 0x0000000107694000
Exception Codes:       0x0000000000000032, 0x0000000107694000
Exception Note:        EXC_CORPSE_NOTIFY

Termination Reason:    Namespace CODESIGNING, Code 2 

VM Region Info: 0x107694000 is in 0x107694000-0x10785c000;  bytes after start: 0  bytes before end: 1867775
      REGION TYPE                    START - END         [ VSIZE] PRT/MAX SHRMOD  REGION DETAIL
      mapped file                 107658000-107694000    [  240K] rw-/rwx SM=COW  ...t_id=60ec5e97
--->  mapped file                 107694000-10785c000    [ 1824K] rw-/rwx SM=COW  ...t_id=61ece197
      GAP OF 0xb7e8000 BYTES
      __TEXT                      113044000-118160000    [ 81.1M] r-x/rwx SM=COW  ...rsions/A/LLDB

Thread 0::  Dispatch queue: com.apple.main-thread
0   libsystem_kernel.dylib        	       0x183257d38 __select + 8
1   LLDB                          	       0x1134cd748 SelectHelper::Select() + 1324
2   LLDB                          	       0x113443d90 IOHandlerProcessSTDIO::Run() + 488
3   LLDB                          	       0x1132eb790 lldb_private::Debugger::RunIOHandlers() + 140
4   LLDB                          	       0x1133b9d34 lldb_private::CommandInterpreter::RunCommandInterpreter(lldb_private::CommandInterpreterRunOptions&) + 160
5   LLDB                          	       0x1130dd4ec lldb::SBDebugger::RunCommandInterpreter(bool, bool) + 192
6   lldb                          	       0x104b0ef50 Driver::MainLoop() + 2452
7   lldb                          	       0x104b10808 main + 2180
8   dyld                          	       0x104d0d0f4 start + 520

Thread 1:
0   libsystem_pthread.dylib       	       0x1832842bc start_wqthread + 0

Thread 2:
0   libsystem_pthread.dylib       	       0x1832842bc start_wqthread + 0

Thread 3:
0   libsystem_kernel.dylib        	       0x18324d954 mach_msg_trap + 8
1   libsystem_kernel.dylib        	       0x18324dd00 mach_msg + 76
2   CoreFoundation                	       0x183354e38 __CFRunLoopServiceMachPort + 372
3   CoreFoundation                	       0x1833532f0 __CFRunLoopRun + 1212
4   CoreFoundation                	       0x183352694 CFRunLoopRunSpecific + 600
5   CoreFoundation                	       0x1833dec28 CFRunLoopRun + 64
6   DebugSymbols                  	       0x195da41c8 SpotlightQueryThread(void*) + 564
7   libsystem_pthread.dylib       	       0x1832894ec _pthread_start + 148
8   libsystem_pthread.dylib       	       0x1832842d0 thread_start + 8

Thread 4:
0   libsystem_pthread.dylib       	       0x1832842bc start_wqthread + 0

Thread 5:
0   libsystem_pthread.dylib       	       0x1832842bc start_wqthread + 0

Thread 6:
0   libsystem_pthread.dylib       	       0x1832842bc start_wqthread + 0

Thread 7:
0   libsystem_pthread.dylib       	       0x1832842bc start_wqthread + 0

Thread 8:
0   libsystem_pthread.dylib       	       0x1832842bc start_wqthread + 0

Thread 9:
0   libsystem_pthread.dylib       	       0x1832842bc start_wqthread + 0

Thread 10:: lldb.debugger.event-handler
0   libsystem_kernel.dylib        	       0x1832510c0 __psynch_cvwait + 8
1   libsystem_pthread.dylib       	       0x183289ab4 _pthread_cond_wait + 1228
2   libc++.1.dylib                	       0x1831d7ddc std::__1::condition_variable::wait(std::__1::unique_lock<std::__1::mutex>&) + 28
3   LLDB                          	       0x1134b8100 lldb_private::Listener::GetEventInternal(lldb_private::Timeout<std::__1::ratio<1l, 1000000l> > const&, lldb_private::Broadcaster*, lldb_private::ConstString const*, unsigned int, unsigned int, std::__1::shared_ptr<lldb_private::Event>&) + 440
4   LLDB                          	       0x1132edbb8 lldb_private::Debugger::DefaultEventHandler() + 252
5   LLDB                          	       0x1132ede78 lldb_private::Debugger::EventHandlerThread(void*) + 12
6   LLDB                          	       0x11338fe2c lldb_private::HostNativeThreadBase::ThreadCreateTrampoline(void*) + 104
7   libsystem_pthread.dylib       	       0x1832894ec _pthread_start + 148
8   libsystem_pthread.dylib       	       0x1832842d0 thread_start + 8

Thread 11:: <lldb.process.gdb-remote.async>
0   libsystem_kernel.dylib        	       0x1832510c0 __psynch_cvwait + 8
1   libsystem_pthread.dylib       	       0x183289ab4 _pthread_cond_wait + 1228
2   libc++.1.dylib                	       0x1831d7ddc std::__1::condition_variable::wait(std::__1::unique_lock<std::__1::mutex>&) + 28
3   LLDB                          	       0x1134b8100 lldb_private::Listener::GetEventInternal(lldb_private::Timeout<std::__1::ratio<1l, 1000000l> > const&, lldb_private::Broadcaster*, lldb_private::ConstString const*, unsigned int, unsigned int, std::__1::shared_ptr<lldb_private::Event>&) + 440
4   LLDB                          	       0x1136c70d4 lldb_private::process_gdb_remote::ProcessGDBRemote::AsyncThread(void*) + 284
5   LLDB                          	       0x11338fe2c lldb_private::HostNativeThreadBase::ThreadCreateTrampoline(void*) + 104
6   libsystem_pthread.dylib       	       0x1832894ec _pthread_start + 148
7   libsystem_pthread.dylib       	       0x1832842d0 thread_start + 8

Thread 12 Crashed:: <lldb.process.internal-state(pid=3219)>
0   LLDB                          	       0x1134b0818 lldb_private::DataExtractor::GetU32(unsigned long long*) const + 52
1   LLDB                          	       0x11365a35c ObjectFileMachO::ParseHeader() + 96
2   LLDB                          	       0x113658778 ObjectFileMachO::CreateInstance(std::__1::shared_ptr<lldb_private::Module> const&, std::__1::shared_ptr<lldb_private::DataBuffer>&, unsigned long long, lldb_private::FileSpec const*, unsigned long long, unsigned long long) + 644
3   LLDB                          	       0x1133f7068 lldb_private::ObjectFile::FindPlugin(std::__1::shared_ptr<lldb_private::Module> const&, lldb_private::FileSpec const*, unsigned long long, unsigned long long, std::__1::shared_ptr<lldb_private::DataBuffer>&, unsigned long long&) + 1184
4   LLDB                          	       0x11331786c lldb_private::Module::GetObjectFile() + 300
5   LLDB                          	       0x11331c4a0 lldb_private::ModuleList::GetSharedModule(lldb_private::ModuleSpec const&, std::__1::shared_ptr<lldb_private::Module>&, lldb_private::FileSpecList const*, llvm::SmallVectorImpl<std::__1::shared_ptr<lldb_private::Module> >*, bool*, bool) + 1232
6   LLDB                          	       0x11346d564 lldb_private::Target::GetOrCreateModule(lldb_private::ModuleSpec const&, bool, lldb_private::Status*) + 1064
7   LLDB                          	       0x11350fd78 lldb_private::DynamicLoaderDarwin::FindTargetModuleForImageInfo(lldb_private::DynamicLoaderDarwin::ImageInfo&, bool, bool*) + 1248
8   LLDB                          	       0x11351382c lldb_private::DynamicLoaderDarwin::AddModulesUsingImageInfos(std::__1::vector<lldb_private::DynamicLoaderDarwin::ImageInfo, std::__1::allocator<lldb_private::DynamicLoaderDarwin::ImageInfo> >&) + 448
9   LLDB                          	       0x11350e78c DynamicLoaderMacOS::AddBinaries(std::__1::vector<unsigned long long, std::__1::allocator<unsigned long long> > const&) + 740
10  LLDB                          	       0x11350e308 DynamicLoaderMacOS::NotifyBreakpointHit(void*, lldb_private::StoppointCallbackContext*, unsigned long long, unsigned long long) + 1200
11  LLDB                          	       0x1132cde58 lldb_private::BreakpointLocation::ShouldStop(lldb_private::StoppointCallbackContext*) + 248
12  LLDB                          	       0x1132ced84 lldb_private::BreakpointLocationCollection::ShouldStop(lldb_private::StoppointCallbackContext*) + 188
13  LLDB                          	       0x1132ddcd0 lldb_private::BreakpointSite::ShouldStop(lldb_private::StoppointCallbackContext*) + 136
14  LLDB                          	       0x113461850 lldb_private::StopInfoBreakpoint::ShouldStopSynchronous(lldb_private::Event*) + 400
15  LLDB                          	       0x113483168 lldb_private::Thread::ShouldStop(lldb_private::Event*) + 936
16  LLDB                          	       0x11348ad34 lldb_private::ThreadList::ShouldStop(lldb_private::Event*) + 824
17  LLDB                          	       0x11343b4a8 lldb_private::Process::ShouldBroadcastEvent(lldb_private::Event*) + 456
18  LLDB                          	       0x113437e10 lldb_private::Process::HandlePrivateEvent(std::__1::shared_ptr<lldb_private::Event>&) + 292
19  LLDB                          	       0x11343c154 lldb_private::Process::RunPrivateStateThread(bool) + 1296
20  LLDB                          	       0x11343b864 lldb_private::Process::PrivateStateThread(void*) + 28
21  LLDB                          	       0x11338fe2c lldb_private::HostNativeThreadBase::ThreadCreateTrampoline(void*) + 104
22  libsystem_pthread.dylib       	       0x1832894ec _pthread_start + 148
23  libsystem_pthread.dylib       	       0x1832842d0 thread_start + 8

Thread 13:: <lldb.comm.process.stdio>
0   libsystem_kernel.dylib        	       0x183257d38 __select + 8
1   LLDB                          	       0x1134cd748 SelectHelper::Select() + 1324
2   LLDB                          	       0x1133a2c7c lldb_private::ConnectionFileDescriptor::BytesAvailable(lldb_private::Timeout<std::__1::ratio<1l, 1000000l> > const&, lldb_private::Status*) + 368
3   LLDB                          	       0x1133a2854 lldb_private::ConnectionFileDescriptor::Read(void*, unsigned long, lldb_private::Timeout<std::__1::ratio<1l, 1000000l> > const&, lldb::ConnectionStatus&, lldb_private::Status*) + 112
4   LLDB                          	       0x1132e6f7c lldb_private::Communication::ReadThread(void*) + 684
5   LLDB                          	       0x11338fe2c lldb_private::HostNativeThreadBase::ThreadCreateTrampoline(void*) + 104
6   libsystem_pthread.dylib       	       0x1832894ec _pthread_start + 148
7   libsystem_pthread.dylib       	       0x1832842d0 thread_start + 8


Thread 12 crashed with ARM Thread State (64-bit):
    x0: 0x0000000151011108   x1: 0x000000016c881030   x2: 0x0000000000000000   x3: 0x00000000001c6130
    x4: 0x00000000001c6130   x5: 0x000000016c8813d0   x6: 0x0000000000000000   x7: 0x00006000037d4180
    x8: 0x0000000000000000   x9: 0x0000000107694000  x10: 0x0000000000000004  x11: 0x000000000000aed9
   x12: 0x00000000000120a8  x13: 0x0000000000000008  x14: 0x000000000000aed9  x15: 0x0000000000000d03
   x16: 0x000000028526a248  x17: 0x00000001dd66bf38  x18: 0x0000000000000000  x19: 0x0000000151010e00
   x20: 0x00000001510110b0  x21: 0x0000000151011108  x22: 0x0000000151010ec0  x23: 0x000000016c8813c0
   x24: 0x0000000000000000  x25: 0x00000001510110b0  x26: 0x0000000000000003  x27: 0x000000016c881378
   x28: 0x000000016c8813d0   fp: 0x000000016c8810a0   lr: 0x000000011365a35c
    sp: 0x000000016c880e20   pc: 0x00000001134b0818 cpsr: 0x20001000
   far: 0x0000000107694000  esr: 0x92000007 (Data Abort) byte read Translation fault

Binary Images:
       0x18324c000 -        0x183281fff libsystem_kernel.dylib (*) <c8524c02-b14f-30bd-a228-c44b4a448e68> /usr/lib/system/libsystem_kernel.dylib
       0x113044000 -        0x11815ffff com.apple.LLDB.framework (1300.0.20.8) <1f4d3fb4-d0ec-3deb-8aca-be56bf8e27e6> /Applications/Xcode-beta.app/Contents/SharedFrameworks/LLDB.framework/Versions/A/LLDB
       0x104b08000 -        0x104b43fff lldb (*) <f4ee89ea-fe5b-329b-b848-d7cdcea4123f> /Applications/Xcode-beta.app/Contents/Developer/usr/bin/lldb
       0x104d08000 -        0x104d67fff dyld (*) <86a8ba48-8bb4-3b30-9cda-051f73c74f44> /usr/lib/dyld
       0x183282000 -        0x18328efff libsystem_pthread.dylib (*) <4786e19a-9312-38e6-80ef-9c1394548118> /usr/lib/system/libsystem_pthread.dylib
       0x1832d0000 -        0x183813fff com.apple.CoreFoundation (6.9) <b2ff96d0-ae99-31ef-9014-fc9964b4f3e0> /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation
       0x195da2000 -        0x195de0fff com.apple.DebugSymbols (195.1) <2a13cd68-d1d3-3765-9434-36e6b3a45663> /System/Library/PrivateFrameworks/DebugSymbols.framework/Versions/A/DebugSymbols
       0x1831ce000 -        0x183231fff libc++.1.dylib (*) <3ad094c9-4883-394c-af5a-2b9a5bdfe45b> /usr/lib/libc++.1.dylib
               0x0 - 0xffffffffffffffff ??? (*) <00000000-0000-0000-0000-000000000000> ???

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: 2
    thread_create: 0
    thread_set_state: 14

VM Region Summary:
ReadOnly portion of Libraries: Total=757.0M resident=0K(0%) swapped_out_or_unallocated=757.0M(100%)
Writable regions: Total=983.9M written=0K(0%) resident=0K(0%) swapped_out=0K(0%) unallocated=983.9M(100%)

                                VIRTUAL   REGION 
REGION TYPE                        SIZE    COUNT (non-coalesced) 
===========                     =======  ======= 
Activity Tracing                   256K        1 
Kernel Alloc Once                   32K        1 
MALLOC                           208.2M       26 
MALLOC guard page                   96K        5 
MALLOC_MEDIUM (reserved)         360.0M        3         reserved VM address space (unallocated)
MALLOC_NANO (reserved)           384.0M        1         reserved VM address space (unallocated)
STACK GUARD                       56.2M       14 
Stack                             29.9M       14 
VM_ALLOCATE                        1.0G        2 
__AUTH                             222K       49 
__AUTH_CONST                      2898K      128 
__DATA                            2288K      126 
__DATA_CONST                      9153K      133 
__DATA_DIRTY                       240K       51 
__LINKEDIT                       593.9M        6 
__OBJC_CONST                       259K       29 
__OBJC_RO                         81.8M        1 
__OBJC_RW                         3088K        1 
__TEXT                           163.1M      139 
__UNICODE                          588K        1 
dyld private memory               2048K        2 
mapped file                       35.3M        9 
shared memory                      624K        7 
===========                     =======  ======= 
TOTAL                              2.9G      749 
TOTAL, minus reserved VM space     2.2G      749 



-----------
Full Report
-----------

{"app_name":"lldb","timestamp":"2021-10-23 20:30:08.00 -0700","app_version":"","slice_uuid":"f4ee89ea-fe5b-329b-b848-d7cdcea4123f","build_version":"","platform":1,"share_with_app_devs":0,"is_first_party":1,"bug_type":"309","os_version":"macOS 12.0.1 (21A559)","incident_id":"E2692442-3A11-43D9-9072-1BEA007E9B79","name":"lldb"}
{
  "uptime" : 4000,
  "procLaunch" : "2021-10-23 20:30:04.8749 -0700",
  "procRole" : "Unspecified",
  "version" : 2,
  "userID" : 501,
  "deployVersion" : 210,
  "modelCode" : "MacBookPro17,1",
  "procStartAbsTime" : 97203577581,
  "coalitionID" : 962,
  "osVersion" : {
    "train" : "macOS 12.0.1",
    "build" : "21A559",
    "releaseType" : "User"
  },
  "captureTime" : "2021-10-23 20:30:08.6105 -0700",
  "incident" : "E2692442-3A11-43D9-9072-1BEA007E9B79",
  "bug_type" : "309",
  "pid" : 3215,
  "procExitAbsTime" : 97293218100,
  "translated" : false,
  "cpuType" : "ARM-64",
  "procName" : "lldb",
  "procPath" : "\/Applications\/Xcode-beta.app\/Contents\/Developer\/usr\/bin\/lldb",
  "parentProc" : "zsh",
  "parentPid" : 975,
  "coalitionName" : "com.googlecode.iterm2",
  "crashReporterKey" : "B045E435-B976-0C10-F4E7-99CA5746C6FB",
  "responsiblePid" : 970,
  "responsibleProc" : "iTerm2",
  "wakeTime" : 751,
  "sleepWakeUUID" : "270A104D-542D-4E13-8EC3-51A0F12F6AF0",
  "sip" : "enabled",
  "vmRegionInfo" : "0x107694000 is in 0x107694000-0x10785c000;  bytes after start: 0  bytes before end: 1867775\n      REGION TYPE                    START - END         [ VSIZE] PRT\/MAX SHRMOD  REGION DETAIL\n      mapped file                 107658000-107694000    [  240K] rw-\/rwx SM=COW  ...t_id=60ec5e97\n--->  mapped file                 107694000-10785c000    [ 1824K] rw-\/rwx SM=COW  ...t_id=61ece197\n      GAP OF 0xb7e8000 BYTES\n      __TEXT                      113044000-118160000    [ 81.1M] r-x\/rwx SM=COW  ...rsions\/A\/LLDB",
  "isCorpse" : 1,
  "exception" : {"codes":"0x0000000000000032, 0x0000000107694000","rawCodes":[50,4419305472],"type":"EXC_BAD_ACCESS","signal":"SIGKILL (Code Signature Invalid)","subtype":"UNKNOWN_0x32 at 0x0000000107694000"},
  "termination" : {"namespace":"CODESIGNING","flags":0,"code":2},
  "vmregioninfo" : "0x107694000 is in 0x107694000-0x10785c000;  bytes after start: 0  bytes before end: 1867775\n      REGION TYPE                    START - END         [ VSIZE] PRT\/MAX SHRMOD  REGION DETAIL\n      mapped file                 107658000-107694000    [  240K] rw-\/rwx SM=COW  ...t_id=60ec5e97\n--->  mapped file                 107694000-10785c000    [ 1824K] rw-\/rwx SM=COW  ...t_id=61ece197\n      GAP OF 0xb7e8000 BYTES\n      __TEXT                      113044000-118160000    [ 81.1M] r-x\/rwx SM=COW  ...rsions\/A\/LLDB",
  "extMods" : {"caller":{"thread_create":0,"thread_set_state":0,"task_for_pid":0},"system":{"thread_create":0,"thread_set_state":14,"task_for_pid":2},"targeted":{"thread_create":0,"thread_set_state":0,"task_for_pid":0},"warnings":0},
  "faultingThread" : 12,
  "threads" : [{"id":44713,"queue":"com.apple.main-thread","frames":[{"imageOffset":48440,"symbol":"__select","symbolLocation":8,"imageIndex":0},{"imageOffset":4757320,"symbol":"SelectHelper::Select()","symbolLocation":1324,"imageIndex":1},{"imageOffset":4193680,"symbol":"IOHandlerProcessSTDIO::Run()","symbolLocation":488,"imageIndex":1},{"imageOffset":2783120,"symbol":"lldb_private::Debugger::RunIOHandlers()","symbolLocation":140,"imageIndex":1},{"imageOffset":3628340,"symbol":"lldb_private::CommandInterpreter::RunCommandInterpreter(lldb_private::CommandInterpreterRunOptions&)","symbolLocation":160,"imageIndex":1},{"imageOffset":627948,"symbol":"lldb::SBDebugger::RunCommandInterpreter(bool, bool)","symbolLocation":192,"imageIndex":1},{"imageOffset":28496,"symbol":"Driver::MainLoop()","symbolLocation":2452,"imageIndex":2},{"imageOffset":34824,"symbol":"main","symbolLocation":2180,"imageIndex":2},{"imageOffset":20724,"symbol":"start","symbolLocation":520,"imageIndex":3}]},{"id":44716,"frames":[{"imageOffset":8892,"symbol":"start_wqthread","symbolLocation":0,"imageIndex":4}]},{"id":44717,"frames":[{"imageOffset":8892,"symbol":"start_wqthread","symbolLocation":0,"imageIndex":4}]},{"id":44719,"frames":[{"imageOffset":6484,"symbol":"mach_msg_trap","symbolLocation":8,"imageIndex":0},{"imageOffset":7424,"symbol":"mach_msg","symbolLocation":76,"imageIndex":0},{"imageOffset":544312,"symbol":"__CFRunLoopServiceMachPort","symbolLocation":372,"imageIndex":5},{"imageOffset":537328,"symbol":"__CFRunLoopRun","symbolLocation":1212,"imageIndex":5},{"imageOffset":534164,"symbol":"CFRunLoopRunSpecific","symbolLocation":600,"imageIndex":5},{"imageOffset":1109032,"symbol":"CFRunLoopRun","symbolLocation":64,"imageIndex":5},{"imageOffset":8648,"symbol":"SpotlightQueryThread(void*)","symbolLocation":564,"imageIndex":6},{"imageOffset":29932,"symbol":"_pthread_start","symbolLocation":148,"imageIndex":4},{"imageOffset":8912,"symbol":"thread_start","symbolLocation":8,"imageIndex":4}]},{"id":44720,"frames":[{"imageOffset":8892,"symbol":"start_wqthread","symbolLocation":0,"imageIndex":4}]},{"id":44731,"frames":[{"imageOffset":8892,"symbol":"start_wqthread","symbolLocation":0,"imageIndex":4}]},{"id":44732,"frames":[{"imageOffset":8892,"symbol":"start_wqthread","symbolLocation":0,"imageIndex":4}]},{"id":44733,"frames":[{"imageOffset":8892,"symbol":"start_wqthread","symbolLocation":0,"imageIndex":4}]},{"id":44734,"frames":[{"imageOffset":8892,"symbol":"start_wqthread","symbolLocation":0,"imageIndex":4}]},{"id":44735,"frames":[{"imageOffset":8892,"symbol":"start_wqthread","symbolLocation":0,"imageIndex":4}]},{"id":44736,"name":"lldb.debugger.event-handler","frames":[{"imageOffset":20672,"symbol":"__psynch_cvwait","symbolLocation":8,"imageIndex":0},{"imageOffset":31412,"symbol":"_pthread_cond_wait","symbolLocation":1228,"imageIndex":4},{"imageOffset":40412,"symbol":"std::__1::condition_variable::wait(std::__1::unique_lock<std::__1::mutex>&)","symbolLocation":28,"imageIndex":7},{"imageOffset":4669696,"symbol":"lldb_private::Listener::GetEventInternal(lldb_private::Timeout<std::__1::ratio<1l, 1000000l> > const&, lldb_private::Broadcaster*, lldb_private::ConstString const*, unsigned int, unsigned int, std::__1::shared_ptr<lldb_private::Event>&)","symbolLocation":440,"imageIndex":1},{"imageOffset":2792376,"symbol":"lldb_private::Debugger::DefaultEventHandler()","symbolLocation":252,"imageIndex":1},{"imageOffset":2793080,"symbol":"lldb_private::Debugger::EventHandlerThread(void*)","symbolLocation":12,"imageIndex":1},{"imageOffset":3456556,"symbol":"lldb_private::HostNativeThreadBase::ThreadCreateTrampoline(void*)","symbolLocation":104,"imageIndex":1},{"imageOffset":29932,"symbol":"_pthread_start","symbolLocation":148,"imageIndex":4},{"imageOffset":8912,"symbol":"thread_start","symbolLocation":8,"imageIndex":4}]},{"id":44759,"name":"<lldb.process.gdb-remote.async>","frames":[{"imageOffset":20672,"symbol":"__psynch_cvwait","symbolLocation":8,"imageIndex":0},{"imageOffset":31412,"symbol":"_pthread_cond_wait","symbolLocation":1228,"imageIndex":4},{"imageOffset":40412,"symbol":"std::__1::condition_variable::wait(std::__1::unique_lock<std::__1::mutex>&)","symbolLocation":28,"imageIndex":7},{"imageOffset":4669696,"symbol":"lldb_private::Listener::GetEventInternal(lldb_private::Timeout<std::__1::ratio<1l, 1000000l> > const&, lldb_private::Broadcaster*, lldb_private::ConstString const*, unsigned int, unsigned int, std::__1::shared_ptr<lldb_private::Event>&)","symbolLocation":440,"imageIndex":1},{"imageOffset":6828244,"symbol":"lldb_private::process_gdb_remote::ProcessGDBRemote::AsyncThread(void*)","symbolLocation":284,"imageIndex":1},{"imageOffset":3456556,"symbol":"lldb_private::HostNativeThreadBase::ThreadCreateTrampoline(void*)","symbolLocation":104,"imageIndex":1},{"imageOffset":29932,"symbol":"_pthread_start","symbolLocation":148,"imageIndex":4},{"imageOffset":8912,"symbol":"thread_start","symbolLocation":8,"imageIndex":4}]},{"triggered":true,"id":44761,"name":"<lldb.process.internal-state(pid=3219)>","threadState":{"x":[{"value":5653991688},{"value":6115823664},{"value":0},{"value":1859888},{"value":1859888},{"value":6115824592},{"value":0},{"value":105553174806912},{"value":0},{"value":4419305472},{"value":4},{"value":44761},{"value":73896},{"value":8},{"value":44761},{"value":3331},{"value":10823836232},{"value":8009465656},{"value":0},{"value":5653990912},{"value":5653991600},{"value":5653991688},{"value":5653991104},{"value":6115824576},{"value":0},{"value":5653991600},{"value":3},{"value":6115824504},{"value":6115824592}],"flavor":"ARM_THREAD_STATE64","lr":{"value":4620395356},"cpsr":{"value":536875008},"fp":{"value":6115823776},"sp":{"value":6115823136},"esr":{"value":2449473543,"description":"(Data Abort) byte read Translation fault"},"pc":{"value":4618651672,"matchesCrashFrame":1},"far":{"value":4419305472}},"frames":[{"imageOffset":4638744,"symbol":"lldb_private::DataExtractor::GetU32(unsigned long long*) const","symbolLocation":52,"imageIndex":1},{"imageOffset":6382428,"symbol":"ObjectFileMachO::ParseHeader()","symbolLocation":96,"imageIndex":1},{"imageOffset":6375288,"symbol":"ObjectFileMachO::CreateInstance(std::__1::shared_ptr<lldb_private::Module> const&, std::__1::shared_ptr<lldb_private::DataBuffer>&, unsigned long long, lldb_private::FileSpec const*, unsigned long long, unsigned long long)","symbolLocation":644,"imageIndex":1},{"imageOffset":3879016,"symbol":"lldb_private::ObjectFile::FindPlugin(std::__1::shared_ptr<lldb_private::Module> const&, lldb_private::FileSpec const*, unsigned long long, unsigned long long, std::__1::shared_ptr<lldb_private::DataBuffer>&, unsigned long long&)","symbolLocation":1184,"imageIndex":1},{"imageOffset":2963564,"symbol":"lldb_private::Module::GetObjectFile()","symbolLocation":300,"imageIndex":1},{"imageOffset":2983072,"symbol":"lldb_private::ModuleList::GetSharedModule(lldb_private::ModuleSpec const&, std::__1::shared_ptr<lldb_private::Module>&, lldb_private::FileSpecList const*, llvm::SmallVectorImpl<std::__1::shared_ptr<lldb_private::Module> >*, bool*, bool)","symbolLocation":1232,"imageIndex":1},{"imageOffset":4363620,"symbol":"lldb_private::Target::GetOrCreateModule(lldb_private::ModuleSpec const&, bool, lldb_private::Status*)","symbolLocation":1064,"imageIndex":1},{"imageOffset":5029240,"symbol":"lldb_private::DynamicLoaderDarwin::FindTargetModuleForImageInfo(lldb_private::DynamicLoaderDarwin::ImageInfo&, bool, bool*)","symbolLocation":1248,"imageIndex":1},{"imageOffset":5044268,"symbol":"lldb_private::DynamicLoaderDarwin::AddModulesUsingImageInfos(std::__1::vector<lldb_private::DynamicLoaderDarwin::ImageInfo, std::__1::allocator<lldb_private::DynamicLoaderDarwin::ImageInfo> >&)","symbolLocation":448,"imageIndex":1},{"imageOffset":5023628,"symbol":"DynamicLoaderMacOS::AddBinaries(std::__1::vector<unsigned long long, std::__1::allocator<unsigned long long> > const&)","symbolLocation":740,"imageIndex":1},{"imageOffset":5022472,"symbol":"DynamicLoaderMacOS::NotifyBreakpointHit(void*, lldb_private::StoppointCallbackContext*, unsigned long long, unsigned long long)","symbolLocation":1200,"imageIndex":1},{"imageOffset":2661976,"symbol":"lldb_private::BreakpointLocation::ShouldStop(lldb_private::StoppointCallbackContext*)","symbolLocation":248,"imageIndex":1},{"imageOffset":2665860,"symbol":"lldb_private::BreakpointLocationCollection::ShouldStop(lldb_private::StoppointCallbackContext*)","symbolLocation":188,"imageIndex":1},{"imageOffset":2727120,"symbol":"lldb_private::BreakpointSite::ShouldStop(lldb_private::StoppointCallbackContext*)","symbolLocation":136,"imageIndex":1},{"imageOffset":4315216,"symbol":"lldb_private::StopInfoBreakpoint::ShouldStopSynchronous(lldb_private::Event*)","symbolLocation":400,"imageIndex":1},{"imageOffset":4452712,"symbol":"lldb_private::Thread::ShouldStop(lldb_private::Event*)","symbolLocation":936,"imageIndex":1},{"imageOffset":4484404,"symbol":"lldb_private::ThreadList::ShouldStop(lldb_private::Event*)","symbolLocation":824,"imageIndex":1},{"imageOffset":4158632,"symbol":"lldb_private::Process::ShouldBroadcastEvent(lldb_private::Event*)","symbolLocation":456,"imageIndex":1},{"imageOffset":4144656,"symbol":"lldb_private::Process::HandlePrivateEvent(std::__1::shared_ptr<lldb_private::Event>&)","symbolLocation":292,"imageIndex":1},{"imageOffset":4161876,"symbol":"lldb_private::Process::RunPrivateStateThread(bool)","symbolLocation":1296,"imageIndex":1},{"imageOffset":4159588,"symbol":"lldb_private::Process::PrivateStateThread(void*)","symbolLocation":28,"imageIndex":1},{"imageOffset":3456556,"symbol":"lldb_private::HostNativeThreadBase::ThreadCreateTrampoline(void*)","symbolLocation":104,"imageIndex":1},{"imageOffset":29932,"symbol":"_pthread_start","symbolLocation":148,"imageIndex":4},{"imageOffset":8912,"symbol":"thread_start","symbolLocation":8,"imageIndex":4}]},{"id":44762,"name":"<lldb.comm.process.stdio>","frames":[{"imageOffset":48440,"symbol":"__select","symbolLocation":8,"imageIndex":0},{"imageOffset":4757320,"symbol":"SelectHelper::Select()","symbolLocation":1324,"imageIndex":1},{"imageOffset":3533948,"symbol":"lldb_private::ConnectionFileDescriptor::BytesAvailable(lldb_private::Timeout<std::__1::ratio<1l, 1000000l> > const&, lldb_private::Status*)","symbolLocation":368,"imageIndex":1},{"imageOffset":3532884,"symbol":"lldb_private::ConnectionFileDescriptor::Read(void*, unsigned long, lldb_private::Timeout<std::__1::ratio<1l, 1000000l> > const&, lldb::ConnectionStatus&, lldb_private::Status*)","symbolLocation":112,"imageIndex":1},{"imageOffset":2764668,"symbol":"lldb_private::Communication::ReadThread(void*)","symbolLocation":684,"imageIndex":1},{"imageOffset":3456556,"symbol":"lldb_private::HostNativeThreadBase::ThreadCreateTrampoline(void*)","symbolLocation":104,"imageIndex":1},{"imageOffset":29932,"symbol":"_pthread_start","symbolLocation":148,"imageIndex":4},{"imageOffset":8912,"symbol":"thread_start","symbolLocation":8,"imageIndex":4}]}],
  "usedImages" : [
  {
    "source" : "P",
    "arch" : "arm64e",
    "base" : 6495191040,
    "size" : 221184,
    "uuid" : "c8524c02-b14f-30bd-a228-c44b4a448e68",
    "path" : "\/usr\/lib\/system\/libsystem_kernel.dylib",
    "name" : "libsystem_kernel.dylib"
  },
  {
    "source" : "P",
    "arch" : "arm64",
    "base" : 4614012928,
    "CFBundleShortVersionString" : "1300.0.20.8",
    "CFBundleIdentifier" : "com.apple.LLDB.framework",
    "size" : 85049344,
    "uuid" : "1f4d3fb4-d0ec-3deb-8aca-be56bf8e27e6",
    "path" : "\/Applications\/Xcode-beta.app\/Contents\/SharedFrameworks\/LLDB.framework\/Versions\/A\/LLDB",
    "name" : "LLDB",
    "CFBundleVersion" : "1300.0.20.8"
  },
  {
    "source" : "P",
    "arch" : "arm64",
    "base" : 4373643264,
    "size" : 245760,
    "uuid" : "f4ee89ea-fe5b-329b-b848-d7cdcea4123f",
    "path" : "\/Applications\/Xcode-beta.app\/Contents\/Developer\/usr\/bin\/lldb",
    "name" : "lldb"
  },
  {
    "source" : "P",
    "arch" : "arm64e",
    "base" : 4375740416,
    "size" : 393216,
    "uuid" : "86a8ba48-8bb4-3b30-9cda-051f73c74f44",
    "path" : "\/usr\/lib\/dyld",
    "name" : "dyld"
  },
  {
    "source" : "P",
    "arch" : "arm64e",
    "base" : 6495412224,
    "size" : 53248,
    "uuid" : "4786e19a-9312-38e6-80ef-9c1394548118",
    "path" : "\/usr\/lib\/system\/libsystem_pthread.dylib",
    "name" : "libsystem_pthread.dylib"
  },
  {
    "source" : "P",
    "arch" : "arm64e",
    "base" : 6495731712,
    "CFBundleShortVersionString" : "6.9",
    "CFBundleIdentifier" : "com.apple.CoreFoundation",
    "size" : 5521408,
    "uuid" : "b2ff96d0-ae99-31ef-9014-fc9964b4f3e0",
    "path" : "\/System\/Library\/Frameworks\/CoreFoundation.framework\/Versions\/A\/CoreFoundation",
    "name" : "CoreFoundation",
    "CFBundleVersion" : "1855.105"
  },
  {
    "source" : "P",
    "arch" : "arm64e",
    "base" : 6809067520,
    "CFBundleShortVersionString" : "195.1",
    "CFBundleIdentifier" : "com.apple.DebugSymbols",
    "size" : 258048,
    "uuid" : "2a13cd68-d1d3-3765-9434-36e6b3a45663",
    "path" : "\/System\/Library\/PrivateFrameworks\/DebugSymbols.framework\/Versions\/A\/DebugSymbols",
    "name" : "DebugSymbols",
    "CFBundleVersion" : "195.1"
  },
  {
    "source" : "P",
    "arch" : "arm64e",
    "base" : 6494674944,
    "size" : 409600,
    "uuid" : "3ad094c9-4883-394c-af5a-2b9a5bdfe45b",
    "path" : "\/usr\/lib\/libc++.1.dylib",
    "name" : "libc++.1.dylib"
  },
  {
    "size" : 0,
    "source" : "A",
    "base" : 0,
    "uuid" : "00000000-0000-0000-0000-000000000000"
  }
],
  "sharedCache" : {
  "base" : 6492241920,
  "size" : 3072180224,
  "uuid" : "a6162d66-93e3-3251-93cc-b11f7c8c830e"
},
  "vmSummary" : "ReadOnly portion of Libraries: Total=757.0M resident=0K(0%) swapped_out_or_unallocated=757.0M(100%)\nWritable regions: Total=983.9M written=0K(0%) resident=0K(0%) swapped_out=0K(0%) unallocated=983.9M(100%)\n\n                                VIRTUAL   REGION \nREGION TYPE                        SIZE    COUNT (non-coalesced) \n===========                     =======  ======= \nActivity Tracing                   256K        1 \nKernel Alloc Once                   32K        1 \nMALLOC                           208.2M       26 \nMALLOC guard page                   96K        5 \nMALLOC_MEDIUM (reserved)         360.0M        3         reserved VM address space (unallocated)\nMALLOC_NANO (reserved)           384.0M        1         reserved VM address space (unallocated)\nSTACK GUARD                       56.2M       14 \nStack                             29.9M       14 \nVM_ALLOCATE                        1.0G        2 \n__AUTH                             222K       49 \n__AUTH_CONST                      2898K      128 \n__DATA                            2288K      126 \n__DATA_CONST                      9153K      133 \n__DATA_DIRTY                       240K       51 \n__LINKEDIT                       593.9M        6 \n__OBJC_CONST                       259K       29 \n__OBJC_RO                         81.8M        1 \n__OBJC_RW                         3088K        1 \n__TEXT                           163.1M      139 \n__UNICODE                          588K        1 \ndyld private memory               2048K        2 \nmapped file                       35.3M        9 \nshared memory                      624K        7 \n===========                     =======  ======= \nTOTAL                              2.9G      749 \nTOTAL, minus reserved VM space     2.2G      749 \n",
  "legacyInfo" : {
  "threadTriggered" : {
    "name" : "<lldb.process.internal-state(pid=3219)>"
  }
},
  "trialInfo" : {
  "rollouts" : [
    {
      "rolloutId" : "601d9415f79519000ccd4b69",
      "factorPackIds" : {
        "SIRI_TEXT_TO_SPEECH" : "61704b7f20024a1072784bb1"
      },
      "deploymentId" : 250000291
    },
    {
      "rolloutId" : "5fc94383418129005b4e9ae0",
      "factorPackIds" : {

      },
      "deploymentId" : 250000144
    },
    {
      "rolloutId" : "607844aa04477260f58a8077",
      "factorPackIds" : {
        "SIRI_MORPHUN_ASSETS" : "60ef663fa2f864203caf575c"
      },
      "deploymentId" : 250000055
    },
    {
      "rolloutId" : "5ffde50ce2aacd000d47a95f",
      "factorPackIds" : {

      },
      "deploymentId" : 250000063
    },
    {
      "rolloutId" : "602ad4dac86151000cf27e46",
      "factorPackIds" : {
        "SIRI_DICTATION_ASSETS" : "6164895f5c43822edc9b3d8d"
      },
      "deploymentId" : 250000232
    },
    {
      "rolloutId" : "60da5e84ab0ca017dace9abf",
      "factorPackIds" : {

      },
      "deploymentId" : 250000007
    },
    {
      "rolloutId" : "60356660bbe37970735c5624",
      "factorPackIds" : {

      },
      "deploymentId" : 250000013
    }
  ],
  "experiments" : [

  ]
}
}

The solution was to downgrade to 3.4.7.

All of my versions of cryptography I downloaded through conda on the conda-forge channel. A full basic environment to reproduce this is:

# packages in environment at /Users/jcroteau/miniforge3/envs/cryptography:
#
# Name                    Version                   Build  Channel
ca-certificates           2021.10.8            h4653dfc_0    conda-forge
cffi                      1.14.6           py39h52b1de0_1    conda-forge
cryptography              35.0.0           py39h73257c9_0    conda-forge
libcxx                    12.0.1               h168391b_0    conda-forge
libffi                    3.4.2                hbdafb3b_4    conda-forge
libzlib                   1.2.11            hee7b306_1013    conda-forge
ncurses                   6.2                  h9aa5885_4    conda-forge
openssl                   1.1.1l               h3422bc3_0    conda-forge
pip                       21.3.1             pyhd8ed1ab_0    conda-forge
pycparser                 2.20               pyh9f0ad1d_2    conda-forge
python                    3.9.7           h54d631c_3_cpython    conda-forge
python_abi                3.9                      2_cp39    conda-forge
readline                  8.1                  hedafd6a_0    conda-forge
setuptools                58.2.0           py39h2804cbe_0    conda-forge
sqlite                    3.36.0               h72a2b83_2    conda-forge
tk                        8.6.11               he1e0b03_1    conda-forge
tzdata                    2021e                he74cb21_0    conda-forge
wheel                     0.37.0             pyhd8ed1ab_1    conda-forge
xz                        5.2.5                h642e427_1    conda-forge
zlib                      1.2.11            hee7b306_1013    conda-forge

This probably only happens on M1 macs. I am not sure of earlier versions, as I upgraded to Monterey beta a few days ago and had not tried to use tensorboard before that. I am running macOS 12.0.1 on a 16GB 2020 M1 MacBook Pro.

TLDR: To reproduce this:

  1. You will need an M1 Mac running OS 12.0 or later.
  2. Create a conda environment (I used miniforge 3)
  3. conda install -c anaconda cryptography
  4. From a python shell, import cryptography.hazmat.bindings._rust
  5. The python process should be immediately killed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions