vpn-slice icon indicating copy to clipboard operation
vpn-slice copied to clipboard

Python crashes on macOS 26 Tahoe when using --prevent-idle-timeout

Open drummingdemon opened this issue 3 months ago • 9 comments

Using --prevent-idle-timeout causes Python to crash under macOS 26.0 Tahoe - this sadly also means that the keepalive isn't working.

Installed via brew and have Python 3.13.7 running.

Crashlog as follows:

-------------------------------------
Translated Report (Full Report Below)
-------------------------------------
Process:             Python [27006]
Path:                /opt/homebrew/*/Python.framework/Versions/3.13/Resources/Python.app/Contents/MacOS/Python
Identifier:          org.python.python
Version:             3.13.7 (3.13.7)
Code Type:           ARM-64 (Native)
Role:                Unspecified
Parent Process:      launchd [1]
Coalition:           com.googlecode.iterm2 [1086]
Responsible Process: iTerm2 [961]
User ID:             0

Date/Time:           2025-09-22 22:44:56.9031 +0200
Launch Time:         2025-09-22 22:44:53.7136 +0200
Hardware Model:      Mac16,8
OS Version:          macOS 26.0 (25A354)
Release Type:        User

Crash Reporter Key:  4B02FB80-3FD7-F356-3900-5446B13A4D73
Incident Identifier: F567E279-5456-4930-BFC6-B0AE5410AA02

Time Awake Since Boot: 1600 seconds

System Integrity Protection: enabled

Triggered by Thread: 0

Exception Type:    EXC_BAD_ACCESS (SIGSEGV)
Exception Subtype: KERN_INVALID_ADDRESS at 0x00000001030108c9
Exception Codes:   0x0000000000000001, 0x00000001030108c9

Termination Reason:  Namespace SIGNAL, Code 11, Segmentation fault: 11
Terminating Process: exc handler [27006]


VM Region Info: 0x1030108c9 is not in any region.  Bytes after previous region: 2250  Bytes before following region: 325431
      REGION TYPE                    START - END         [ VSIZE] PRT/MAX SHRMOD  REGION DETAIL
      __LINKEDIT                  103008000-103010000    [   32K] r--/rwx SM=COW  /opt/homebrew/*/Python.framework/Versions/3.13/lib/python3.13/lib-dynload/select.cpython-313-darwin.so
--->  GAP OF 0x50000 BYTES
      shared memory               103060000-103070000    [   64K] r--/r-- SM=SHM  

Application Specific Information:
*** multi-threaded process forked ***
crashed on child side of fork pre-exec


Thread 0 Crashed:
0   libsystem_trace.dylib         	       0x199bcd194 _os_log_preferences_refresh + 56
1   libsystem_trace.dylib         	       0x199bcdafc os_log_type_enabled + 768
2   CoreFoundation                	       0x199ff8894 _CFPlugInUnscheduleForUnloading + 92
3   CoreFoundation                	       0x199fa9310 _CFBundleLoadExecutableAndReturnError + 176
4   CoreFoundation                	       0x199f8354c CFBundleGetFunctionPointerForName + 52
5   _setproctitle.cpython-313-darwin.so	       0x102fe30e8 darwin_set_process_title + 104
6   _setproctitle.cpython-313-darwin.so	       0x102fe395c set_ps_display + 104
7   _setproctitle.cpython-313-darwin.so	       0x102fe32d8 spt_setproctitle + 88
8   Python                        	       0x10313d39c cfunction_call + 76
9   Python                        	       0x1030dfa34 _PyObject_MakeTpCall + 120
10  Python                        	       0x1032092e8 _PyEval_EvalFrameDefault + 6856
11  Python                        	       0x1032075a4 PyEval_EvalCode + 200
12  Python                        	       0x103277d04 run_eval_code_obj + 104
13  Python                        	       0x10327774c run_mod + 168
14  Python                        	       0x103275df4 pyrun_file + 164
15  Python                        	       0x103275130 _PyRun_SimpleFileObject + 256
16  Python                        	       0x103274d68 _PyRun_AnyFileObject + 80
17  Python                        	       0x10329c9e0 pymain_run_file_obj + 164
18  Python                        	       0x10329c68c pymain_run_file + 76
19  Python                        	       0x10329b8fc Py_RunMain + 968
20  Python                        	       0x10329bef8 pymain_main + 304
21  Python                        	       0x10329bf98 Py_BytesMain + 40
22  dyld                          	       0x199ae1d54 start + 7184


Thread 0 crashed with ARM Thread State (64-bit):
    x0: 0x000000020684c8ac   x1: 0x0000000199be7f43   x2: 0x0000000001000104   x3: 0x0000000000000000
    x4: 0x0000000199be7f05   x5: 0x000000016d61eba0   x6: 0x0000000000000074   x7: 0x0000000000000000
    x8: 0x00000001030108c7   x9: 0x00000002068589a8  x10: 0x0000000000000001  x11: 0x00000008772b8070
   x12: 0x0000000000000001  x13: 0x0000000877011e60  x14: 0xaaaaaaaaaaaaaaaa  x15: 0x0000000199be7707
   x16: 0x0000000199e5e608  x17: 0x0000000207e81ed8  x18: 0x0000000000000000  x19: 0x00000008772b8040
   x20: 0x00000001030108cb  x21: 0x0000000fffffc104  x22: 0x0000000000000000  x23: 0x0000000000000001
   x24: 0x0000000000000000  x25: 0x000000010313d350  x26: 0x0000000102908278  x27: 0x0000000000000135
   x28: 0x00000001034d7af0   fp: 0x000000016d61f040   lr: 0x0000000199bcd180
    sp: 0x000000016d61f000   pc: 0x0000000199bcd194 cpsr: 0x20000000
   far: 0x00000001030108c9  esr: 0x92000007 (Data Abort) byte read Translation fault

