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

x/sys: Commit bc7efcf introduced a compilation error #36032

Closed
brotherlogic opened this issue Dec 7, 2019 · 18 comments
Closed

x/sys: Commit bc7efcf introduced a compilation error #36032

brotherlogic opened this issue Dec 7, 2019 · 18 comments
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@brotherlogic
Copy link

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

$ go version
go version go1.12.14 linux/arm 

Does this issue reproduce with the latest release?

Not sure

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

go env Output
$ go env

GOARCH="arm"
GOBIN=""
GOCACHE="/home/simon/.cache/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="arm"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/simon/code"
GOPROXY=""
GORACE=""
GOROOT="/usr/lib/go"
GOTMPDIR=""
GOTOOLDIR="/usr/lib/go/pkg/tool/linux_arm"
GCCGO="gccgo"
GOARM="6"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD=""
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -marm -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build242404953=/tmp/go-build -gno-record-gcc-switches"

What did you do?

go build on any binary

What did you expect to see?

Compilation

What did you see instead?

golang.org/x/sys/unix

/home/simon/code/src/golang.org/x/sys/unix/zptrace_armnn_linux.go:45:57: cannot use uint64(unsafe.Sizeof(*regsout)) (type uint64) as type uint32 in field value
/home/simon/code/src/golang.org/x/sys/unix/zptrace_armnn_linux.go:51:54: cannot use uint64(unsafe.Sizeof(*regs)) (type uint64) as type uint32 in field value

@gopherbot gopherbot added this to the Unreleased milestone Dec 7, 2019
@stgraber
Copy link

stgraber commented Dec 7, 2019

I was literally writing the exact same report.

root@go-armhf:~# go get golang.org/x/sys/unix
# golang.org/x/sys/unix
go/src/golang.org/x/sys/unix/zptrace_armnn_linux.go:45:57: cannot use uint64(unsafe.Sizeof(*regsout)) (type uint64) as type uint32 in field value
go/src/golang.org/x/sys/unix/zptrace_armnn_linux.go:51:54: cannot use uint64(unsafe.Sizeof(*regs)) (type uint64) as type uint32 in field value
root@go-armhf:~# go version
go version go1.13.5 linux/arm

@stgraber
Copy link

stgraber commented Dec 7, 2019

bc7efcf is the commit modifying zptrace_armnn_linux.go and introducing the issue.

@stgraber
Copy link

stgraber commented Dec 7, 2019

golang/sys@bc7efcf

@ianlancetaylor ianlancetaylor added the NeedsFix The path to resolution is known, but the work has not been done. label Dec 7, 2019
@ianlancetaylor
Copy link
Contributor

I can't think of any approach we can use here other than generating yet another zptrace file.

@happyEgg
Copy link

happyEgg commented Dec 7, 2019

I had the same problem, when i execute gomobile build -target=android
go version go1.13.5 darwin/amd64
gomobile is latest
gomobile log:
commit 5c0e7e404af8b014d8b7de89f9522bc92463f3cb (HEAD -> master, origin/master, origin/HEAD)
Author: Hajime Hoshi hajimehoshi@gmail.com
Date: Wed Nov 27 22:57:30 2019 +0900

@probonopd
Copy link

probonopd commented Dec 7, 2019

Also running into this error. Getting this lately:

env CC=arm-linux-gnueabi-gcc CGO_ENABLED=1 GOOS=linux GOARCH=arm GOARM=5 go build -trimpath -ldflags="-s -w -X main.commit=$COMMIT" github.com/probonopd/go-appimage/src/appimaged

# golang.org/x/sys/unix

../../../go/src/golang.org/x/sys/unix/zptrace_armnn_linux.go:45:57: cannot use uint64(unsafe.Sizeof(*regsout)) (type uint64) as type uint32 in field value

../../../go/src/golang.org/x/sys/unix/zptrace_armnn_linux.go:51:54: cannot use uint64(unsafe.Sizeof(*regs)) (type uint64) as type uint32 in field value

https://travis-ci.com/probonopd/go-appimage/jobs/264315306#L297-L300

It the bug related to this change?
https://go-review.googlesource.com/c/sys/+/204418

