summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Pickering <matthewtpickering@gmail.com>2021-09-13 12:02:14 +0100
committerMatthew Pickering <matthewtpickering@gmail.com>2021-09-13 12:06:59 +0100
commit58421c8e27be6774dbb6dd37c93e1cb906d58dcc (patch)
treea1723a684c43294c88ef63f38bf510bcbf6aafa5
parent2d15175266d0e0d9ca6565124b0c17e207b5541c (diff)
downloadhaskell-wip/t20305.tar.gz
Stop leaking <defunct> llc processeswip/t20305
We needed to wait for the process to exit in the clean-up script as otherwise the `llc` process will not be killed until compilation finishes. This leads to running out of process spaces on some OSs. Thanks to Edsko de Vries for suggesting this fix. Fixes #20305
-rw-r--r--compiler/GHC/SysTools/Tasks.hs3
1 files changed, 2 insertions, 1 deletions
diff --git a/compiler/GHC/SysTools/Tasks.hs b/compiler/GHC/SysTools/Tasks.hs
index 7c1ea332cf..6bf7e9ba43 100644
--- a/compiler/GHC/SysTools/Tasks.hs
+++ b/compiler/GHC/SysTools/Tasks.hs
@@ -213,7 +213,7 @@ figureLlvmVersion logger dflags = traceToolCommand logger "llc" $ do
-- options are specified when '-version' is used.
args' = args ++ ["-version"]
catchIO (do
- (pin, pout, perr, _) <- runInteractiveProcess pgm args'
+ (pin, pout, perr, p) <- runInteractiveProcess pgm args'
Nothing Nothing
{- > llc -version
LLVM (http://llvm.org/):
@@ -227,6 +227,7 @@ figureLlvmVersion logger dflags = traceToolCommand logger "llc" $ do
hClose pin
hClose pout
hClose perr
+ _ <- waitForProcess p
return mb_ver
)
(\err -> do