Binary Images:
       0x1027dc000 -        0x1027dffff org.python.python (3.13.7) <f0277575-a537-3f79-99db-ddc6aa2557c5> /opt/homebrew/*/Python.framework/Versions/3.13/Resources/Python.app/Contents/MacOS/Python
       0x103080000 -        0x10340bfff org.python.python (3.13.7, (c) 2001-2024 Python Software Foundation.) <e646f4c0-e043-33df-96c3-b16761745af4> /opt/homebrew/*/Python.framework/Versions/3.13/Python
       0x102c98000 -        0x102ca3fff math.cpython-313-darwin.so (*) <40160c7c-5172-3af7-bb9b-93a96e74c6c9> /opt/homebrew/*/Python.framework/Versions/3.13/lib/python3.13/lib-dynload/math.cpython-313-darwin.so
       0x102b24000 -        0x102b27fff _bisect.cpython-313-darwin.so (*) <905cd86b-6d43-38b0-b621-fcd8cda81842> /opt/homebrew/*/Python.framework/Versions/3.13/lib/python3.13/lib-dynload/_bisect.cpython-313-darwin.so
       0x102cb4000 -        0x102cb7fff _random.cpython-313-darwin.so (*) <36fadcc4-1773-33ad-a7f0-1332900f340b> /opt/homebrew/*/Python.framework/Versions/3.13/lib/python3.13/lib-dynload/_random.cpython-313-darwin.so
       0x102fb8000 -        0x102fbbfff fcntl.cpython-313-darwin.so (*) <00837420-ce6a-3c67-bb0f-74470aec0f95> /opt/homebrew/*/Python.framework/Versions/3.13/lib/python3.13/lib-dynload/fcntl.cpython-313-darwin.so
       0x102fcc000 -        0x102fcffff _posixsubprocess.cpython-313-darwin.so (*) <e9a7c27e-635f-367b-ad2a-157ccfaba362> /opt/homebrew/*/Python.framework/Versions/3.13/lib/python3.13/lib-dynload/_posixsubprocess.cpython-313-darwin.so
       0x102ff8000 -        0x102ffffff select.cpython-313-darwin.so (*) <62e107a6-0ba5-3d00-ae35-550d917bf5d7> /opt/homebrew/*/Python.framework/Versions/3.13/lib/python3.13/lib-dynload/select.cpython-313-darwin.so
       0x102fe0000 -        0x102fe3fff _setproctitle.cpython-313-darwin.so (*) <9d1543f0-0c3f-33c2-b4c6-b716ab150bed> /opt/homebrew/*/_setproctitle.cpython-313-darwin.so
       0x109c2c000 -        0x109c33fff zlib.cpython-313-darwin.so (*) <877cf895-77e8-3491-9fba-79a3b496a6c0> /opt/homebrew/*/Python.framework/Versions/3.13/lib/python3.13/lib-dynload/zlib.cpython-313-darwin.so
       0x109c44000 -        0x109c47fff _bz2.cpython-313-darwin.so (*) <3627f2b9-2d25-3e83-880f-a78de4c7ac26> /opt/homebrew/*/Python.framework/Versions/3.13/lib/python3.13/lib-dynload/_bz2.cpython-313-darwin.so
       0x109ca0000 -        0x109ca7fff _lzma.cpython-313-darwin.so (*) <9fd139ad-6a53-367e-ae08-a558e347ba0b> /opt/homebrew/*/Python.framework/Versions/3.13/lib/python3.13/lib-dynload/_lzma.cpython-313-darwin.so
       0x109ce8000 -        0x109d07fff liblzma.5.dylib (*) <6b34bd7f-9320-3883-9a5d-e8542c9b17ca> /opt/homebrew/*/liblzma.5.dylib
       0x109ed0000 -        0x109f77fff unicodedata.cpython-313-darwin.so (*) <107fde6d-dd69-3dd0-9e12-1d95f3662c75> /opt/homebrew/*/Python.framework/Versions/3.13/lib/python3.13/lib-dynload/unicodedata.cpython-313-darwin.so
       0x109c58000 -        0x109c5ffff _struct.cpython-313-darwin.so (*) <d630a783-735a-3103-8e00-75727e430c71> /opt/homebrew/*/Python.framework/Versions/3.13/lib/python3.13/lib-dynload/_struct.cpython-313-darwin.so
       0x109cb8000 -        0x109cbffff _json.cpython-313-darwin.so (*) <de42b229-8e10-318f-999f-1d97c23e9896> /opt/homebrew/*/Python.framework/Versions/3.13/lib/python3.13/lib-dynload/_json.cpython-313-darwin.so
       0x109cd0000 -        0x109cd3fff _opcode.cpython-313-darwin.so (*) <813779d8-c5f6-3c3c-be70-7bdc65f95b90> /opt/homebrew/*/Python.framework/Versions/3.13/lib/python3.13/lib-dynload/_opcode.cpython-313-darwin.so
       0x109e18000 -        0x109e1bfff grp.cpython-313-darwin.so (*) <2ea34420-2599-33fc-b078-e38934332305> /opt/homebrew/*/Python.framework/Versions/3.13/lib/python3.13/lib-dynload/grp.cpython-313-darwin.so
       0x109e2c000 -        0x109e2ffff binascii.cpython-313-darwin.so (*) <218877d3-5451-3e71-8bde-2848399a64ea> /opt/homebrew/*/Python.framework/Versions/3.13/lib/python3.13/lib-dynload/binascii.cpython-313-darwin.so
       0x109e40000 -        0x109e43fff _contextvars.cpython-313-darwin.so (*) <62fb2c80-0e53-3262-82f4-5e6433558b1f> /opt/homebrew/*/Python.framework/Versions/3.13/lib/python3.13/lib-dynload/_contextvars.cpython-313-darwin.so
       0x109e78000 -        0x109e87fff _socket.cpython-313-darwin.so (*) <fcc503ae-f210-3a9c-8489-972bb6f85131> /opt/homebrew/*/Python.framework/Versions/3.13/lib/python3.13/lib-dynload/_socket.cpython-313-darwin.so
       0x109e54000 -        0x109e5bfff array.cpython-313-darwin.so (*) <3741b560-be28-3f72-a17f-8459b56eb459> /opt/homebrew/*/Python.framework/Versions/3.13/lib/python3.13/lib-dynload/array.cpython-313-darwin.so
       0x10a288000 -        0x10a28ffff _hashlib.cpython-313-darwin.so (*) <9d177afc-73f6-3447-84af-42e7692c3682> /opt/homebrew/*/Python.framework/Versions/3.13/lib/python3.13/lib-dynload/_hashlib.cpython-313-darwin.so
       0x10a724000 -        0x10aa43fff libcrypto.3.dylib (*) <9592f20b-3723-37b5-8658-0022299140e8> /opt/homebrew/*/libcrypto.3.dylib
       0x109e9c000 -        0x109ea3fff _blake2.cpython-313-darwin.so (*) <c1d9619d-2b33-3e19-913e-b2424276f3cd> /opt/homebrew/*/Python.framework/Versions/3.13/lib/python3.13/lib-dynload/_blake2.cpython-313-darwin.so
       0x10a2dc000 -        0x10a2f7fff _ssl.cpython-313-darwin.so (*) <c9759be7-2b4a-3c5f-a2e0-9ba14ca981a0> /opt/homebrew/*/Python.framework/Versions/3.13/lib/python3.13/lib-dynload/_ssl.cpython-313-darwin.so
       0x10a3f0000 -        0x10a47ffff libssl.3.dylib (*) <ab8e815f-a938-3f54-8e8d-5c832389da98> /opt/homebrew/*/libssl.3.dylib
       0x199bc9000 -        0x199be97df libsystem_trace.dylib (*) <28139651-ffe2-3795-95ac-1c7cb27a3a9b> /usr/lib/system/libsystem_trace.dylib
       0x199ee0000 -        0x19a42cf7f com.apple.CoreFoundation (6.9) <edb39786-80b1-3bff-b6c3-e33f2e3ca867> /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation
       0x199ad9000 -        0x199b77f73 dyld (*) <abfd3247-50ac-3c8e-b72a-83710166e982> /usr/lib/dyld
               0x0 - 0xffffffffffffffff ??? (*) <00000000-0000-0000-0000-000000000000> ???
       0x199e5d000 -        0x199e9945f libsystem_kernel.dylib (*) <2eb73bf1-8c71-3e1f-a160-6da83dc82606> /usr/lib/system/libsystem_kernel.dylib

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=898.8M resident=0K(0%) swapped_out_or_unallocated=898.8M(100%)
Writable regions: Total=132.2M written=240K(0%) resident=240K(0%) swapped_out=0K(0%) unallocated=132.0M(100%)

                                VIRTUAL   REGION 
REGION TYPE                        SIZE    COUNT (non-coalesced) 
===========                     =======  ======= 
Activity Tracing                   256K        1 
ColorSync                           48K        2 
Kernel Alloc Once                   32K        1 
MALLOC                           105.2M       19 
MALLOC guard page                   32K        2 
STACK GUARD                         16K        1 
Stack                             17.1M        3 
Stack Guard                         32K        2 
VM_ALLOCATE                       9248K       11 
__AUTH                            1334K      157 
__AUTH_CONST                      18.4M      371 
__CTF                               824        1 
__DATA                            5616K      353 
__DATA_CONST                      16.6M      399 
__DATA_DIRTY                      1377K      314 
__FONT_DATA                        2352        1 
__LINKEDIT                       595.6M       28 
__OBJC_RO                         78.1M        1 
__OBJC_RW                         2561K        1 
__TEXT                           303.2M      410 
__TPRO_CONST                       128K        2 
mapped file                       44.5M        2 
page table in kernel               240K        1 
shared memory                      208K        8 
===========                     =======  ======= 
TOTAL                              1.2G     2091 


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

{"app_name":"Python","timestamp":"2025-09-22 22:44:57.00 +0200","app_version":"3.13.7","slice_uuid":"f0277575-a537-3f79-99db-ddc6aa2557c5","build_version":"3.13.7","platform":1,"bundleID":"org.python.python","share_with_app_devs":0,"is_first_party":0,"bug_type":"309","os_version":"macOS 26.0 (25A354)","roots_installed":0,"name":"Python","incident_id":"F567E279-5456-4930-BFC6-B0AE5410AA02"}
{
  "uptime" : 1600,
  "procRole" : "Unspecified",
  "version" : 2,
  "userID" : 0,
  "deployVersion" : 210,
  "modelCode" : "Mac16,8",
  "coalitionID" : 1086,
  "osVersion" : {
    "train" : "macOS 26.0",
    "build" : "25A354",
    "releaseType" : "User"
  },
  "captureTime" : "2025-09-22 22:44:56.9031 +0200",
  "codeSigningMonitor" : 2,
  "incident" : "F567E279-5456-4930-BFC6-B0AE5410AA02",
  "pid" : 27006,
  "translated" : false,
  "cpuType" : "ARM-64",
  "roots_installed" : 0,
  "bug_type" : "309",
  "procLaunch" : "2025-09-22 22:44:53.7136 +0200",
  "procStartAbsTime" : 39808108454,
  "procExitAbsTime" : 39884654034,
  "procName" : "Python",
  "procPath" : "\/opt\/homebrew\/*\/Python.framework\/Versions\/3.13\/Resources\/Python.app\/Contents\/MacOS\/Python",
  "bundleInfo" : {"CFBundleShortVersionString":"3.13.7","CFBundleVersion":"3.13.7","CFBundleIdentifier":"org.python.python"},
  "storeInfo" : {"deviceIdentifierForVendor":"E21980A2-B999-539A-95C9-0FF42527F759","thirdParty":true},
  "parentProc" : "launchd",
  "parentPid" : 1,
  "coalitionName" : "com.googlecode.iterm2",
  "crashReporterKey" : "4B02FB80-3FD7-F356-3900-5446B13A4D73",
  "developerMode" : 1,
  "responsiblePid" : 961,
  "responsibleProc" : "iTerm2",
  "codeSigningID" : "org.python.python",
  "codeSigningTeamID" : "",
  "codeSigningFlags" : 570425857,
  "codeSigningValidationCategory" : 10,
  "codeSigningTrustLevel" : 4294967295,
  "codeSigningAuxiliaryInfo" : 0,
  "instructionByteStream" : {"beforePC":"9E8Dqf17BKn9AwGR8wMAqs1gAJQWAEC58wsAtGgOQPmoCwC0FBEAkQ==","atPC":"FwlAOf8HAPkIZDbQAJFA+UABALThAxSqkWQAlPUDAKoAZDbQAAADkQ=="},
  "bootSessionUUID" : "A31AC4F7-82F5-401A-9DB6-C320972B3117",
  "sip" : "enabled",
  "vmRegionInfo" : "0x1030108c9 is not in any region.  Bytes after previous region: 2250  Bytes before following region: 325431\n      REGION TYPE                    START - END         [ VSIZE] PRT\/MAX SHRMOD  REGION DETAIL\n      __LINKEDIT                  103008000-103010000    [   32K] r--\/rwx SM=COW  \/opt\/homebrew\/*\/Python.framework\/Versions\/3.13\/lib\/python3.13\/lib-dynload\/select.cpython-313-darwin.so\n--->  GAP OF 0x50000 BYTES\n      shared memory               103060000-103070000    [   64K] r--\/r-- SM=SHM  ",
  "exception" : {"codes":"0x0000000000000001, 0x00000001030108c9","rawCodes":[1,4345366729],"type":"EXC_BAD_ACCESS","signal":"SIGSEGV","subtype":"KERN_INVALID_ADDRESS at 0x00000001030108c9"},
  "termination" : {"flags":0,"code":11,"namespace":"SIGNAL","indicator":"Segmentation fault: 11","byProc":"exc handler","byPid":27006},
  "vmregioninfo" : "0x1030108c9 is not in any region.  Bytes after previous region: 2250  Bytes before following region: 325431\n      REGION TYPE                    START - END         [ VSIZE] PRT\/MAX SHRMOD  REGION DETAIL\n      __LINKEDIT                  103008000-103010000    [   32K] r--\/rwx SM=COW  \/opt\/homebrew\/*\/Python.framework\/Versions\/3.13\/lib\/python3.13\/lib-dynload\/select.cpython-313-darwin.so\n--->  GAP OF 0x50000 BYTES\n      shared memory               103060000-103070000    [   64K] r--\/r-- SM=SHM  ",
  "asi" : {"CoreFoundation":["*** multi-threaded process forked ***"],"libsystem_c.dylib":["crashed on child side of fork pre-exec"]},
  "extMods" : {"caller":{"thread_create":0,"thread_set_state":0,"task_for_pid":0},"system":{"thread_create":0,"thread_set_state":0,"task_for_pid":0},"targeted":{"thread_create":0,"thread_set_state":0,"task_for_pid":0},"warnings":0},
  "faultingThread" : 0,
  "threads" : [{"triggered":true,"id":110625,"threadState":{"x":[{"value":8699300012,"symbolLocation":172,"symbol":"_main_thread"},{"value":6874365763},{"value":16777476},{"value":0},{"value":6874365701},{"value":6130101152},{"value":116},{"value":0},{"value":4345366727},{"value":8699349416,"symbolLocation":0,"symbol":"errno"},{"value":1},{"value":36359078000},{"value":1},{"value":36356300384},{"value":12297829382473034410},{"value":6874363655},{"value":6876947976,"symbolLocation":0,"symbol":"__error"},{"value":8722587352},{"value":0},{"value":36359077952},{"value":4345366731},{"value":68719460612},{"value":0},{"value":1},{"value":0},{"value":4346598224,"symbolLocation":0,"symbol":"cfunction_call"},{"value":4337992312},{"value":309},{"value":4350376688,"symbolLocation":282480,"symbol":"_PyRuntime"}],"flavor":"ARM_THREAD_STATE64","lr":{"value":6874255744},"cpsr":{"value":536870912},"fp":{"value":6130102336},"sp":{"value":6130102272},"esr":{"value":2449473543,"description":"(Data Abort) byte read Translation fault"},"pc":{"value":6874255764,"matchesCrashFrame":1},"far":{"value":4345366729}},"frames":[{"imageOffset":16788,"symbol":"_os_log_preferences_refresh","symbolLocation":56,"imageIndex":27},{"imageOffset":19196,"symbol":"os_log_type_enabled","symbolLocation":768,"imageIndex":27},{"imageOffset":1149076,"symbol":"_CFPlugInUnscheduleForUnloading","symbolLocation":92,"imageIndex":28},{"imageOffset":824080,"symbol":"_CFBundleLoadExecutableAndReturnError","symbolLocation":176,"imageIndex":28},{"imageOffset":669004,"symbol":"CFBundleGetFunctionPointerForName","symbolLocation":52,"imageIndex":28},{"imageOffset":12520,"symbol":"darwin_set_process_title","symbolLocation":104,"imageIndex":8},{"imageOffset":14684,"symbol":"set_ps_display","symbolLocation":104,"imageIndex":8},{"imageOffset":13016,"symbol":"spt_setproctitle","symbolLocation":88,"imageIndex":8},{"imageOffset":775068,"symbol":"cfunction_call","symbolLocation":76,"imageIndex":1},{"imageOffset":391732,"symbol":"_PyObject_MakeTpCall","symbolLocation":120,"imageIndex":1},{"imageOffset":1610472,"symbol":"_PyEval_EvalFrameDefault","symbolLocation":6856,"imageIndex":1},{"imageOffset":1602980,"symbol":"PyEval_EvalCode","symbolLocation":200,"imageIndex":1},{"imageOffset":2063620,"symbol":"run_eval_code_obj","symbolLocation":104,"imageIndex":1},{"imageOffset":2062156,"symbol":"run_mod","symbolLocation":168,"imageIndex":1},{"imageOffset":2055668,"symbol":"pyrun_file","symbolLocation":164,"imageIndex":1},{"imageOffset":2052400,"symbol":"_PyRun_SimpleFileObject","symbolLocation":256,"imageIndex":1},{"imageOffset":2051432,"symbol":"_PyRun_AnyFileObject","symbolLocation":80,"imageIndex":1},{"imageOffset":2214368,"symbol":"pymain_run_file_obj","symbolLocation":164,"imageIndex":1},{"imageOffset":2213516,"symbol":"pymain_run_file","symbolLocation":76,"imageIndex":1},{"imageOffset":2210044,"symbol":"Py_RunMain","symbolLocation":968,"imageIndex":1},{"imageOffset":2211576,"symbol":"pymain_main","symbolLocation":304,"imageIndex":1},{"imageOffset":2211736,"symbol":"Py_BytesMain","symbolLocation":40,"imageIndex":1},{"imageOffset":36180,"symbol":"start","symbolLocation":7184,"imageIndex":29}]}],
  "usedImages" : [
  {
    "source" : "P",
    "arch" : "arm64",
    "base" : 4336762880,
    "CFBundleShortVersionString" : "3.13.7",
    "CFBundleIdentifier" : "org.python.python",
    "size" : 16384,
    "uuid" : "f0277575-a537-3f79-99db-ddc6aa2557c5",
    "path" : "\/opt\/homebrew\/*\/Python.framework\/Versions\/3.13\/Resources\/Python.app\/Contents\/MacOS\/Python",
    "name" : "Python",
    "CFBundleVersion" : "3.13.7"
  },
  {
    "source" : "P",
    "arch" : "arm64",
    "base" : 4345823232,
    "CFBundleShortVersionString" : "3.13.7, (c) 2001-2024 Python Software Foundation.",
    "CFBundleIdentifier" : "org.python.python",
    "size" : 3719168,
    "uuid" : "e646f4c0-e043-33df-96c3-b16761745af4",
    "path" : "\/opt\/homebrew\/*\/Python.framework\/Versions\/3.13\/Python",
    "name" : "Python",
    "CFBundleVersion" : "3.13.7"
  },
  {
    "source" : "P",
    "arch" : "arm64",
    "base" : 4341727232,
    "size" : 49152,
    "uuid" : "40160c7c-5172-3af7-bb9b-93a96e74c6c9",
    "path" : "\/opt\/homebrew\/*\/Python.framework\/Versions\/3.13\/lib\/python3.13\/lib-dynload\/math.cpython-313-darwin.so",
    "name" : "math.cpython-313-darwin.so"
  },
  {
    "source" : "P",
    "arch" : "arm64",
    "base" : 4340203520,
    "size" : 16384,
    "uuid" : "905cd86b-6d43-38b0-b621-fcd8cda81842",
    "path" : "\/opt\/homebrew\/*\/Python.framework\/Versions\/3.13\/lib\/python3.13\/lib-dynload\/_bisect.cpython-313-darwin.so",
    "name" : "_bisect.cpython-313-darwin.so"
  },
  {
    "source" : "P",
    "arch" : "arm64",
    "base" : 4341841920,
    "size" : 16384,
    "uuid" : "36fadcc4-1773-33ad-a7f0-1332900f340b",
    "path" : "\/opt\/homebrew\/*\/Python.framework\/Versions\/3.13\/lib\/python3.13\/lib-dynload\/_random.cpython-313-darwin.so",
    "name" : "_random.cpython-313-darwin.so"
  },
  {
    "source" : "P",
    "arch" : "arm64",
    "base" : 4345004032,
    "size" : 16384,
    "uuid" : "00837420-ce6a-3c67-bb0f-74470aec0f95",
    "path" : "\/opt\/homebrew\/*\/Python.framework\/Versions\/3.13\/lib\/python3.13\/lib-dynload\/fcntl.cpython-313-darwin.so",
    "name" : "fcntl.cpython-313-darwin.so"
  },
  {
    "source" : "P",
    "arch" : "arm64",
    "base" : 4345085952,
    "size" : 16384,
    "uuid" : "e9a7c27e-635f-367b-ad2a-157ccfaba362",
    "path" : "\/opt\/homebrew\/*\/Python.framework\/Versions\/3.13\/lib\/python3.13\/lib-dynload\/_posixsubprocess.cpython-313-darwin.so",
    "name" : "_posixsubprocess.cpython-313-darwin.so"
  },
  {
    "source" : "P",
    "arch" : "arm64",
    "base" : 4345266176,
    "size" : 32768,
    "uuid" : "62e107a6-0ba5-3d00-ae35-550d917bf5d7",
    "path" : "\/opt\/homebrew\/*\/Python.framework\/Versions\/3.13\/lib\/python3.13\/lib-dynload\/select.cpython-313-darwin.so",
    "name" : "select.cpython-313-darwin.so"
  },
  {
    "source" : "P",
    "arch" : "arm64",
    "base" : 4345167872,
    "size" : 16384,
    "uuid" : "9d1543f0-0c3f-33c2-b4c6-b716ab150bed",
    "path" : "\/opt\/homebrew\/*\/_setproctitle.cpython-313-darwin.so",
    "name" : "_setproctitle.cpython-313-darwin.so"
  },
  {
    "source" : "P",
    "arch" : "arm64",
    "base" : 4458725376,
    "size" : 32768,
    "uuid" : "877cf895-77e8-3491-9fba-79a3b496a6c0",
    "path" : "\/opt\/homebrew\/*\/Python.framework\/Versions\/3.13\/lib\/python3.13\/lib-dynload\/zlib.cpython-313-darwin.so",
    "name" : "zlib.cpython-313-darwin.so"
  },
  {
    "source" : "P",
    "arch" : "arm64",
    "base" : 4458823680,
    "size" : 16384,
    "uuid" : "3627f2b9-2d25-3e83-880f-a78de4c7ac26",
    "path" : "\/opt\/homebrew\/*\/Python.framework\/Versions\/3.13\/lib\/python3.13\/lib-dynload\/_bz2.cpython-313-darwin.so",
    "name" : "_bz2.cpython-313-darwin.so"
  },
  {
    "source" : "P",
    "arch" : "arm64",
    "base" : 4459200512,
    "size" : 32768,
    "uuid" : "9fd139ad-6a53-367e-ae08-a558e347ba0b",
    "path" : "\/opt\/homebrew\/*\/Python.framework\/Versions\/3.13\/lib\/python3.13\/lib-dynload\/_lzma.cpython-313-darwin.so",
    "name" : "_lzma.cpython-313-darwin.so"
  },
  {
    "source" : "P",
    "arch" : "arm64",
    "base" : 4459495424,
    "size" : 131072,
    "uuid" : "6b34bd7f-9320-3883-9a5d-e8542c9b17ca",
    "path" : "\/opt\/homebrew\/*\/liblzma.5.dylib",
    "name" : "liblzma.5.dylib"
  },
  {
    "source" : "P",
    "arch" : "arm64",
    "base" : 4461494272,
    "size" : 688128,
    "uuid" : "107fde6d-dd69-3dd0-9e12-1d95f3662c75",
    "path" : "\/opt\/homebrew\/*\/Python.framework\/Versions\/3.13\/lib\/python3.13\/lib-dynload\/unicodedata.cpython-313-darwin.so",
    "name" : "unicodedata.cpython-313-darwin.so"
  },
  {
    "source" : "P",
    "arch" : "arm64",
    "base" : 4458905600,
    "size" : 32768,
    "uuid" : "d630a783-735a-3103-8e00-75727e430c71",
    "path" : "\/opt\/homebrew\/*\/Python.framework\/Versions\/3.13\/lib\/python3.13\/lib-dynload\/_struct.cpython-313-darwin.so",
    "name" : "_struct.cpython-313-darwin.so"
  },
  {
    "source" : "P",
    "arch" : "arm64",
    "base" : 4459298816,
    "size" : 32768,
    "uuid" : "de42b229-8e10-318f-999f-1d97c23e9896",
    "path" : "\/opt\/homebrew\/*\/Python.framework\/Versions\/3.13\/lib\/python3.13\/lib-dynload\/_json.cpython-313-darwin.so",
    "name" : "_json.cpython-313-darwin.so"
  },
  {
    "source" : "P",
    "arch" : "arm64",
    "base" : 4459397120,
    "size" : 16384,
    "uuid" : "813779d8-c5f6-3c3c-be70-7bdc65f95b90",
    "path" : "\/opt\/homebrew\/*\/Python.framework\/Versions\/3.13\/lib\/python3.13\/lib-dynload\/_opcode.cpython-313-darwin.so",
    "name" : "_opcode.cpython-313-darwin.so"
  },
  {
    "source" : "P",
    "arch" : "arm64",
    "base" : 4460740608,
    "size" : 16384,
    "uuid" : "2ea34420-2599-33fc-b078-e38934332305",
    "path" : "\/opt\/homebrew\/*\/Python.framework\/Versions\/3.13\/lib\/python3.13\/lib-dynload\/grp.cpython-313-darwin.so",
    "name" : "grp.cpython-313-darwin.so"
  },
  {
    "source" : "P",
    "arch" : "arm64",
    "base" : 4460822528,
    "size" : 16384,
    "uuid" : "218877d3-5451-3e71-8bde-2848399a64ea",
    "path" : "\/opt\/homebrew\/*\/Python.framework\/Versions\/3.13\/lib\/python3.13\/lib-dynload\/binascii.cpython-313-darwin.so",
    "name" : "binascii.cpython-313-darwin.so"
  },
  {
    "source" : "P",
    "arch" : "arm64",
    "base" : 4460904448,
    "size" : 16384,
    "uuid" : "62fb2c80-0e53-3262-82f4-5e6433558b1f",
    "path" : "\/opt\/homebrew\/*\/Python.framework\/Versions\/3.13\/lib\/python3.13\/lib-dynload\/_contextvars.cpython-313-darwin.so",
    "name" : "_contextvars.cpython-313-darwin.so"
  },
  {
    "source" : "P",
    "arch" : "arm64",
    "base" : 4461133824,
    "size" : 65536,
    "uuid" : "fcc503ae-f210-3a9c-8489-972bb6f85131",
    "path" : "\/opt\/homebrew\/*\/Python.framework\/Versions\/3.13\/lib\/python3.13\/lib-dynload\/_socket.cpython-313-darwin.so",
    "name" : "_socket.cpython-313-darwin.so"
  },
  {
    "source" : "P",
    "arch" : "arm64",
    "base" : 4460986368,
    "size" : 32768,
    "uuid" : "3741b560-be28-3f72-a17f-8459b56eb459",
    "path" : "\/opt\/homebrew\/*\/Python.framework\/Versions\/3.13\/lib\/python3.13\/lib-dynload\/array.cpython-313-darwin.so",
    "name" : "array.cpython-313-darwin.so"
  },
  {
    "source" : "P",
    "arch" : "arm64",
    "base" : 4465393664,
    "size" : 32768,
    "uuid" : "9d177afc-73f6-3447-84af-42e7692c3682",
    "path" : "\/opt\/homebrew\/*\/Python.framework\/Versions\/3.13\/lib\/python3.13\/lib-dynload\/_hashlib.cpython-313-darwin.so",
    "name" : "_hashlib.cpython-313-darwin.so"
  },
  {
    "source" : "P",
    "arch" : "arm64",
    "base" : 4470226944,
    "size" : 3276800,
    "uuid" : "9592f20b-3723-37b5-8658-0022299140e8",
    "path" : "\/opt\/homebrew\/*\/libcrypto.3.dylib",
    "name" : "libcrypto.3.dylib"
  },
  {
    "source" : "P",
    "arch" : "arm64",
    "base" : 4461281280,
    "size" : 32768,
    "uuid" : "c1d9619d-2b33-3e19-913e-b2424276f3cd",
    "path" : "\/opt\/homebrew\/*\/Python.framework\/Versions\/3.13\/lib\/python3.13\/lib-dynload\/_blake2.cpython-313-darwin.so",
    "name" : "_blake2.cpython-313-darwin.so"
  },
  {
    "source" : "P",
    "arch" : "arm64",
    "base" : 4465737728,
    "size" : 114688,
    "uuid" : "c9759be7-2b4a-3c5f-a2e0-9ba14ca981a0",
    "path" : "\/opt\/homebrew\/*\/Python.framework\/Versions\/3.13\/lib\/python3.13\/lib-dynload\/_ssl.cpython-313-darwin.so",
    "name" : "_ssl.cpython-313-darwin.so"
  },
  {
    "source" : "P",
    "arch" : "arm64",
    "base" : 4466868224,
    "size" : 589824,
    "uuid" : "ab8e815f-a938-3f54-8e8d-5c832389da98",
    "path" : "\/opt\/homebrew\/*\/libssl.3.dylib",
    "name" : "libssl.3.dylib"
  },
  {
    "source" : "P",
    "arch" : "arm64e",
    "base" : 6874238976,
    "size" : 133088,
    "uuid" : "28139651-ffe2-3795-95ac-1c7cb27a3a9b",
    "path" : "\/usr\/lib\/system\/libsystem_trace.dylib",
    "name" : "libsystem_trace.dylib"
  },
  {
    "source" : "P",
    "arch" : "arm64e",
    "base" : 6877478912,
    "CFBundleShortVersionString" : "6.9",
    "CFBundleIdentifier" : "com.apple.CoreFoundation",
    "size" : 5558144,
    "uuid" : "edb39786-80b1-3bff-b6c3-e33f2e3ca867",
    "path" : "\/System\/Library\/Frameworks\/CoreFoundation.framework\/Versions\/A\/CoreFoundation",
    "name" : "CoreFoundation",
    "CFBundleVersion" : "4040.1.401"
  },
  {
    "source" : "P",
    "arch" : "arm64e",
    "base" : 6873255936,
    "size" : 651124,
    "uuid" : "abfd3247-50ac-3c8e-b72a-83710166e982",
    "path" : "\/usr\/lib\/dyld",
    "name" : "dyld"
  },
  {
    "size" : 0,
    "source" : "A",
    "base" : 0,
    "uuid" : "00000000-0000-0000-0000-000000000000"
  },
  {
    "source" : "P",
    "arch" : "arm64e",
    "base" : 6876942336,
    "size" : 246880,
    "uuid" : "2eb73bf1-8c71-3e1f-a160-6da83dc82606",
    "path" : "\/usr\/lib\/system\/libsystem_kernel.dylib",
    "name" : "libsystem_kernel.dylib"
  }
],
  "sharedCache" : {
  "base" : 6872186880,
  "size" : 5557583872,
  "uuid" : "52e4eec0-379e-31c7-ac62-bfed14d90f52"
},
  "vmSummary" : "ReadOnly portion of Libraries: Total=898.8M resident=0K(0%) swapped_out_or_unallocated=898.8M(100%)\nWritable regions: Total=132.2M written=240K(0%) resident=240K(0%) swapped_out=0K(0%) unallocated=132.0M(100%)\n\n                                VIRTUAL   REGION \nREGION TYPE                        SIZE    COUNT (non-coalesced) \n===========                     =======  ======= \nActivity Tracing                   256K        1 \nColorSync                           48K        2 \nKernel Alloc Once                   32K        1 \nMALLOC                           105.2M       19 \nMALLOC guard page                   32K        2 \nSTACK GUARD                         16K        1 \nStack                             17.1M        3 \nStack Guard                         32K        2 \nVM_ALLOCATE                       9248K       11 \n__AUTH                            1334K      157 \n__AUTH_CONST                      18.4M      371 \n__CTF                               824        1 \n__DATA                            5616K      353 \n__DATA_CONST                      16.6M      399 \n__DATA_DIRTY                      1377K      314 \n__FONT_DATA                        2352        1 \n__LINKEDIT                       595.6M       28 \n__OBJC_RO                         78.1M        1 \n__OBJC_RW                         2561K        1 \n__TEXT                           303.2M      410 \n__TPRO_CONST                       128K        2 \nmapped file                       44.5M        2 \npage table in kernel               240K        1 \nshared memory                      208K        8 \n===========                     =======  ======= \nTOTAL                              1.2G     2091 \n",
  "legacyInfo" : {
  "threadTriggered" : {

  }
},
  "logWritingSignature" : "8a38f8c7232ef5adeed9483e35aee2cb5fb63ef3",
  "trialInfo" : {
  "rollouts" : [
    {
      "rolloutId" : "60da5e84ab0ca017dace9abf",
      "factorPackIds" : [

      ],
      "deploymentId" : 240000008
    },
    {
      "rolloutId" : "67181b10c68c361a728c7cfa",
      "factorPackIds" : [

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

  ]
}
}


drummingdemon avatar Sep 22 '25 20:09 drummingdemon

Using --prevent-idle-timeout causes Python to crash under macOS 26.0 Tahoe - this sadly also means that the keepalive isn't working.

First of all, take the following into account: https://dlenski.github.io/macOS_nope.html

Crashlog as follows:

I don't understand much of anything in this crash log (did I mention not knowing or caring about Mac OS? 😅), but this stands out:

Application Specific Information:
*** multi-threaded process forked ***
crashed on child side of fork pre-exec

Several strange things:

  1. crashed on child side of fork pre-exec: The fork occurs here. This fork occurs whether or not --prevent-idle-timeouts is used… so why does that make a difference?
  2. multi-threaded process forked: vpn-slice does not itself use threads at all. Perhaps some of the dependencies under Mac/Homebrew use threading.

dlenski avatar Sep 22 '25 21:09 dlenski

You should add -vv --dump to get more detailed information about what vpn-slice is doing right before this crash occurs.

I can't tell from your description whether the crash occurs immediately upon the invocation of vpn-slice, or if it occurs (say) on the first iteration through the prevent-idle-timeouts loop.

dlenski avatar Sep 22 '25 21:09 dlenski

Thanks for the quick reply!

It really is strange as when I remove --prevent-idle-timeout the crash no longer happens.

Added the flags and everything seems normal in the log output, nothing out of the ordinary - after all the hostnames are resolved, there is short amount of time where nothing else happens (I assume that is when the timeout loop would start?) and then the 'Python 3 quit unexpectedly' window pops up, followed by the usual:

Send CSTP Keepalive
Send DTLS Keepalive
Send CSTP DPD
Got CSTP DPD response
Send DTLS DPD
Got DTLS DPD response

So I would wager that the problem happens around or at the start of the keepalive loop.

The connection and the resolved hosts work well, the only downside of this is that the prevent idle timeout loop is not working and sometimes the tunnel remotely closes due to inactivity.

drummingdemon avatar Sep 22 '25 22:09 drummingdemon

after all the hostnames are resolved, there is short amount of time where nothing else happens (I assume that is when the timeout loop would start?)

Nothing else happens? 🤔

It doesn't print Continuing in background as PID $PID or Sleeping $N seconds (https://github.com/dlenski/vpn-slice/blob/master/vpn_slice/main.py#L335-L342), not even once?

dlenski avatar Sep 22 '25 22:09 dlenski

To be exact, nothing visible in the log output seems to be happening..

I know it sounds a bit weird - here is the log part right after openconnect has established connection. I've removed the actual hostnames and addresses and cut down on the repetition as well (also, sorry for being a bother with macOS, I've just read the piece you've linked):

...
No change in MTU after detection (was 1294)
Configured as 10.1.1.1, with SSL connected and DTLS connected
Session authentication will expire at Sat Sep 29 10:46:23 2025

Called by /opt/homebrew/Cellar/openconnect/9.12/bin/openconnect (PID 61104) with environment variables for vpnc-script:
  reason                  => reason=<reasons.pre_init: 1>
  VPNGATEWAY              => gateway=IPv4Address('1.2.3.4')
  CISCO_DEF_DOMAIN        => domain=['ab.cd']
  INTERNAL_IP4_ADDRESS    => myaddr=IPv4Address('10.10.10.10')
  INTERNAL_IP4_MTU        => mtu=1294
  INTERNAL_IP4_NETMASK    => netmask=IPv4Address('255.255.224.0')
  INTERNAL_IP4_NETMASKLEN => netmasklen=19
  INTERNAL_IP4_NETADDR    => network=IPv4Network('10.10.10.10')
  INTERNAL_IP4_DNS        => dns=[IPv4Address('10.1.1.1'), IPv4Address('10.1.1.1')]
  IDLE_TIMEOUT            => idle_timeout=900
  VPNPID                  => vpnpid=61104
Complete set of subnets to include in VPN routes:
  10.1.1.1/32
Complete set of host names to include in VPN routes after DNS lookup (and add /etc/hosts entries for):
  a.b.c.d
Called by /opt/homebrew/Cellar/openconnect/9.12/bin/openconnect (PID 61104) with environment variables for vpnc-script:
  reason                  => reason=<reasons.connect: 2>
  VPNGATEWAY              => gateway=IPv4Address('2.2.2.2')
  TUNDEV                  => tundev='utun10'
  CISCO_DEF_DOMAIN        => domain=['ab.cd']
  INTERNAL_IP4_ADDRESS    => myaddr=IPv4Address('10.1.1.1')
  INTERNAL_IP4_MTU        => mtu=1294
  INTERNAL_IP4_NETMASK    => netmask=IPv4Address('255.255.224.0')
  INTERNAL_IP4_NETMASKLEN => netmasklen=19
  INTERNAL_IP4_NETADDR    => network=IPv4Network('10.1.1.1/19')
  INTERNAL_IP4_DNS        => dns=[IPv4Address('10.2.1.1'), IPv4Address('10.2.1.2')]
  IDLE_TIMEOUT            => idle_timeout=900
  VPNPID                  => vpnpid=61104
Complete set of subnets to include in VPN routes:
  10.1.1.1/32
Complete set of host names to include in VPN routes after DNS lookup (and add /etc/hosts entries for):
  a.b.c.d
Set explicit route to VPN gateway 2.2.2.2 (via 192.168.1.1, dev en0, mtu 1500)
Blocked incoming traffic from VPN interface with iptables.
Adding route to nameserver 10.2.1.1 through utun10.
Adding route to nameserver 10.2.1.2 through utun10.
Adding route to subnet 10.2.1.1/32 through utun10.
route: writing to routing socket: File exists
Added routes for 2 nameservers, 8 subnets, 0 aliases.
Restored routes for 0 excluded subnets.
Adding /etc/hosts entries for 2 nameservers...
  10.2.1.1 = dns0.utun10
  10.2.1.2 = dns1.utun10
Looking up 56 hosts using VPN DNS servers...
Got results: [<DNS IN A rdata: 10.1.1.1>]
  ab.cd = 1.2.3.4
Added hostnames and aliases for 81 addresses to /etc/hosts.
Adding route to 1.2.3.4 (for named hosts) through utun10.
route: writing to routing socket: File exists
Added 78 routes for named hosts.

<here is where the crash happens>

drummingdemon avatar Sep 22 '25 22:09 drummingdemon

maybe this can help debug the issue: if you set OBJC_DISABLE_INITIALIZE_FORK_SAFETY=yes when running vpn-slice, the crash no longer happens

andrewgrinko avatar Sep 25 '25 06:09 andrewgrinko

maybe this can help debug the issue: if you set OBJC_DISABLE_INITIALIZE_FORK_SAFETY=yes when running vpn-slice, the crash no longer happens

Thanks for this - I did try prepending this with export in the script that calls vpn-slice, but sadly the crash still occurs.

What was a bit intriguing is that after retrying multiple times, there were at least two instances when the crash didn't occur and I could see the keepalive procedure doing DNS queries

drummingdemon avatar Sep 25 '25 18:09 drummingdemon

maybe this can help debug the issue: if you set OBJC_DISABLE_INITIALIZE_FORK_SAFETY=yes when running vpn-slice, the crash no longer happens

Thanks for this - I did try prepending this with export in the script that calls vpn-slice, but sadly the crash still occurs.

What was a bit intriguing is that after retrying multiple times, there were at least two instances when the crash didn't occur and I could see the keepalive procedure doing DNS queries

interesting.. i've started running the command like this:

openconnect -s "OBJC_DISABLE_INITIALIZE_FORK_SAFETY=yes vpn-slice --prevent-idle-timeout 10.0.0.0/11"

and havent seen any crashes since

andrewgrinko avatar Sep 26 '25 09:09 andrewgrinko

maybe this can help debug the issue: if you set OBJC_DISABLE_INITIALIZE_FORK_SAFETY=yes when running vpn-slice, the crash no longer happens

Thanks for this - I did try prepending this with export in the script that calls vpn-slice, but sadly the crash still occurs. What was a bit intriguing is that after retrying multiple times, there were at least two instances when the crash didn't occur and I could see the keepalive procedure doing DNS queries

interesting.. i've started running the command like this:

openconnect -s "OBJC_DISABLE_INITIALIZE_FORK_SAFETY=yes vpn-slice --prevent-idle-timeout 10.0.0.0/11"

and havent seen any crashes since

Which version of python are you using? Sadly, however I try it crashes constantly...

drummingdemon avatar Dec 03 '25 16:12 drummingdemon