From f5558bb2f580ed40374a98e8db6fd58ae79f6e1d Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Fri, 27 Mar 2020 10:09:26 -0700 Subject: [PATCH] os/exec: add temporary debugging code for #25628 On linux-386 builders run the TestExtraFiles subprocess under strace, in hopes of finding out where the unexpected descriptor is coming from. For #25628 Change-Id: I9a62d6a5192a076525a616ccc71de74bbe7ebd58 Reviewed-on: https://go-review.googlesource.com/c/go/+/225799 Run-TryBot: Ian Lance Taylor TryBot-Result: Gobot Gobot Reviewed-by: Bryan C. Mills --- src/os/exec/exec_test.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/os/exec/exec_test.go b/src/os/exec/exec_test.go index 91dd0a41ac..9d6069093e 100644 --- a/src/os/exec/exec_test.go +++ b/src/os/exec/exec_test.go @@ -79,6 +79,13 @@ func helperCommandContext(t *testing.T, ctx context.Context, s ...string) (cmd * } else { cmd = exec.Command(os.Args[0], cs...) } + + // Temporary code to try to resolve #25628. + // TODO(iant): Remove this when we no longer need it. + if runtime.GOARCH == "386" && runtime.GOOS == "linux" && testenv.Builder() != "" && len(s) == 1 && s[0] == "read3" && ctx == nil { + cmd = exec.Command("/usr/bin/strace", append([]string{"-f", os.Args[0]}, cs...)...) + } + cmd.Env = append(os.Environ(), "GO_WANT_HELPER_PROCESS=1") return cmd } -- 2.50.0