Fatal error: runtime: bsdthread_register error

I installed GO from https://golang.org/dl/ on my Mac. I’m on OS X 10.9.3.

I added these to my .bash_profile:

export GOPATH=$HOME/work
export PATH=$PATH:$GOPATH/bin

I created a first simple GO hello program:

package main
import "fmt"
func main() {
    fmt.Printf("hello, world\n")
}

When I ran, I got the following error:

fatal error: runtime: bsdthread_register error

runtime stack:
runtime.throw(0x124d20, 0x21)
	/usr/local/go/src/runtime/panic.go:527 +0x90 fp=0x7fff5fbff9e0 sp=0x7fff5fbff9c8
runtime.goenvs()
	/usr/local/go/src/runtime/os1_darwin.go:73 +0x8d fp=0x7fff5fbffa08 sp=0x7fff5fbff9e0
runtime.schedinit()
	/usr/local/go/src/runtime/proc1.go:60 +0x83 fp=0x7fff5fbffa50 sp=0x7fff5fbffa08
runtime.rt0_go(0x7fff5fbffa80, 0x1, 0x7fff5fbffa80, 0x0, 0x1, 0x7fff5fbffba0, 0x0, 0x7fff5fbffbe0, 0x7fff5fbffbfc, 0x7fff5fbffc0c, ...)
	/usr/local/go/src/runtime/asm_amd64.s:109 +0x132 fp=0x7fff5fbffa58 sp=0x7fff5fbffa50

Hi,

Have you checked https://groups.google.com/forum/#!topic/golang-nuts/HtcZc3wO-rw ?

Best,

Marcos.

Hi Marcos,

Using the ‘-ldflags -linkmode=external’ flags with the ‘go build’ works. But does anyone know how to fix the environment so I don’t have to use the build flags?

Hi Janny,

As stated in the golang-nuts thread have you checked that you don’t have
any intrusion software (antivirus / websense, etc) which is preventing Go
to run correctly?

Yup, this is quite likely to be some AV software installed on your Mac.

Hi @dfc and @marcosnils , we found the problem. The DYLD_LIBRARY_PATH environmental variable was set. Once we exported this to empty value DYLD_LIBRARY_PATH= inside the .bash_profile, the error went away. Thanks for all the help.

This sounds like a bandaid. For all reported cases so far, the cause of this error has been faulty AV software.

I think she was running something but I don’t remember if she uninstalled it. I did tell her if something stopped working to take note of this change we make to her environment. I was just glad to find a solution that did not require the use of those extra flags. Thanks!

McAfee Endpoint is running on my Mac. Unfortunately I don’t have root permission to uninstall it. Thanks everyone for all your help!!

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.