aboutsummaryrefslogtreecommitdiff
path: root/src/syscall/exec_libc2.go
diff options
context:
space:
mode:
authorBryan C. Mills <bcmills@google.com>2023-01-10 11:29:25 -0500
committerGopher Robot <gobot@golang.org>2023-01-10 17:59:34 +0000
commit82f09b75ca181a6be0e594e1917e4d3d91934b27 (patch)
treeefaf6f280ddeae344ee84bfb6800a54828ed73f9 /src/syscall/exec_libc2.go
parent0202ad0b3a2bfddf9f3eafb94e19d5a0fa3d1f31 (diff)
downloadgo-82f09b75ca181a6be0e594e1917e4d3d91934b27.tar.xz
os/exec: avoid leaking an exec.Cmd in TestWaitInterrupt
In CL 436655 I added a GODEBUG setting to this test process to verify that Wait is eventually called for every exec.Cmd before it becomes unreachable. However, the cmdHang test helpers in TestWaitInterrupt/Exit-hang and TestWaitInterrupt/SIGKILL-hang intentially leak a subprocess in order to simulate a leaky third-party program, as Go users might encounter in practical use. To avoid tripping over the leak check, we call Wait on the leaked subprocess in a background goroutine. Since we expect the process running cmdHang to exit before its subprocess does, the call to Wait should have no effect beyond suppressing the leak check. Fixes #57596. Updates #52580. Updates #50436. Change-Id: Ia4b88ea47fc6b605c27ca6d9d7669c874867a900 Reviewed-on: https://go-review.googlesource.com/c/go/+/460998 Run-TryBot: Bryan Mills <bcmills@google.com> Auto-Submit: Bryan Mills <bcmills@google.com> Reviewed-by: Ian Lance Taylor <iant@google.com> TryBot-Result: Gopher Robot <gobot@golang.org>
Diffstat (limited to 'src/syscall/exec_libc2.go')
0 files changed, 0 insertions, 0 deletions