You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Mock doesn't work or it triggers a signal SIGBUS Error on arm64 cpu, using [email protected].
在使用m3芯片的macbook pro时,使用arm64架构编译运行测试函数,百分百必现mock失效或者触发signal SIGBUS Error,go版本为1.20.5。
To Reproduce
Copy the code below to a new go file, then run the test funtion. I have set "Go tool argument" to -gcflags="all=-l -N" in Goland.
复制如下代码到一个新文件里,运行测试函数即可。我在goland中已经设置了go工具实参 -gcflags="all=-l -N"。
When set GOARCH=amd64, the test function can stably succeed, but can not be debugged step by step.
在mac上设置了GOARCH环境变量为amd64后,测试函数可以正常通过,但是无法单步调试,因为delve调试器必须使用arm64版本(跟实际CPU相适配),调试器跟环境变量冲突。
Screenshots
Mockey version:
v1.2.13
Environment:
GO111MODULE="auto"
GOARCH="arm64"
GOBIN=""
GOCACHE="/Users/agu/Library/Caches/go-build"
GOENV="/Users/agu/Library/Application Support/go/env"
GOEXE=""
GOEXPERIMENT=""
GOFLAGS=""
GOHOSTARCH="arm64"
GOHOSTOS="darwin"
GOINSECURE=""
GOMODCACHE="/Users/agu/go/pkg/mod"
GONOPROXY= you may not concern
GONOSUMDB= you may not concern
GOOS="darwin"
GOPATH="/Users/agu/go"
GOPRIVATE= you may not concern
GOPROXY= you may not concern
GOROOT="/usr/local/go"
GOSUMDB="sum.golang.org"
GOTMPDIR="/Users/agu/go/temp"
GOTOOLDIR="/usr/local/go/pkg/tool/darwin_arm64"
GOVCS=""
GOVERSION="go1.20.5"
GCCGO="gccgo"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD= you may not concern
GOWORK=""
CGO_CFLAGS="-O2 -g"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-O2 -g"
CGO_FFLAGS="-O2 -g"
CGO_LDFLAGS="-O2 -g"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -arch arm64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/Users/agu/go/temp/go-build2968640997=/tmp/go-build -gno-record-gcc-switches -fno-common"
Additional context
The text was updated successfully, but these errors were encountered:
We tried to reproduce many times but never encountered a BUS error. (M3+ go1.20.5 MacOS14.6.1)
Are you using an older version of MacOS? If so, try set go env -w CGO_ENABLED=0.
Describe the bug
Mock doesn't work or it triggers a signal SIGBUS Error on arm64 cpu, using [email protected].
在使用m3芯片的macbook pro时,使用arm64架构编译运行测试函数,百分百必现mock失效或者触发signal SIGBUS Error,go版本为1.20.5。
To Reproduce
Copy the code below to a new go file, then run the test funtion. I have set "Go tool argument" to
-gcflags="all=-l -N"
in Goland.复制如下代码到一个新文件里,运行测试函数即可。我在goland中已经设置了go工具实参
-gcflags="all=-l -N"
。Expected behavior
When set GOARCH=amd64, the test function can stably succeed, but can not be debugged step by step.
在mac上设置了GOARCH环境变量为amd64后,测试函数可以正常通过,但是无法单步调试,因为delve调试器必须使用arm64版本(跟实际CPU相适配),调试器跟环境变量冲突。
Screenshots
Mockey version:
v1.2.13
Environment:
GO111MODULE="auto"
GOARCH="arm64"
GOBIN=""
GOCACHE="/Users/agu/Library/Caches/go-build"
GOENV="/Users/agu/Library/Application Support/go/env"
GOEXE=""
GOEXPERIMENT=""
GOFLAGS=""
GOHOSTARCH="arm64"
GOHOSTOS="darwin"
GOINSECURE=""
GOMODCACHE="/Users/agu/go/pkg/mod"
GONOPROXY= you may not concern
GONOSUMDB= you may not concern
GOOS="darwin"
GOPATH="/Users/agu/go"
GOPRIVATE= you may not concern
GOPROXY= you may not concern
GOROOT="/usr/local/go"
GOSUMDB="sum.golang.org"
GOTMPDIR="/Users/agu/go/temp"
GOTOOLDIR="/usr/local/go/pkg/tool/darwin_arm64"
GOVCS=""
GOVERSION="go1.20.5"
GCCGO="gccgo"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD= you may not concern
GOWORK=""
CGO_CFLAGS="-O2 -g"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-O2 -g"
CGO_FFLAGS="-O2 -g"
CGO_LDFLAGS="-O2 -g"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -arch arm64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/Users/agu/go/temp/go-build2968640997=/tmp/go-build -gno-record-gcc-switches -fno-common"
Additional context
The text was updated successfully, but these errors were encountered: