3.8 KiB
Raw output — GH #473 UDS-on-macOS root-cause session
NOTE: code output is diff-referenced (not copied) per prompt-io diff-ref mode; all generated code is on branch wkt/uds_macos_473 relative to main (65bf9df5).
Diagnostic narrative (verbatim)
Root-cause work proceeded by linux-side simulation since no macOS host is available:
Pulled the actual macOS CI failure log from PR #460 run 28343878933 (job 84115107992): the failure is a bare
assert 1 == 0onproc.returncodewith NO stderr surfaced — the harness only re-raised when the LAST stderr line contained ‘Error’.Reproduced the stderr-swallow mechanism on linux: any
tractorroot-actor crash ends stderr with the strict-EG collapse note( ^^^ this exc was collapsed from a group ^^^ )which never matches ‘Error’ — so EVERY possible crash was swallowed. (Verified by sabotaging the runtime dir via an over-longXDG_RUNTIME_DIR→OSError: AF_UNIX path too long→ rc=1 + swallowed.)Found + proved a macOS-only addr-corruption bug in
MsgpackUDSStream.get_stream_addrs(): the(str(), str())match-arm unconditionally tookpeername, but on no-autobind platforms (macOS lacks linux’sSO_PASSCRED-triggered autobind) the accept side’sgetpeername()is''→Path('')garbage laddr/raddr on EVERY accepted UDS conn. Simulated on linux by nullingSO_PASSCRED(no autobind → same''shape): pre-fix the example printedlistener sock file: .; post-fix it prints the real registry sockpath. Non-fatal on linux-sim (rc=0), so possibly not the final macOS crasher — the diagnostic patch guarantees the next macOS CI run reveals any remaining layer.Falsified the missing-parent-dir theory:
get_rt_dir()alreadymkdir(parents=True, exist_ok=True)s at import (and macOS TCP CI passes), so~/Library/Caches/TemporaryItemsabsence cannot be the crasher. Hardenedstart_listener()’s bindspace mkdir anyway (customfiledircase + racing actors).
Generated changes (diff pointers)
git diff main..wkt/uds_macos_473 -- tests/test_docs_examples.py
- always raise with FULL subproc stderr (+stdout) on any non-zero example exit; keep legacy last-line ‘Error’ check for zero-rc cases; drop the macOS+CI skip of
uds_transport_actor_tree.py(GH #473 next-step).
git diff main..wkt/uds_macos_473 -- tractor/ipc/_uds.py
get_stream_addrs(): document the autobind semantics (bytes = linux abstract-ns autobind artifact), add no-autobind(str, str)arm picking the non-empty name (peernameconnect-side,socknameaccept-side) with an empty-pairValueErrorguard.start_listener():bs.mkdir(parents=True, exist_ok=True).
git diff main..wkt/uds_macos_473 -- .github/workflows/ci.yml
- remove the
macos-latest+udsmatrix exclude so UDS-on-macOS is exercised by CI (GH #473 next-step).
git diff main..wkt/uds_macos_473 -- examples/uds_transport_actor_tree.py
- docs nit: peer-pid mechanism is
SO_PEERCREDon linux,LOCAL_PEERPIDon macOS.
Verification (verbatim summary)
- macOS-shape sim (no autobind) + fix: example rc=0 with correct listener sockpath.
- native linux post-fix: example rc=0, autobind arms unchanged.
- sabotage smoke-test: diagnostic patch surfaces the full EG traceback incl. collapse-note line.
pytest tests/ipc/ tests/test_2way.py tests/discovery/ --tpt-proto uds: 61 passed, 1TooSlowErrorflake (test_simple_rpc) that passes solo in 2.2s — attributed to a concurrent full-suite run (other session) loading the host.- full
tests/test_docs_examples.pyrun pending at raw-file write time (queued behind the concurrent session’s suite).