Ports greyed out on Mac Silicon when SIP disabled

I’ve been using IDE 1 and IDE 2 for a while on different platforms.

When running it on my Mac Mini M4 (arm64 version) , the Tools - Ports menu is greyed out, while by launching IDE 1 (1.8.19) Ports appear fine without any change.

I’m a developer so I mostly run my Mac with SIP (System Integrity Protection) disabled, for testing purposes. When SIP is disabled, ports are greyed out. If I enable SIP and restart, ports appear fine. Even if I accept the Network Access TCC popups while in SIP enabled and restart, then disable SIP and restart again, ports are greyed out again.

In other words, I cannot use the Ports menu if I have SIP disabled, so I cannot use IDE 2 and I am forced to use IDE 1 to upload binaries to connected modules.

I’m reporting this as a bug, since there is no reason someone would intentionally prevent ports working with SIP disabled, and my guess is that TCC permissions check fails with SIP disabled probably for a particular binary, maybe serial-discovery or the main Arduino binary, and the ports get disabled.

This has been happening to me from Mac os Sonoma up to Tahoe 26.

I’m using the latest IDE 2.3.6, but it didn’t get fixed by rolling back to an earlier one.

Update: Using serial-discovery v 1.3.3 from github revealed that that version didn’t have a signature, while the latest 1.4.1 has an empty signature (no entitlements), making it fail, check my reply below).

Running the binary from command line shows this related info:

2025-09-21T21:26:26.058Z discovery-log INFO start resolved watching
2025-09-21T21:26:26.067Z daemon INFO time="2025-09-22T00:26:26+03:00" level=error msg="Waiting discovery process termination: signal: killed" discovery="builtin:serial-discovery"
time="2025-09-22T00:26:26+03:00" level=error msg="Stopped decode loop: EOF" discovery="builtin:serial-discovery"
time="2025-09-22T00:26:26+03:00" level=info msg="Discovery event channel closed builtin:serial-discovery. Exiting goroutine."

Below is a crash report that shows serial-discovery binary crashing on each Arduino IDE 2 launch:

serial-discovery_crashreport.txt (20.0 KB)

