英文:
Race detector runtime error
问题
golang竞争检测器崩溃/无法运行。错误输出如下:
$ go test -race
# testmain
runtime.RaceErrors: 重定位目标__tsan_report_count未定义
runtime.RaceErrors: 未定义:"__tsan_report_count"
FAIL raft/vendor/raft/connectionManager [构建失败]
go是从Ubuntu存储库中新安装的1.8版本。
Go竞争时运行时从apt重新安装。
go env:
GOARCH="amd64"
GOBIN="~/Source/Go--Dev/bin"
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="~/Source/Go--Dev"
GORACE=""
GOROOT="/usr/lib/go-1.8"
GOTOOLDIR="/usr/lib/go-1.8/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build905991578=/tmp/go-build -gno-record-gcc-switches"
CXX="g++"
CGO_ENABLED="1"
PKG_CONFIG="pkg-config"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
提前谢谢!
英文:
The golang race detector is crashing/not running. Error output is:
$ go test -race
# testmain
runtime.RaceErrors: relocation target __tsan_report_count not defined
runtime.RaceErrors: undefined: "__tsan_report_count"
FAIL raft/vendor/raft/connectionManager [build failed]
go is newly installed 1.8 from Ubuntu repository.
Go race runtime was reinstalled from apt.
go env:
GOARCH="amd64"
GOBIN="~/Source/Go--Dev/bin"
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="~/Source/Go--Dev"
GORACE=""
GOROOT="/usr/lib/go-1.8"
GOTOOLDIR="/usr/lib/go-1.8/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build905991578=/tmp/go-build -gno-record-gcc-switches"
CXX="g++"
CGO_ENABLED="1"
PKG_CONFIG="pkg-config"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
Thank you in advance!
答案1
得分: 2
我遇到了同样的问题。在我的情况下,我使用的是一台新机器,只是还没有安装gcc
。在运行sudo apt install gcc
之后,一切都正常了。
英文:
I had the same issue. In my case, I was on a new machine and simply did not have gcc
installed yet. After sudo apt install gcc
everything worked fine.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论