go commands hang indefinitely

1,979 views
Skip to first unread message

Juan Monroy-Nieto

unread,
Apr 9, 2020, 8:16:55 PM4/9/20
to golang-nuts
Hello everyone, I am compelled to stop just lurking.

Go Version 1.14.1 on MacOS Mohave.

Similarly to a recent post, commands go build/vet/test/run hang indefinitely for any program including a hello world inside the GOPATH (copy pasted the code from the starting point in the playground). All the code I can test in the playground and in another mac runs fine. Unlike the cited post, this does not relate to internet connectivity. I have already posted this issue in StackOverflow to no avail. So I would like to ask for your help with this issue. I appreciate your help.

 I have tried troubleshooting by:
  • Resetting GOPATH
  • Starting a shell without my bashRC
  • Restarting my computer
  • Reinstalling Go 
  • Running go build -x yields normal calls and even an executable that runs fine (Last output is rm -r $WORK/b001/). It just does not exit, and ignores interrupt signals.
  • When it is running, a stack trace using dtruss shows ongoing syscalls that I am unable to interpret.
My go env output:


GO111MODULE
=""
GOARCH
="amd64"
GOBIN
="/bin"
GOCACHE
="/Users/user_name/Library/Caches/go-build"
GOENV
="/Users/user_name/Library/Application Support/go/env"
GOEXE
=""
GOFLAGS
=""
GOHOSTARCH
="amd64"
GOHOSTOS
="darwin"
GOINSECURE
=""
GONOPROXY
=""
GONOSUMDB
=""
GOOS
="darwin"
GOPATH
="/Users/user_name/go:/Users/user_name/goCode"
GOPRIVATE
=""
GOPROXY
="https://proxy.golang.org,direct"
GOROOT
="/usr/local/go"
GOSUMDB
="sum.golang.org"
GOTMPDIR
=""
GOTOOLDIR
="/usr/local/go/pkg/tool/darwin_amd64"
GCCGO
="gccgo"
AR
="ar"
CC
="clang"
CXX
="clang++"
CGO_ENABLED
="1"
GOMOD
=""
CGO_CFLAGS
="-g -O2"
CGO_CPPFLAGS
=""
CGO_CXXFLAGS
="-g -O2"
CGO_FFLAGS
="-g -O2"
CGO_LDFLAGS
="-g -O2"
PKG_CONFIG
="pkg-config"
GOGCCFLAGS
="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/6c/h189_j9s6tdbj_kw24g2kvchsk0515/T/go-build628238008=/tmp/go-build -gno-record-gcc-switches -fno-common"

Steven Hartland

unread,
Apr 9, 2020, 8:23:48 PM4/9/20
to Juan Monroy-Nieto, golang-nuts
What happens if you kill -ABRT the process?

--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/81548479-6676-4594-a0ba-6890003bafda%40googlegroups.com.

Kurtis Rader

unread,
Apr 9, 2020, 10:45:16 PM4/9/20
to Juan Monroy-Nieto, golang-nuts
FWIW, I'm using Go 1.14.1 on macOS Catalina (10.15.4) without issue. The one thing that seems weird in the information you provided is "GOBIN=/bin". Since /bin shouldn't be writable by you that should fail if you attempt a "go install". But that shouldn't affect a simple "go build". Also, having more than one path in "GOPATH" shouldn't cause any problems but is somewhat unusual.

My first guess is your environment has done something unusual with respect to how signals are handled. See "man execve". Note that signals blocked at the time a new process is started remain blocked. And ignored signals remain ignored unless the new process explicitly handles the signal. Unfortunately I don't know how to interrogate the signal disposition for a process on macOS since it doesn't have /proc and lldb doesn't appear to have a (simple) way to provide that info for a process.

--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/81548479-6676-4594-a0ba-6890003bafda%40googlegroups.com.


--
Kurtis Rader
Caretaker of the exceptional canines Junior and Hank

Jason E. Aten

unread,
Apr 10, 2020, 11:40:20 AM4/10/20
to golang-nuts
Sounds like it might be a go1.14.1 bug. Try under go1.13.10 to check.

juanmon...@gmail.com

unread,
Apr 10, 2020, 1:17:58 PM4/10/20
to golang-nuts
I'm not sure about those options, they are not available in my kill command implementation. I can add that my workaround wast to sleep ant then kill the process; because I had to use that repeatedly, I made it a function and called it euthanasia lol. It just disappeared.  What did you expect with those options?
To unsubscribe from this group and stop receiving emails from it, send an email to golan...@googlegroups.com.

juanmon...@gmail.com

unread,
Apr 10, 2020, 1:18:01 PM4/10/20
to golang-nuts
I had my computer reformated with a fresh image ( I can't do it myself because of company policy). I reinstalled go 1.14.1 and it is working fine. If I encounter the issue again I will try downgrading the go version. For the time being this made the problem go away.

Thank you guys for your help, it was a tricky one!
Reply all
Reply to author
Forward
0 new messages