Author: Jonas Devlieghere
Date: 2020-05-29T13:58:12-07:00
New Revision: 8d8f8b353175b50dfdb1e2d5f3c0ada0a4ad25ed

URL: 
https://github.com/llvm/llvm-project/commit/8d8f8b353175b50dfdb1e2d5f3c0ada0a4ad25ed
DIFF: 
https://github.com/llvm/llvm-project/commit/8d8f8b353175b50dfdb1e2d5f3c0ada0a4ad25ed.diff

LOG: [lldb/Test] Don't leak forked processes on Darwin

We are leaking forked processes on macOS because the cleanup function
was checking the existence of /proc/pid which does not exist on macOS.
I've changed the code to be platform agnostic.

Added: 
    

Modified: 
    lldb/packages/Python/lldbsuite/test/lldbtest.py

Removed: 
    


################################################################################
diff  --git a/lldb/packages/Python/lldbsuite/test/lldbtest.py 
b/lldb/packages/Python/lldbsuite/test/lldbtest.py
index 0dee4f217c80..04ba7ea02d09 100644
--- a/lldb/packages/Python/lldbsuite/test/lldbtest.py
+++ b/lldb/packages/Python/lldbsuite/test/lldbtest.py
@@ -884,8 +884,10 @@ def cleanupSubprocesses(self):
         del self.subprocesses[:]
         # Ensure any forked processes are cleaned up
         for pid in self.forkedProcessPids:
-            if os.path.exists("/proc/" + str(pid)):
+            try:
                 os.kill(pid, signal.SIGTERM)
+            except OSError:
+                pass
 
     def spawnSubprocess(self, executable, args=[], install_remote=True):
         """ Creates a subprocess.Popen object with the specified executable 
and arguments,


        
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to