go: cmd/link: malformed mach-o image: segment __DWARF has vmsize < filesize

What version of Go are you using (go version)?

why not fix this issue #32673 in the version of go1.13?

$ go version
go version go1.13.1 darwin/amd64

Does this issue reproduce with the latest release?

no

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

go env Output
$ go env
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/zhangliyong/Library/Caches/go-build"
GOENV="/Users/zhangliyong/Library/Application Support/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GONOPROXY=""
GONOSUMDB=""
GOOS="darwin"
GOPATH="/Users/zhangliyong/go"
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="/Users/zhangliyong/chain/go.mod"
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/rz/4wlrcszd55gf6s2j571bhlzr0000gn/T/go-build990418285=/tmp/go-build -gno-record-gcc-switches -fno-common"

What did you do?

Ran a shell script about golang testing.

What did you expect to see?

it works without errors

What did you see instead?

dyld: malformed mach-o image: segment __DWARF has vmsize < filesize

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 32 (12 by maintainers)

Most upvoted comments

I had the same problem, updated go with the newest version from the website and it worked again. Also on MacOS Catalina.

That commit actually landed before 1.13 debuted.

Seems to have been fixed in 1.13.4: https://github.com/golang/go/commit/26954bde4443c4bfbfe7608f35584b6b810f3f2c (sorry, didn’t know how to link this properly).

Discussion and closed issue: https://github.com/golang/go/issues/32673