From 9f343b1942356e0c87c6994118be298f634e6b4d Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Tue, 24 Mar 2020 13:13:38 -0700 Subject: [PATCH] os/exec: for TestExtraFiles failure, print readlink of unexpected fd For #25628 Change-Id: If1dce7ba9310e1418e67b9954c989471b775a28e Reviewed-on: https://go-review.googlesource.com/c/go/+/225278 Run-TryBot: Ian Lance Taylor Reviewed-by: Bryan C. Mills TryBot-Result: Gobot Gobot --- src/os/exec/exec_test.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/os/exec/exec_test.go b/src/os/exec/exec_test.go index dce66c5c2e184f..91dd0a41acf66e 100644 --- a/src/os/exec/exec_test.go +++ b/src/os/exec/exec_test.go @@ -861,6 +861,9 @@ func TestHelperProcess(*testing.T) { } if got := f.Fd(); got != wantfd { fmt.Printf("leaked parent file. fd = %d; want %d\n", got, wantfd) + fdfile := fmt.Sprintf("/proc/self/fd/%d", wantfd) + link, err := os.Readlink(fdfile) + fmt.Printf("readlink(%q) = %q, %v\n", fdfile, link, err) var args []string switch runtime.GOOS { case "plan9":