]> Cypherpunks repositories - gostls13.git/commitdiff
os/exec: add temporary debugging code for #25628
authorIan Lance Taylor <iant@golang.org>
Fri, 27 Mar 2020 17:09:26 +0000 (10:09 -0700)
committerIan Lance Taylor <iant@golang.org>
Fri, 27 Mar 2020 20:19:34 +0000 (20:19 +0000)
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 <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
src/os/exec/exec_test.go

index 91dd0a41acf66e3db0fbbe0e20e2982f46fdbfac..9d6069093e7d5a23b6ca795ef5b231d51288a3d3 100644 (file)
@@ -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
 }