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

runtime: crash when cross compiled for raspberry pi #30078

Closed
nandra opened this issue Feb 4, 2019 · 4 comments
Closed

runtime: crash when cross compiled for raspberry pi #30078

nandra opened this issue Feb 4, 2019 · 4 comments
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. release-blocker
Milestone

Comments

@nandra
Copy link

nandra commented Feb 4, 2019

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

$ go version
1.11.2

Does this issue reproduce with the latest release?

Yes

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

x86_64 cross compiled for arm

go env Output
$ go env
GOARCH="amd64"
GOBIN=""
GOCACHE="/root/.cache/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/root/go"
GOPROXY=""
GORACE=""
GOROOT="/usr/local/go"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
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 -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build099564701=/tmp/go-build -gno-record-gcc-switches"

What did you do?

cross compile mender client for raspberrypi
by using:

env CGO_ENABLED=1 \
    CC=arm-linux-gnueabihf-gcc \
    GOOS=linux \
    GOARM=6 \
    GOARCH=arm make build

when run image on rpi0w we get this (in gdb):

Program received signal SIGSEGV, Segmentation fault.
0x00062540 in runtime.typesEqual (
   seen=map[runtime._typePair]struct {}<error reading variable: Cannot access memory at address 0x3ed>, t=0x3e8, v=0xd, ~r3=<optimized out>)
   at /usr/local/go/src/runtime/type.go:623
623                     for i := 0; i < len(tout); i++ {

What did you expect to see?

mender to run raspberrypi

What did you see instead?

Segmentation fault

@ianlancetaylor ianlancetaylor changed the title Crash when cross compile for raspberrypi runtime: crash when cross compiled for raspberry pi Feb 4, 2019
@ianlancetaylor
Copy link
Contributor

There is no Go version 1.12.1 yet, I assume you mean 1.11.1.

Is this crash reproducible? How often does it happen?

Can you share a program that reproduces the problem?

The error looks like memory corruption. The description of your build suggests that your program includes C code. How sure are you that that is not introducing memory corruption somewhere?

@ianlancetaylor ianlancetaylor added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Feb 4, 2019
@ianlancetaylor ianlancetaylor added this to the Go1.13 milestone Feb 4, 2019
@ianlancetaylor ianlancetaylor added the WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. label Feb 4, 2019
@nandra
Copy link
Author

nandra commented Feb 4, 2019

Sorry go version is 1.11.2 (updated original comment). Issue happens every time I run binary.

Program source is mender client:
https://github.com/mendersoftware/mender

Mender build for x86 or other arm board like orangepi works perfectly fine.

@ianlancetaylor ianlancetaylor added release-blocker and removed WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. labels Feb 4, 2019
@nandra
Copy link
Author

nandra commented Feb 5, 2019

Turns out that wrong toolchain was used. Linaro tpplchains support armv7+ but raspberrypi0w is armv6 architecture. When used toochain from raspberrypi everything works. Sorry for noise. Closing.

@nandra nandra closed this as completed Feb 5, 2019
@ianlancetaylor
Copy link
Contributor

Thanks for following up.

@golang golang locked and limited conversation to collaborators Feb 6, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. release-blocker
Projects
None yet
Development

No branches or pull requests

3 participants