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/compile: panic on go get golang.org/x/sys/unix with go 1.9.x #25561

Closed
nono opened this issue May 25, 2018 · 10 comments
Closed

cmd/compile: panic on go get golang.org/x/sys/unix with go 1.9.x #25561

nono opened this issue May 25, 2018 · 10 comments
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@nono
Copy link

nono commented May 25, 2018

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

go version go1.9 linux/amd64

Does this issue reproduce with the latest release?

No, it works fine with go1.10.

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

GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/travis/gopath"
GORACE=""
GOROOT="/home/travis/.gimme/versions/go1.9.linux.amd64"
GOTOOLDIR="/home/travis/.gimme/versions/go1.9.linux.amd64/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build054042360=/tmp/go-build -gno-record-gcc-switches"
CXX="g++"
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"

What did you do?

I cloned github.com/cozy/cozy-stack and run go get -t -v ./... from here.

What did you expect to see?

A success: all dependencies are installed

What did you see instead?

golang.org/x/sys/unix
# golang.org/x/sys/unix
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x97b3ab]
goroutine 1 [running]:
cmd/compile/internal/gc.dumpasmhdr()
	/usr/local/go/src/cmd/compile/internal/gc/export.go:389 +0x2ab
cmd/compile/internal/gc.Main(0xb73f90)
	/usr/local/go/src/cmd/compile/internal/gc/main.go:633 +0x280d
main.main()
	/usr/local/go/src/cmd/compile/main.go:49 +0x95

This issue was reproduced on our servers and on our CI (travis). For travis, the log is available: https://travis-ci.org/cozy/cozy-stack/jobs/383555937#L466

@gopherbot gopherbot added this to the Unreleased milestone May 25, 2018
@tklauser tklauser added the NeedsFix The path to resolution is known, but the work has not been done. label May 25, 2018
@tklauser tklauser modified the milestones: Unreleased, Go1.9.7 May 25, 2018
@tklauser tklauser changed the title x/sys: panic on go get golang.org/x/sys/unix cmd/compile: panic on go get golang.org/x/sys/unix with go 1.9.x May 25, 2018
@tklauser
Copy link
Member

Can reproduce this here with go 1.9.6.

I assume this requires a backport of https://golang.org/cl/80759 to the 1.9 branch?

/cc @ianlancetaylor @mdempsky

@tklauser
Copy link
Member

FWIW the culprit in x/sys/unix seems to be this type alias:

type Nfgenmsg = struct {
	Nfgen_family uint8
	Version      uint8
	Res_id       uint16
}

from https://github.com/golang/sys/blob/31355384c89b50e6faeffdb36f64a77a8210188e/unix/ztypes_linux_amd64.go#L1405-L1409, introduced by https://golang.org/cl/114518

@tklauser
Copy link
Member

As noted in #25563, I think this should also be fixed in x/sys/unix. Let's make this issue about the fix in cmd/compile for go 1.9 and #25563 about the fix in x/sys/unix.

@ganelon13
Copy link

ganelon13 commented May 25, 2018

got the same problem with go1.9.3 linux/amd64

# golang.org/x/sys/unix
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x97ca3b]

goroutine 1 [running]:
cmd/compile/internal/gc.dumpasmhdr()
        /usr/local/go/src/cmd/compile/internal/gc/export.go:389 +0x2ab
cmd/compile/internal/gc.Main(0xb770b8)
        /usr/local/go/src/cmd/compile/internal/gc/main.go:633 +0x280d
main.main()
        /usr/local/go/src/cmd/compile/main.go:49 +0x95

@jonnenauha
Copy link

jonnenauha commented May 25, 2018

Getting this as well with 1.9.4. The package should be reverted or modified to work with 1.8/1.9 if there is no good reason for this (until 1.9 gets a fix). Otherwise we (users) are basically forced to wait for a new 1.9 release or update to 1.10. Did I understand that correctly?

I'm going to update now, cant wait for this if build bots can't build any projects with this package imported.

@tklauser
Copy link
Member

@jonnenauha yes, as mentioned in #25563 the issue in x/sys/unix should be fixed regardless of a fix in the 1.9 branch. I'll send one shortly.

@gopherbot
Copy link

Change https://golang.org/cl/114596 mentions this issue: unix: make Nfgenmsg a type definition

gopherbot pushed a commit to golang/sys that referenced this issue May 25, 2018
CL 114518 introduced Nfgenmsg as a type alias which breaks the build on
Go <= 1.9. Fix it by making Nfgenmsg a type like all others in
x/sys/unix

Updates golang/go#25561
Fixes golang/go#25563

Change-Id: I9950be857e34e7e3ca79c71fced9663a0cac9b63
Reviewed-on: https://go-review.googlesource.com/114596
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
@Deleplace
Copy link
Contributor

Got the same problem with 1.9.2. Upgraded to 1.10.2, now everything works fine.

@FiloSottile FiloSottile modified the milestones: Go1.9.7, Go1.9.8 Jun 6, 2018
@gopherbot
Copy link

Change https://golang.org/cl/118475 mentions this issue: [release-branch.go1.9] cmd/compile: make -asmhdr work with type aliases

@gopherbot
Copy link

Closed by merging 1746cff to release-branch.go1.9.

gopherbot pushed a commit that referenced this issue Jun 13, 2018
For "type T = U" we were accidentally emitting a #define for "U__size"
instead of "T__size".

Updates #22877.
Fixes #25561.

Change-Id: I5ed6757d697753ed6d944077c16150759f6e1285
Reviewed-on: https://go-review.googlesource.com/80759
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
(cherry picked from commit 2f588ff)
Reviewed-on: https://go-review.googlesource.com/118475
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
Reviewed-by: Andrew Bonventre <andybons@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
@golang golang locked and limited conversation to collaborators Jun 13, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Projects
None yet
Development

No branches or pull requests

7 participants