Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmd/cgo: segfault compiling github.com/jeffjen/datefmt #18126

Closed
petermattis opened this issue Nov 30, 2016 · 4 comments

Comments

@petermattis
Copy link

commented Nov 30, 2016

Please answer these questions before submitting your issue. Thanks!

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

~/Development/go/src/github.com/jeffjen/datefmt master ~/Development/go-1.8/bin/go version
go version devel +5d1b53a Wed Nov 30 19:46:00 2016 +0000 darwin/amd64

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

GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/pmattis/Development/go"
GORACE=""
GOROOT="/Users/pmattis/Development/go-1.8"
GOTOOLDIR="/Users/pmattis/Development/go-1.8/pkg/tool/darwin_amd64"
GCCGO="gccgo"
CC="clang"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/qc/fpqpgdqd167c70dtc6840xxh0000gn/T/go-build720217539=/tmp/go-build -gno-record-gcc-switches -fno-common"
CXX="clang++"
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"

What did you do?

If possible, provide a recipe for reproducing the error.
A complete runnable program is good.
A link on play.golang.org is best.

~/Development/go/src/github.com/jeffjen/datefmt master git rev-parse HEAD
6688647cfa0439b86e09b097cac96ed328d5fa34
~/Development/go/src/github.com/jeffjen/datefmt master ~/Development/go-1.8/bin/go install .
# github.com/jeffjen/datefmt
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x8 pc=0x112be4f]

goroutine 1 [running]:
main.(*Package).rewriteCall(0xc42008c1c0, 0xc4200aa000, 0xc4200bc1b0, 0xc420090b80, 0xc420075350)
	/Users/pmattis/Development/go-1.8/src/cmd/cgo/gcc.go:757 +0x11df
main.(*Package).rewriteCalls(0xc42008c1c0, 0xc4200aa000, 0xc420176000)
	/Users/pmattis/Development/go-1.8/src/cmd/cgo/gcc.go:612 +0x183
main.(*Package).Translate(0xc42008c1c0, 0xc4200aa000)
	/Users/pmattis/Development/go-1.8/src/cmd/cgo/gcc.go:170 +0x146
main.main()
	/Users/pmattis/Development/go-1.8/src/cmd/cgo/main.go:297 +0x868

What did you expect to see?

Success.

What did you see instead?

Failure.

Note this library compiles on go1.7.3.

@bradfitz bradfitz added this to the Go1.8 milestone Nov 30, 2016

@bradfitz

This comment has been minimized.

Copy link
Member

commented Nov 30, 2016

@mdempsky, you like cgo. Can you look?

Or @ianlancetaylor, but I bug Ian a lot.

@ianlancetaylor

This comment has been minimized.

Copy link
Contributor

commented Nov 30, 2016

I'm already looking at it. I see the problem.

@gopherbot

This comment has been minimized.

Copy link

commented Nov 30, 2016

CL https://golang.org/cl/33750 mentions this issue.

@gopherbot

This comment has been minimized.

Copy link

commented Nov 30, 2016

CL https://golang.org/cl/33752 mentions this issue.

@gopherbot gopherbot closed this in d4b704e Dec 1, 2016

@golang golang locked and limited conversation to collaborators Dec 1, 2017

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
5 participants
You can’t perform that action at this time.