go: cmd/link: darwin_amd64: running dsymutil failed: signal: segmentation fault

Just to get this out of the way: a very similar issue was described in #23046, but I’m running a version of Go that includes the fix to that issue.

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

go version devel +a62071a209 Sat Jan 6 04:52:00 2018 +0000 darwin/amd64

Does this issue reproduce with the latest release?

No.

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

GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/benesch/Library/Caches/go-build"
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/benesch/go"
GORACE=""
GOROOT="/usr/local/Cellar/go/HEAD-a62071a/libexec"
GOTMPDIR=""
GOTOOLDIR="/usr/local/Cellar/go/HEAD-a62071a/libexec/pkg/tool/darwin_amd64"
GCCGO="gccgo"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
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/2m/klw683vj1575nyyymnc0mr280000gn/T/go-build978307768=/tmp/go-build -gno-record-gcc-switches -fno-common"

What did you do?

go get -d github.com/cockroachdb/cockroach
cd $(go env GOPATH)/src/github.com/cockroachdb/cockroach
make build GOVERS=.

What did you expect to see?

A built cockroach binary.

What did you see instead?

go build -i -o ./cockroach -v  -tags ' make x86_64_apple_darwin16.7.0' -ldflags ' -X github.com/cockroachdb/cockroach/pkg/build.typ=development -X "github.com/cockroachdb/cockroach/pkg/build.tag=up-784-g742b93b01" -X "github.com/cockroachdb/cockroach/pkg/build.utcTime=2018/01/08 15:31:57" -X "github.com/cockroachdb/cockroach/pkg/build.rev=742b93b0111e0370bf793aeb3323ad153dd2635d"' .
# github.com/cockroachdb/cockroach
/usr/local/Cellar/go/HEAD-a62071a/libexec/pkg/tool/darwin_amd64/link: /usr/local/Cellar/go/HEAD-a62071a/libexec/pkg/tool/darwin_amd64/link: running dsymutil failed: signal: segmentation fault

A few thoughts, in no particular order:

  • The affected package depends on several packages that make heavy use of cgo.
  • I’m afraid I don’t have the expertise necessary to produce a smaller reproduction. I don’t have the faintest idea what’s going wrong.
  • You only need to run make build in the Cockroach repository once to compile a few C/C++ dependencies. We generate Go files with the appropriate cgo flags so that, after the first make build, a bare go build will work correctly (until the C/C++ dependencies need to be recompiled, of course).
  • I’ve collected the output of go build -x -ldflags=-v.
  • go build -ldflags=s and go build -ldflags=-w both produce working binaries, which suggests the problem is DWARF-related, as in #23046.

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Reactions: 1
  • Comments: 17 (14 by maintainers)

Commits related to this issue

Most upvoted comments

Agree with @benesch – there are many reasons why dsymutil can have problems. Please file an issue if possible.

Change https://golang.org/cl/87055 mentions this issue: cmd/compile: workaround for inconsistent receiver param srcpos