Translated Report (Full Report Below)
-------------------------------------
Process:             serial-discovery [2111]
Path:                /Users/USER/Library/Arduino15/*/serial-discovery
Identifier:          serial-discovery
Version:             ???
Code Type:           ARM-64 (Native)
Role:                Unspecified
Parent Process:      arduino-cli [2108]
Coalition:           cc.arduino.IDE2 [1141]
Responsible Process: Arduino IDE [2094]
User ID:             501

Date/Time:           2025-09-22 00:37:30.3653 +0300
Launch Time:         2025-09-22 00:37:30.3609 +0300
Hardware Model:      Mac16,10
OS Version:          macOS 26.0 (25A354)
Release Type:        User

Crash Reporter Key:  0B47AA1A-43C6-686D-3442-788F026A2604
Incident Identifier: D2695829-6A88-4261-8B5C-2CAF63BF214E

Time Awake Since Boot: 2300 seconds

System Integrity Protection: disabled

Triggered by Thread: 4

Exception Type:    EXC_GUARD (SIGKILL)
Exception Subtype: GUARD_TYPE_MACH_PORT
Exception Message:  INVALID_NAME on mach port 6403 (guarded with 0x0000000000000000)
Exception Codes:   0x0000000000001903, 0x0000000000000000

Termination Reason:  Namespace GUARD, Code 2305845208236955907, 


Thread 0:
0   libsystem_kernel.dylib        	       0x19981e908 read + 8
1   serial-discovery              	       0x1023e2d9c runtime.syscall.abi0 + 44
2   serial-discovery              	       0x1023e194c runtime.asmcgocall.abi0 + 124

Thread 1:
0   libsystem_kernel.dylib        	       0x1998212f4 __semwait_signal + 8
1   libsystem_c.dylib             	       0x1996fad6c nanosleep + 220
2   libsystem_c.dylib             	       0x1996fac84 usleep + 68
3   serial-discovery              	       0x1023e28e4 runtime.usleep_trampoline.abi0 + 20
4   serial-discovery              	       0x1023e1998 runtime.asmcgocall.abi0 + 200

Thread 2:
0   libsystem_kernel.dylib        	       0x1998214f8 __psynch_cvwait + 8
1   libsystem_pthread.dylib       	       0x1998610dc _pthread_cond_wait + 984
2   serial-discovery              	       0x1023e2c48 runtime.pthread_cond_wait_trampoline.abi0 + 24
3   serial-discovery              	       0x1023e1998 runtime.asmcgocall.abi0 + 200
4   ???                           	        0xd65f03c0 ???

Thread 3:
0   libsystem_kernel.dylib        	       0x1998214f8 __psynch_cvwait + 8
1   libsystem_pthread.dylib       	       0x1998610dc _pthread_cond_wait + 984
2   serial-discovery              	       0x1023e2c48 runtime.pthread_cond_wait_trampoline.abi0 + 24
3   serial-discovery              	       0x1023e1998 runtime.asmcgocall.abi0 + 200
4   ???                           	        0xd65f03c0 ???

Thread 4 Crashed:
0   libsystem_kernel.dylib        	       0x19981dae4 _kernelrpc_mach_port_deallocate_trap + 8
1   libsystem_kernel.dylib        	       0x19981f07c mach_port_deallocate + 28
2   serial-discovery              	       0x102449fc8 _cgo_db827594d66a_Cfunc_IOObjectRelease + 36
3   serial-discovery              	       0x1023e194c runtime.asmcgocall.abi0 + 124

Thread 5:
0   libsystem_kernel.dylib        	       0x1998214f8 __psynch_cvwait + 8
1   libsystem_pthread.dylib       	       0x1998610dc _pthread_cond_wait + 984
2   serial-discovery              	       0x1023e2c48 runtime.pthread_cond_wait_trampoline.abi0 + 24
3   serial-discovery              	       0x1023e1998 runtime.asmcgocall.abi0 + 200
4   ???                           	        0xd65f03c0 ???


Thread 4 crashed with ARM Thread State (64-bit):
    x0: 0x000000000000000f   x1: 0x0000000000001903   x2: 0x000001400005bb40   x3: 0x00000140000821a0
    x4: 0x00000000000004c0   x5: 0x0000014000104a50   x6: 0x00000001025678a2   x7: 0x0000000000000001
    x8: 0x0000000206218360   x9: 0x000001400005bbc8  x10: 0x0000000102604118  x11: 0x0000000000000010
   x12: 0x00000140000121a0  x13: 0x000000016dcaaf00  x14: 0x0000000102472910  x15: 0x000000000000001a
   x16: 0xffffffffffffffee  x17: 0x0000000207842758  x18: 0x0000000000000000  x19: 0x0000000000001903
   x20: 0x0000000000000203  x21: 0x0000000000000000  x22: 0x00000001023e1b24  x23: 0x0000000000000000
   x24: 0x0000000000000000  x25: 0x0000000000000000  x26: 0x0000014000012030  x27: 0x0000000000000810
   x28: 0x00000140000821a0   fp: 0x000000016dcaaec0   lr: 0x000000019981f07c
    sp: 0x000000016dcaaeb0   pc: 0x000000019981dae4 cpsr: 0x20000000
   far: 0x0000000000000000  esr: 0x56000080 (Syscall)

Binary Images:
       0x102380000 -        0x102473fff serial-discovery (*) <e9999832-21df-30d1-9fca-a2f863ea8df7> /Users/USER/Library/Arduino15/*/serial-discovery
       0x19981d000 -        0x19985945f libsystem_kernel.dylib (*) <2eb73bf1-8c71-3e1f-a160-6da83dc82606> /usr/lib/system/libsystem_kernel.dylib
               0x0 - 0xffffffffffffffff ??? (*) <00000000-0000-0000-0000-000000000000> ???
       0x1996ed000 -        0x19976eff7 libsystem_c.dylib (*) <1e2fc910-e211-3a48-90c1-402c82129ea8> /usr/lib/system/libsystem_c.dylib
       0x19985a000 -        0x199866abb libsystem_pthread.dylib (*) <5d31d65c-2ecf-36da-84f5-ba4caab06adb> /usr/lib/system/libsystem_pthread.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=878.1M resident=0K(0%) swapped_out_or_unallocated=878.1M(100%)
