golang / go

The Go programming language
https://go.dev
BSD 3-Clause "New" or "Revised" License
123.84k stars 17.65k forks source link

runtime: bsdthread_register error on OS X #16730

Closed kevingo closed 8 years ago

kevingo commented 8 years ago

Please answer these questions before submitting your issue. Thanks!

1.What version of Go are you using (go version)? go version go1.7 darwin/amd64

2.What operating system and processor architecture are you using (go env)?

GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/kevin/mygo"
GORACE=""
GOROOT="/usr/local/go"
GOTOOLDIR="/usr/local/go/pkg/tool/darwin_amd64"
CC="clang"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -gno-record-gcc-switches -fno-common"
CXX="clang++"
CGO_ENABLED="1"

3.What did you do?

I install go 1.7 from https://storage.googleapis.com/golang/go1.7.darwin-amd64.pkg. I create a helloworld project and type go build, it comes the following errors:

fatal error: runtime: bsdthread_register error

runtime stack:
runtime.throw(0x505ddb, 0x21)
    /usr/local/go/src/runtime/panic.go:566 +0x95 fp=0x7fff5fbff280 sp=0x7fff5fbff260
runtime.goenvs()
    /usr/local/go/src/runtime/os_darwin.go:88 +0xa0 fp=0x7fff5fbff2b0 sp=0x7fff5fbff280
runtime.schedinit()
    /usr/local/go/src/runtime/proc.go:450 +0x9c fp=0x7fff5fbff2f0 sp=0x7fff5fbff2b0
runtime.rt0_go(0x7fff5fbff328, 0x10, 0x7fff5fbff328, 0x0, 0x0, 0x10, 0x7fff5fbff5a8, 0x7fff5fbff5d4, 0x7fff5fbff5d7, 0x7fff5fbff627, ...)
    /usr/local/go/src/runtime/asm_amd64.s:145 +0x14f fp=0x7fff5fbff2f8 sp=0x7fff5fbff2f0

4.The OS information is :

ProductName:    Mac OS X
ProductVersion: 10.10.5
BuildVersion:   14F27

Running unset DYLD_INSERT_LIBRARIES has no effect.

Thanks helping in advance.

bradfitz commented 8 years ago

Dup of #8801 I suspect.

Are you running antivirus software?

kevingo commented 8 years ago

@bradfitz Thanks for replying. I think I do not install any AV or antivirus software.

bradfitz commented 8 years ago

Well, something is different on your machine, because we test Go on all versions of OS X continuously and we haven't seen this problem.

Is it your work computer, or personal?

kevingo commented 8 years ago

@bradfitz It's work computer.

bradfitz commented 8 years ago

Work computer makes me suspect antivirus even more. Companies love antivirus.

Can you look at process list and verify there's nothing else running?

Does the problem not happen with Go 1.6?

rsc commented 8 years ago

ping @kevingo

Brad asked if it happens on Go 1.6 and whether you can check your system process list and see if there's any anti virus software lurking.

I'm also curious if there are any other DYLD environment variables (env | grep DYLD).

kevingo commented 8 years ago

@rsc @bradfitz Hi, I re-install my computer and everything works fine now. And the env | grep DYLD output nothing.

Thanks for the reminder.