@brotherlogic brotherlogic changed the title x/sys: Commit eeba5f6 introduced a compilation error x/sys: Commit bc7efcf introduced a compilation error Dec 7, 2019
@MarcelEeken
Copy link

Also just ran into this issue

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

$ go version
go version go1.13.5 darwin/amd64

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

go env Output
$ go env
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/marcel/Library/Caches/go-build"
GOENV="/Users/marcel/Library/Application Support/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GONOPROXY=""
GONOSUMDB=""
GOOS="darwin"
GOPATH="/Users/marcel/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/marcel/prive/enmon/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/0s/tlwngfxs4l76lnlk8j3z0s2h0000gn/T/go-build442831853=/tmp/go-build -gno-record-gcc-switches -fno-common"

What did you do?

Trying to cross compile for ARM target

$ GOOS=linux GOARCH=arm GOARM=6 go build -o build/enmon_arm
# golang.org/x/sys/unix
../../go/pkg/mod/golang.org/x/sys@v0.0.0-20191206220618-eeba5f6aabab/unix/zptrace_armnn_linux.go:45:57: cannot use uint64(unsafe.Sizeof(*regsout)) (type uint64) as type uint32 in field value
../../go/pkg/mod/golang.org/x/sys@v0.0.0-20191206220618-eeba5f6aabab/unix/zptrace_armnn_linux.go:51:54: cannot use uint64(unsafe.Sizeof(*regs)) (type uint64) as type uint32 in field value

@ianlancetaylor
Copy link
Contributor

No need to keep reporting the problem. https://golang.org/wiki/NoPlusOne. Thanks.

We know there is a problem and we will either roll back the change or add a fix.

@erifan
Copy link

erifan commented Dec 9, 2019

Sorry for the trouble. I'll fix it as soon as possible.

@bus710
Copy link

bus710 commented Dec 9, 2019

A band-aid for beginners like me, pick an older version in the go.mod like this:

golang.org/x/sys v0.0.0-20191126131656-8a8471f7e56d // indirect

@erifan
Copy link

erifan commented Dec 9, 2019

I have sent out a fix (https://go-review.googlesource.com/c/sys/+/210322) but the page did not refresh.

@zikaeroh
Copy link
Contributor

zikaeroh commented Dec 9, 2019

You have to write Fixes golang/go#36032, not Fixes #36032 to get gopherbot to recognize the issue when working from a repo other than the main Go repo.

@gopherbot
Copy link
Contributor

Change https://golang.org/cl/210322 mentions this issue: unix: move functions Ptrace{Get|Set}RegSetArm64 to a separate file

@erifan
Copy link

erifan commented Dec 9, 2019

@zikaeroh Thanks.

@zhangfannie
Copy link
Contributor

@ianlancetaylor What about redefining Iovec{} struct as IovecArm64{] struct in unix/zptrace_armnn_linux.go file?

@sigkill
Copy link

sigkill commented Dec 9, 2019

Also breaking P4wnP1_aloa too...

@probonopd
Copy link

A band-aid for beginners like me, pick an older version in the go.mod like this:

What if one doesn't use modules?

@bus710
Copy link

bus710 commented Dec 9, 2019

A band-aid for beginners like me, pick an older version in the go.mod like this:

What if one doesn't use modules?

Not sure how many of package managers out there but for Go Dep at least:

LucasRoesler added a commit to LucasRoesler/faas-cli that referenced this issue Sep 17, 2020
**What**
- Pin the version of golang/x/sys  It introduced a bug in arm builds,
  see golang/go#36032. This is needed by
  docker. Per this
  ory/dockertest#208 (comment)
  we can pin golang/x/sys to f9321e4c35a6 for a proper build

Signed-off-by: Lucas Roesler <roesler.lucas@gmail.com>
alexellis pushed a commit to openfaas/faas-cli that referenced this issue Sep 17, 2020
**What**
- Pin the version of golang/x/sys  It introduced a bug in arm builds,
  see golang/go#36032. This is needed by
  docker. Per this
  ory/dockertest#208 (comment)
  we can pin golang/x/sys to f9321e4c35a6 for a proper build

Signed-off-by: Lucas Roesler <roesler.lucas@gmail.com>
@golang golang locked and limited conversation to collaborators Dec 9, 2020
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