- Deadreckon Version: 0.8.4 (from source)
- OS: macOS 15.7.7, launchd supervisor agent
Symptom
deadreckon doctor --repair is blocked:
supervisor service: failed - ... checkpoint pid 3874 has a different process-start identity
The supervisor is running normally; only the checkpoint validation reports a problem.
Root cause
process_start_identity() (crates/deadreckon-core/src/exec/pid_file.rs) builds the macOS start identity from /bin/ps -p <pid> -o lstart=, which is locale-dependent.
- The
instance.json checkpoint is written by the launchd-spawned supervisor, which runs under C locale (no LANG/LC_ALL).
doctor run from a user shell recomputes the identity under the shell locale (e.g. LANG=en_GB.UTF-8).
Same running process, different rendering — the byte-for-byte comparison in validate_checkpoint_identity() fails:
| Locale |
ps -p 3874 -o lstart= |
| C / unset (supervisor) |
Fri Aug 7 06:47:56 2026 |
| en_GB.UTF-8 (doctor) |
Fri 7 Aug 06:47:56 2026 |
The function is documented as a "stable same-boot identity", but the macOS implementation is locale-dependent, violating that guarantee. doctor --repair cannot self-heal because the repair loop re-evaluates the same comparison.
Reproduction
# fails
LANG=en_GB.UTF-8 deadreckon supervisor status --json
# passes
LANG=C deadreckon supervisor status --json
LANG=C deadreckon doctor --repair
Suggested fix
Pin the ps subprocess to the C locale in process_start_identity(), e.g. .env("LANG","C").env("LC_ALL","C"), or read a locale-independent start token (e.g. proc_pidinfo/kern.proc), matching the Linux branch's /proc/<pid>/stat field 22.
Symptom
deadreckon doctor --repairis blocked:The supervisor is running normally; only the checkpoint validation reports a problem.
Root cause
process_start_identity()(crates/deadreckon-core/src/exec/pid_file.rs) builds the macOS start identity from/bin/ps -p <pid> -o lstart=, which is locale-dependent.instance.jsoncheckpoint is written by the launchd-spawned supervisor, which runs under C locale (noLANG/LC_ALL).doctorrun from a user shell recomputes the identity under the shell locale (e.g.LANG=en_GB.UTF-8).Same running process, different rendering — the byte-for-byte comparison in
validate_checkpoint_identity()fails:ps -p 3874 -o lstart=Fri Aug 7 06:47:56 2026Fri 7 Aug 06:47:56 2026The function is documented as a "stable same-boot identity", but the macOS implementation is locale-dependent, violating that guarantee.
doctor --repaircannot self-heal because the repair loop re-evaluates the same comparison.Reproduction
Suggested fix
Pin the
pssubprocess to the C locale inprocess_start_identity(), e.g..env("LANG","C").env("LC_ALL","C"), or read a locale-independent start token (e.g.proc_pidinfo/kern.proc), matching the Linux branch's/proc/<pid>/statfield 22.