fix: _pid_alive treats an out-of-C-int-range pid as not alive (no OverflowError)

os.kill(pid, 0) raises OverflowError for a pid too large for a C int, which _pid_alive did
not catch; a foreign <base>.<huge-number>.tmp file in the store dir then made every stale-tmp
sweep (so every _save) crash. an over-range pid can't name a live process, so it's treated as
not-alive like ProcessLookupError.

Signed-off-by: disqualifier <dev@disqualifier.me>
This commit is contained in:
2026-07-06 17:17:39 -04:00
parent 98f7190f18
commit 68be8f7101
+2 -1
View File
@@ -170,7 +170,8 @@ class AioKV:
"""check whether pid refers to a live process, without permission to signal counting as alive""" """check whether pid refers to a live process, without permission to signal counting as alive"""
try: try:
os.kill(pid, 0) os.kill(pid, 0)
except ProcessLookupError: except (ProcessLookupError, OverflowError):
# OverflowError: a pid too large for a C int can't name a live process
return False return False
except PermissionError: except PermissionError:
return True return True