Writable regions: Total=63.7M written=304K(0%) resident=304K(0%) swapped_out=0K(0%) unallocated=63.4M(100%)

                                VIRTUAL   REGION 
REGION TYPE                        SIZE    COUNT (non-coalesced) 
===========                     =======  ======= 
ColorSync                           48K        2 
Kernel Alloc Once                   32K        1 
MALLOC                            12.1M       11 
MALLOC guard page                   96K        6 
STACK GUARD                       56.1M        6 
Stack                             10.6M        6 
VM_ALLOCATE                      693.3M       36 
VM_ALLOCATE (reserved)              48K        1         reserved VM address space (unallocated)
__AUTH                            1305K      146 
__AUTH_CONST                      17.6M      345 
__CTF                               824        1 
__DATA                            4315K      303 
__DATA_CONST                      15.8M      346 
__DATA_DIRTY                      1314K      290 
__FONT_DATA                        2352        1 
__LINKEDIT                       593.3M        2 
__OBJC_RO                         78.1M        1 
__OBJC_RW                         2561K        1 
__TEXT                           284.7M      355 
__TPRO_CONST                       128K        2 
page table in kernel               304K        1 
shared memory                       32K        1 
===========                     =======  ======= 
TOTAL                              1.7G     1864 
TOTAL, minus reserved VM space     1.7G     1864 


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

