os/exec: cmd.Output/StartProcess hangs on macOS 12.3 #52086
Labels
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
OS-Darwin
Milestone
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?OS: macOS Monterey Version 12.3 (21E230)
Arch: amd64 (Intel i9)
Bash: GNU bash, version 5.1.16(1)-release (x86_64-apple-darwin20.6.0)
KO_DOCKER_REPO set to a gcr repo - but I've reproduced this using kind.local as well (see kind setup)
Terminal: iTerm2 Build 3.4.15
go env
OutputWhat did you do?
What did you expect to see?
The
ko
program uses theos/exec.Cmd
package to kick off go builds and perform registry credential lookups.The program runs to completion
What did you see instead?
The program hangs calling
cmd.Output()
. It looks like it a fork/exec fails asps -l
it shows the forked process but it looks like exec wasn't invoked as the process name is the same.After some time the process state was
Parent Process Stack Dumps
Go routine stack traces for the parent and child process are here: https://gist.github.com/dprotaso/1e1c4c2abea19dbfbdbb61b221c0fdcc
Notes on reproducibility
I wasn't able to reproduce this in
zsh
onlybash
Using Apple's Terminal.app I couldn't reproduce the issue (~10 runs). Comparing the difference between the terminal apps I noticed iTerm had some extra env vars.
I figured out an env var having an affect.
__CF_USER_TEXT_ENCODING
. Setting this did causeko
in Apple's Terminal.app to start hangingAfter unset'ing that env var in iTerm I didn't encounter a hang (20 tries)
Unsure how that envvar has an affect on fork/exec
The text was updated successfully, but these errors were encountered: