You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[code-review] IsProcessAlive treats signal-0 EPERM as dead on Unix - asymmetric with the Windows ACCESS_DENIED->alive fix (#1723/#1535); false-death deletes PID files and forks a second daemon or triggers concurrent crash recovery (#1490 same lesion, Unix side) - one-line errors.Is fix #2190
Activity
fix(util): build-tag the EPERM regression test off Windows (#2190)
fix(util): signal-0 EPERM means alive on Unix (#2190) (#2195)
topcheer commentedon Sep 13, 2026
已修复并合并:PR #2195(squash 合并,reviewer 复核通过;裁定见 https://github.com/topcheer/ggcode/pull/2195#issuecomment-5651146387)。
修复内容:
kill(pid,0)的 EPERM 改保守判活(!errors.Is(err, syscall.EPERM)一行)——Unix 侧 #1723 孪生病灶收口:跨权限探测不再误判死,instance_detect PID 清理与 run_journal crash 恢复不再误触发(防 #1490 类二次 daemon fork)。复核链:EPERM+僵尸组合两子情形拆解(/proc 可读时僵尸检测精度保留;不可读时落保守活)——「when in doubt, alive」与 Windows #1723 原则对称;process.go 为 !windows 独占文件平台分裂干净;EPERM 分支单测不可构造的诚实说明+周围语义钉(沙箱按设计 SKIP)→ IsProcessAlive 族 5 测+util 全量 → CI 绿 → 合并。关闭。
topcheer commentedon Sep 13, 2026
复核结论:真(sa-151 初审中 → sa-152 独立复核确认中低——POSIX EPERM 语义 + Windows 孪生 #1723 不对称 + instance_detect/run_journal 两调用点后果 + #1490 同类事故史全链成立),PR #2195 已合并修复,关闭。
修复:
IsProcessAlive的 signal-0 判定改为"仅真实错误(ESRCH 等)判死"——EPERM(进程存在但无信号权限)走保守判活,与 Windows 侧 "when in doubt, alive" 原则及 isZombieUnix 的保守策略自洽(EPERM 下读不了他户 /proc,僵尸检查自然回退判活)。跨权限探测(sudo daemon + 非 root 检查)不再触发误删 PID 文件/起第二实例/误判 crash 并发恢复。验证:EPERM 分支需跨权限进程对(单测不可构造——注释说明);周围语义(self-alive / reaped-child-dead)回归钉住(
!windowsbuild tag——首轮 CI 的 Windows process-liveness 作业编译 Unix-only syscall 暴露,已修)+ util 全量 + 全仓 build;PR #2195 全 checks 绿后 reviewer squash 合并。topcheer commentedon Sep 13, 2026
#2190 修复验收(a2822b3b)——过
err != nil && !errors.Is(err, syscall.EPERM)一行修+errors import!isZombieUnix(pid)——他户 /proc 读不出时保守判活(原案预期);/stat 可读时 Z/X/x 仍诚实判死(EPERM≠豁免 zombie 检查,语义更准)三条信息级备注(不阻塞)
a.
background_unix.go:35daemon 侧用err == syscall.EPERM直接等值比较,与本次errors.Is形态分裂——当前 Go 返回裸 Errno 不触发,前向兼容脆弱(预存,非本 commit 引入)。建议后续顺手统一为 errors.Isb. hidepid=2 下他户僵尸被报活——保守方向(保留状态),与 #1839 fail-safe 设计一致,属预期
c. EPERM 分支零直接覆盖(需跨特权进程对)——commit message 已诚实声明;如需可仿 windows-real-machine-verify 在带 sudo 的 Actions 加探针
(R76 验收轮 sa-158 全程只读)