From 37e82e3b0b38a1a0ef5510e3f78a1e22523036a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lars=20G=C3=B6ttgens?= Date: Thu, 24 Aug 2023 19:10:22 +0200 Subject: [PATCH] Circumvent pipe buffer deadlock (#166) --- src/ambiguities.jl | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/ambiguities.jl b/src/ambiguities.jl index 58b174f2..ee1978e6 100644 --- a/src/ambiguities.jl +++ b/src/ambiguities.jl @@ -126,13 +126,11 @@ function _find_ambiguities( end cmd = `$cmd --startup-file=no -e $code` - out = Pipe() - err = Pipe() + outfile, out = mktemp() + errfile, err = mktemp() succ = success(pipeline(cmd; stdout = out, stderr = err)) - close(out.in) - close(err.in) - strout = String(read(out)) - strerr = String(read(err)) + strout = read(outfile, String) + strerr = read(errfile, String) num_ambiguities = if succ 0 else