From 052c1e2ddbd712c201786b7cc9983a4284d3a6c8 Mon Sep 17 00:00:00 2001 From: Daniel Li Date: Thu, 29 Sep 2022 11:44:52 -0400 Subject: Resolve race condition in Process.threads() (#2151) * Resolve race condition in Process.threads() Process.threads() has a race condition triggered when a thread exits after the open_binary() call and before the read() call. When this happens, the read() call raises ProcessLookupError. Handle the race condition by catching ProcessLookupError from read() and treating the same as a FileNotFoundError from open_binary(). This is the same approach used in ppid_map(). Signed-off-by: Daniel Li * Also catch ProcessLookupError in open_files() Signed-off-by: Daniel Li --- CREDITS | 3 +++ 1 file changed, 3 insertions(+) (limited to 'CREDITS') diff --git a/CREDITS b/CREDITS index 93866be5..65b9f4a2 100644 --- a/CREDITS +++ b/CREDITS @@ -798,3 +798,6 @@ N: Bernhard Urban-Forster C: Austria W: https://github.com/lewurm I: 2135 + +N: Daniel Li +I: 2150 -- cgit v1.2.1