From fc2176e2811590f9c9b604e425fefa9a3b58e6c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lars=20G=C3=B6ttgens?= Date: Thu, 24 Aug 2023 14:43:12 +0200 Subject: [PATCH 1/3] Circumvent pipe buffer deadlock --- src/ambiguities.jl | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/ambiguities.jl b/src/ambiguities.jl index 58b174f2..22298e95 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(; cleanup = false) + errfile, err = mktemp(; cleanup = false) 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 From 20f5a86f15663d9e03571f7e8a4a271bc252a1cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lars=20G=C3=B6ttgens?= Date: Thu, 24 Aug 2023 17:15:34 +0200 Subject: [PATCH 2/3] Update src/ambiguities.jl --- src/ambiguities.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ambiguities.jl b/src/ambiguities.jl index 22298e95..59315ea0 100644 --- a/src/ambiguities.jl +++ b/src/ambiguities.jl @@ -126,7 +126,7 @@ function _find_ambiguities( end cmd = `$cmd --startup-file=no -e $code` - outfile, out = mktemp(; cleanup = false) + outfile, out = mktemp() errfile, err = mktemp(; cleanup = false) succ = success(pipeline(cmd; stdout = out, stderr = err)) strout = read(outfile, String) From 15aef7e44f6f2e2d65164eaade433cce908bba68 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lars=20G=C3=B6ttgens?= Date: Thu, 24 Aug 2023 17:19:52 +0200 Subject: [PATCH 3/3] Update src/ambiguities.jl --- src/ambiguities.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ambiguities.jl b/src/ambiguities.jl index 59315ea0..ee1978e6 100644 --- a/src/ambiguities.jl +++ b/src/ambiguities.jl @@ -127,7 +127,7 @@ function _find_ambiguities( cmd = `$cmd --startup-file=no -e $code` outfile, out = mktemp() - errfile, err = mktemp(; cleanup = false) + errfile, err = mktemp() succ = success(pipeline(cmd; stdout = out, stderr = err)) strout = read(outfile, String) strerr = read(errfile, String)