fix: handle exited PIDs and narrow message DB keys

This commit is contained in:
PeanutSplash
2026-03-07 21:35:24 +08:00
committed by ylytdeng
parent f9c338b48d
commit 872e3f58dc
2 changed files with 26 additions and 21 deletions
+6
View File
@@ -146,6 +146,9 @@ def main():
except PermissionError:
print(f"[WARN] 无法读取 /proc/{pid}/maps,权限不足,跳过")
continue
except (FileNotFoundError, ProcessLookupError):
print(f"[WARN] PID {pid} 已退出,跳过")
continue
total_bytes = sum(s for _, s in regions)
total_mb = total_bytes / 1024 / 1024
@@ -157,6 +160,9 @@ def main():
except PermissionError:
print(f"[WARN] 无法打开 /proc/{pid}/mem,权限不足,跳过")
continue
except (FileNotFoundError, ProcessLookupError):
print(f"[WARN] PID {pid} 已退出,跳过")
continue
try:
for reg_idx, (base, size) in enumerate(regions):