{"app_name":"serial-discovery","timestamp":"2025-09-22 00:37:30.00 +0300","app_version":"","sroute_id":12,"slice_uuid":"e9999832-21df-30d1-9fca-a2f863ea8df7","build_version":"","platform":1,"share_with_app_devs":0,"is_first_party":1,"bug_type":"309","os_version":"macOS 26.0 (25A354)","roots_installed":0,"incident_id":"D2695829-6A88-4261-8B5C-2CAF63BF214E","name":"serial-discovery"}
{
  "uptime" : 2300,
  "procRole" : "Unspecified",
  "version" : 2,
  "userID" : 501,
  "deployVersion" : 210,
  "modelCode" : "Mac16,10",
  "coalitionID" : 1141,
  "osVersion" : {
    "train" : "macOS 26.0",
    "build" : "25A354",
    "releaseType" : "User"
  },
  "captureTime" : "2025-09-22 00:37:30.3653 +0300",
  "codeSigningMonitor" : 2,
  "incident" : "D2695829-6A88-4261-8B5C-2CAF63BF214E",
  "pid" : 2111,
  "translated" : false,
  "cpuType" : "ARM-64",
  "roots_installed" : 0,
  "bug_type" : "309",
  "procLaunch" : "2025-09-22 00:37:30.3609 +0300",
  "procStartAbsTime" : 55772548835,
  "procExitAbsTime" : 55772652893,
  "procName" : "serial-discovery",
  "procPath" : "\/Users\/USER\/Library\/Arduino15\/*\/serial-discovery",
  "parentProc" : "arduino-cli",
  "parentPid" : 2108,
  "coalitionName" : "cc.arduino.IDE2",
  "crashReporterKey" : "0B47AA1A-43C6-686D-3442-788F026A2604",
  "developerMode" : 1,
  "responsiblePid" : 2094,
  "responsibleProc" : "Arduino IDE",
  "codeSigningID" : "a.out",
  "codeSigningTeamID" : "",
  "codeSigningFlags" : 570556417,
  "codeSigningValidationCategory" : 1,
  "codeSigningTrustLevel" : 4294967295,
  "codeSigningAuxiliaryInfo" : 0,
  "instructionByteStream" : {"beforePC":"ARAA1MADX9bQAYCSARAA1MADX9bwAYCSARAA1MADX9YwAoCSARAA1A==","atPC":"wANf1lACgJIBEADUwANf1nACgJIBEADUwANf1pACgJIBEADUwANf1g=="},
  "bootSessionUUID" : "5D9D08AD-351E-4536-949D-9E5B000F01D9",
  "sip" : "disabled",
  "sroute_id" : 12,
  "exception" : {"port":6403,"signal":"SIGKILL","guardId":0,"codes":"0x0000000000001903, 0x0000000000000000","violations":["INVALID_NAME"],"message":" INVALID_NAME on mach port 6403 (guarded with 0x0000000000000000)","subtype":"GUARD_TYPE_MACH_PORT","type":"EXC_GUARD","rawCodes":[6403,0]},
  "termination" : {"namespace":"GUARD","flags":2,"code":2305845208236955907},
  "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" : 4,
  "threads" : [{"id":42108,"frames":[{"imageOffset":6408,"symbol":"read","symbolLocation":8,"imageIndex":1},{"imageOffset":404892,"symbol":"runtime.syscall.abi0","symbolLocation":44,"imageIndex":0},{"imageOffset":399692,"symbol":"runtime.asmcgocall.abi0","symbolLocation":124,"imageIndex":0}],"threadState":{"x":[{"value":4},{"value":0},{"value":4096},{"value":4333998016,"symbolLocation":0,"symbol":"runtime.g0"},{"value":1680},{"value":1374389543472},{"value":4334188706,"symbolLocation":0,"symbol":"runtime.arm64HasATOMICS"},{"value":1},{"value":4333998880,"symbolLocation":0,"symbol":"runtime.m0"},{"value":1374391089608},{"value":4336363216},{"value":64},{"value":4332730656,"symbolLocation":0,"symbol":"syscall.libc_read_trampoline.abi0"},{"value":6134689712},{"value":1374390779904},{"value":11},{"value":3},{"value":1374391089664},{"value":0},{"value":12},{"value":125},{"value":3},{"value":4332591908,"symbolLocation":4,"symbol":"runtime.goexit.abi0"},{"value":0},{"value":18446744073709551615},{"value":4333061000,"symbolLocation":0,"symbol":"go.func.*"},{"value":1374391090464},{"value":2064},{"value":4333998016,"symbolLocation":0,"symbol":"runtime.g0"}],"flavor":"ARM_THREAD_STATE64","lr":{"value":4332596636},"cpsr":{"value":536870912},"fp":{"value":6134689688},"sp":{"value":6134689680},"esr":{"value":1442840704,"description":"(Syscall)"},"pc":{"value":6870395144},"far":{"value":0}}},{"id":42113,"frames":[{"imageOffset":17140,"symbol":"__semwait_signal","symbolLocation":8,"imageIndex":1},{"imageOffset":56684,"symbol":"nanosleep","symbolLocation":220,"imageIndex":3},{"imageOffset":56452,"symbol":"usleep","symbolLocation":68,"imageIndex":3},{"imageOffset":403684,"symbol":"runtime.usleep_trampoline.abi0","symbolLocation":20,"imageIndex":0},{"imageOffset":399768,"symbol":"runtime.asmcgocall.abi0","symbolLocation":200,"imageIndex":0}],"threadState":{"x":[{"value":60},{"value":0},{"value":1},{"value":1},{"value":0},{"value":20000},{"value":0},{"value":0},{"value":8692788000,"symbolLocation":0,"symbol":"clock_sem"},{"value":3},{"value":17},{"value":968768},{"value":5828001584},{"value":6135246336},{"value":7},{"value":9},{"value":334},{"value":8716034104},{"value":0},{"value":0},{"value":6135246288},{"value":3},{"value":0},{"value":0},{"value":0},{"value":0},{"value":4333340848,"symbolLocation":1112,"symbol":"go.funcrel.*"},{"value":10000},{"value":1374389545408}],"flavor":"ARM_THREAD_STATE64","lr":{"value":6869200236},"cpsr":{"value":2684354560},"fp":{"value":6135246272},"sp":{"value":6135246224},"esr":{"value":1442840704,"description":"(Syscall)"},"pc":{"value":6870405876},"far":{"value":0}}},{"id":42114,"frames":[{"imageOffset":17656,"symbol":"__psynch_cvwait","symbolLocation":8,"imageIndex":1},{"imageOffset":28892,"symbol":"_pthread_cond_wait","symbolLocation":984,"imageIndex":4},{"imageOffset":404552,"symbol":"runtime.pthread_cond_wait_trampoline.abi0","symbolLocation":24,"imageIndex":0},{"imageOffset":399768,"symbol":"runtime.asmcgocall.abi0","symbolLocation":200,"imageIndex":0},{"imageOffset":3596551104,"imageIndex":2}],"threadState":{"x":[{"value":260},{"value":0},{"value":512},{"value":0},{"value":0},{"value":160},{"value":0},{"value":0},{"value":6135819384},{"value":0},{"value":0},{"value":2},{"value":2},{"value":0},{"value":0},{"value":0},{"value":305},{"value":8716033984},{"value":0},{"value":1374389849152},{"value":1374389849216},{"value":6135820512},{"value":0},{"value":0},{"value":512},{"value":513},{"value":768},{"value":18446744073709551520},{"value":1374389546656}],"flavor":"ARM_THREAD_STATE64","lr":{"value":6870667484},"cpsr":{"value":1610612736},"fp":{"value":6135819504},"sp":{"value":6135819360},"esr":{"value":1442840704,"description":"(Syscall)"},"pc":{"value":6870406392},"far":{"value":0}}},{"id":42115,"frames":[{"imageOffset":17656,"symbol":"__psynch_cvwait","symbolLocation":8,"imageIndex":1},{"imageOffset":28892,"symbol":"_pthread_cond_wait","symbolLocation":984,"imageIndex":4},{"imageOffset":404552,"symbol":"runtime.pthread_cond_wait_trampoline.abi0","symbolLocation":24,"imageIndex":0},{"imageOffset":399768,"symbol":"runtime.asmcgocall.abi0","symbolLocation":200,"imageIndex":0},{"imageOffset":3596551104,"imageIndex":2}],"threadState":{"x":[{"value":260},{"value":0},{"value":1280},{"value":0},{"value":0},{"value":160},{"value":0},{"value":0},{"value":6136392632},{"value":0},{"value":0},{"value":2},{"value":2},{"value":0},{"value":0},{"value":0},{"value":305},{"value":8716033984},{"value":0},{"value":1374389850304},{"value":1374389850368},{"value":6136393952},{"value":0},{"value":0},{"value":1280},{"value":1281},{"value":1536},{"value":18446744073709551584},{"value":1374389547488}],"flavor":"ARM_THREAD_STATE64","lr":{"value":6870667484},"cpsr":{"value":1610612736},"fp":{"value":6136392752},"sp":{"value":6136392608},"esr":{"value":1442840704,"description":"(Syscall)"},"pc":{"value":6870406392},"far":{"value":0}}},{"triggered":true,"id":42116,"threadState":{"x":[{"value":15},{"value":6403},{"value":1374389910336},{"value":1374390067616},{"value":1216},{"value":1374390602320},{"value":4334188706,"symbolLocation":0,"symbol":"runtime.arm64HasATOMICS"},{"value":1},{"value":8692794208,"symbolLocation":0,"symbol":"mach_task_self_"},{"value":1374389910472},{"value":4334829848},{"value":16},{"value":1374389608864},{"value":6136966912},{"value":4333185296,"symbolLocation":0,"symbol":"runtime..stmp_89"},{"value":26},{"value":18446744073709551598},{"value":8716035928},{"value":0},{"value":6403},{"value":515},{"value":0},{"value":4332591908,"symbolLocation":4,"symbol":"runtime.goexit.abi0"},{"value":0},{"value":0},{"value":0},{"value":1374389608496},{"value":2064},{"value":1374390067616}],"flavor":"ARM_THREAD_STATE64","lr":{"value":6870397052},"cpsr":{"value":536870912},"fp":{"value":6136966848},"sp":{"value":6136966832},"esr":{"value":1442840704,"description":"(Syscall)"},"pc":{"value":6870391524,"matchesCrashFrame":1},"far":{"value":0}},"frames":[{"imageOffset":2788,"symbol":"_kernelrpc_mach_port_deallocate_trap","symbolLocation":8,"imageIndex":1},{"imageOffset":8316,"symbol":"mach_port_deallocate","symbolLocation":28,"imageIndex":1},{"imageOffset":827336,"symbol":"_cgo_db827594d66a_Cfunc_IOObjectRelease","symbolLocation":36,"imageIndex":0},{"imageOffset":399692,"symbol":"runtime.asmcgocall.abi0","symbolLocation":124,"imageIndex":0}]},{"id":42117,"frames":[{"imageOffset":17656,"symbol":"__psynch_cvwait","symbolLocation":8,"imageIndex":1},{"imageOffset":28892,"symbol":"_pthread_cond_wait","symbolLocation":984,"imageIndex":4},{"imageOffset":404552,"symbol":"runtime.pthread_cond_wait_trampoline.abi0","symbolLocation":24,"imageIndex":0},{"imageOffset":399768,"symbol":"runtime.asmcgocall.abi0","symbolLocation":200,"imageIndex":0},{"imageOffset":3596551104,"imageIndex":2}],"threadState":{"x":[{"value":260},{"value":0},{"value":0},{"value":0},{"value":0},{"value":160},{"value":0},{"value":0},{"value":6137539848},{"value":0},{"value":0},{"value":2},{"value":2},{"value":0},{"value":0},{"value":0},{"value":305},{"value":8716033984},{"value":0},{"value":1374390592320},{"value":1374390592384},{"value":6137540832},{"value":0},{"value":0},{"value":0},{"value":1},{"value":256},{"value":18446744073709551520},{"value":1374390600096}],"flavor":"ARM_THREAD_STATE64","lr":{"value":6870667484},"cpsr":{"value":1610612736},"fp":{"value":6137539968},"sp":{"value":6137539824},"esr":{"value":1442840704,"description":"(Syscall)"},"pc":{"value":6870406392},"far":{"value":0}}}],
  "usedImages" : [
  {
    "source" : "P",
    "arch" : "arm64",
    "base" : 4332191744,
    "size" : 999424,
    "uuid" : "e9999832-21df-30d1-9fca-a2f863ea8df7",
    "path" : "\/Users\/USER\/Library\/Arduino15\/*\/serial-discovery",
    "name" : "serial-discovery"
  },
  {
    "source" : "P",
    "arch" : "arm64e",
    "base" : 6870388736,
    "size" : 246880,
    "uuid" : "2eb73bf1-8c71-3e1f-a160-6da83dc82606",
    "path" : "\/usr\/lib\/system\/libsystem_kernel.dylib",
    "name" : "libsystem_kernel.dylib"
  },
  {
    "size" : 0,
    "source" : "A",
    "base" : 0,
    "uuid" : "00000000-0000-0000-0000-000000000000"
  },
  {
    "source" : "P",
    "arch" : "arm64e",
    "base" : 6869143552,
    "size" : 532472,
    "uuid" : "1e2fc910-e211-3a48-90c1-402c82129ea8",
    "path" : "\/usr\/lib\/system\/libsystem_c.dylib",
    "name" : "libsystem_c.dylib"
  },
  {
    "source" : "P",
    "arch" : "arm64e",
    "base" : 6870638592,
    "size" : 51900,
    "uuid" : "5d31d65c-2ecf-36da-84f5-ba4caab06adb",
    "path" : "\/usr\/lib\/system\/libsystem_pthread.dylib",
    "name" : "libsystem_pthread.dylib"
  }
],
  "sharedCache" : {
  "base" : 6865633280,
  "size" : 5557583872,
  "uuid" : "52e4eec0-379e-31c7-ac62-bfed14d90f52"
},
  "vmSummary" : "ReadOnly portion of Libraries: Total=878.1M resident=0K(0%) swapped_out_or_unallocated=878.1M(100%)\nWritable regions: Total=63.7M written=304K(0%) resident=304K(0%) swapped_out=0K(0%) unallocated=63.4M(100%)\n\n                                VIRTUAL   REGION \nREGION TYPE                        SIZE    COUNT (non-coalesced) \n===========                     =======  ======= \nColorSync                           48K        2 \nKernel Alloc Once                   32K        1 \nMALLOC                            12.1M       11 \nMALLOC guard page                   96K        6 \nSTACK GUARD                       56.1M        6 \nStack                             10.6M        6 \nVM_ALLOCATE                      693.3M       36 \nVM_ALLOCATE (reserved)              48K        1         reserved VM address space (unallocated)\n__AUTH                            1305K      146 \n__AUTH_CONST                      17.6M      345 \n__CTF                               824        1 \n__DATA                            4315K      303 \n__DATA_CONST                      15.8M      346 \n__DATA_DIRTY                      1314K      290 \n__FONT_DATA                        2352        1 \n__LINKEDIT                       593.3M        2 \n__OBJC_RO                         78.1M        1 \n__OBJC_RW                         2561K        1 \n__TEXT                           284.7M      355 \n__TPRO_CONST                       128K        2 \npage table in kernel               304K        1 \nshared memory                       32K        1 \n===========                     =======  ======= \nTOTAL                              1.7G     1864 \nTOTAL, minus reserved VM space     1.7G     1864 \n",
  "legacyInfo" : {
  "threadTriggered" : {

  }
},
  "logWritingSignature" : "0b92c192ea301fda2f4e6188b552e229cb36f28c",
  "trialInfo" : {
  "rollouts" : [
    {
      "rolloutId" : "6813dc6e1e50e5344eb573e9",
      "factorPackIds" : [

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

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

  ]
}
}

Any help or an update would be much appreciated.

I can provide any info or logs if needed.

Update:

I have fixed this by completely removing the signature from serial-discovery binary. ( codesign --remove-signature …) It appears that even if the file doesn’t have any entitlements, having a signature makes it expect entitlements in order to work in a SIP-disabled environment, while be removing the signature it allows it to run correctly when spawned from the parent process (Arduino IDE binary).

1 Like

Thanks for your report @limneos, and for taking the time to share the solution you found!

I investigated and was able to confirm your finding of a difference in code signing between the two versions:

Investigating further I found that the reason why you found that the 1.3.3 binary is not signed, while the 1.4.1 binary is signed is due to the fact that, prior to version 1.3.4, native Apple Silicon builds of serial-discovery were not produced (arduino/serial-discovery#57). So the only build of serial-discovery version 1.3.3 is the x86 (AKA "Intel") build, and thus you were forced to download that. Conversely, since a native Apple Silicon build was available for the 1.4.1 release, Arduino IDE installed that build on your M4 machine.

So the true relevant difference is not in the version of serial-discovery, but rather in the build variant. You will observe the same difference when comparing the Apple Silicon build of 1.4.1 against the x86 build:

% TESTDIR="$(mktemp --directory)"

% cd "$TESTDIR"

% curl --location --remote-name https://github.com/arduino/serial-discovery/releases/download/v1.4.1/serial-discovery_v1.4.1_macOS_64bit.tar.gz

[...]

% tar -x -z -f serial-discovery_v1.4.1_macOS_64bit.tar.gz

% curl --location --output-dir "$TESTDIR" --remote-name https://github.com/arduino/serial-discovery/releases/download/v1.4.1/serial-discovery_v1.4.1_macOS_ARM64.tar.gz

[...]

% tar -x -z -f serial-discovery_v1.4.1_macOS_ARM64.tar.gz

% codesign -d -v ./serial-discovery_osx_darwin_amd64/serial-discovery

./serial-discovery_osx_darwin_amd64/serial-discovery: code object is not signed at all

% codesign -d -v ./serial-discovery_osx_darwin_arm64/serial-discovery

Executable=/private/var/folders/sx/07hx_hp11nz50sf4ljwylj080000gn/T/tmp.0uxJP0A8YE/serial-discovery_osx_darwin_arm64/serial-discovery
Identifier=a.out
Format=Mach-O thin (arm64)
CodeDirectory v=20400 size=22174 flags=0x20002(adhoc,linker-signed) hashes=690+0 location=embedded
Signature=adhoc
Info.plist=not bound
TeamIdentifier=not set
Sealed Resources=none
Internal requirements=none

Such a difference between the two binaries is surprising since the differences between the environments in which our release build system generates the two are quite minimal. Investigating further, I discovered that the Go toolchain is intentionally configured to automatically perform code signing on macOS Apple Silicon builds, using an "ad hoc" signature:

So we have the explanation for the presence and absence of code signing. However, I don't know why this would cause macOS to kill the program. Since there are surely a very large number of such binaries in the wild, I would expect that I would find information about this lack of compatibility with systems that have SIP disabled. However, I don't find much information at all on this subject.

I suppose the workaround on our end would be to do real code signing on serial-discovery. We already do macOS signing and notarization for Arduino IDE and other primary applications, so it is certainly within our capabilities to set up the serial-discovery release system to do the same, but since serial-discovery is not intended to be used directly; only via those primary applications, we have never found the need to dedicate resources to set up and maintain that fairly complex infrastructure for the project.