Skip to content

cmd/go: cross build mips64/mips64le on ubuntu24 crash(only go1.22) #72125

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

Closed
timandy opened this issue Mar 6, 2025 · 3 comments
Closed

cmd/go: cross build mips64/mips64le on ubuntu24 crash(only go1.22) #72125

timandy opened this issue Mar 6, 2025 · 3 comments
Labels
BugReport Issues describing a possible bug in the Go implementation. WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.

Comments

@timandy
Copy link

timandy commented Mar 6, 2025

Go version

go version go1.22.12 linux/amd64

Output of go env in your module/workspace:

GO111MODULE='on'
GOARCH='amd64'
GOBIN='/mnt/e/.go/bin'
GOCACHE='/root/.cache/go-build'
GOENV='/root/.config/go/env'
GOEXE=''
GOEXPERIMENT=''
GOFLAGS=''
GOHOSTARCH='amd64'
GOHOSTOS='linux'
GOINSECURE=''
GOMODCACHE='/mnt/e/.go/pkg/mod'
GONOPROXY=''
GONOSUMDB=''
GOOS='linux'
GOPATH='/mnt/e/.go'
GOPRIVATE=''
GOPROXY='https://goproxy.cn,direct'
GOROOT='/usr/local/go'
GOSUMDB='sum.golang.org'
GOTMPDIR=''
GOTOOLCHAIN='auto'
GOTOOLDIR='/usr/local/go/pkg/tool/linux_amd64'
GOVCS=''
GOVERSION='go1.22.12'
GCCGO='gccgo'
GOAMD64='v1'
AR='ar'
CC='gcc'
CXX='g++'
CGO_ENABLED='1'
GOMOD='/mnt/e/demos/godemo/go.mod'
GOWORK=''
CGO_CFLAGS='-O2 -g'
CGO_CPPFLAGS=''
CGO_CXXFLAGS='-O2 -g'
CGO_FFLAGS='-O2 -g'
CGO_LDFLAGS='-O2 -g'
PKG_CONFIG='pkg-config'
GOGCCFLAGS='-fPIC -m64 -pthread -Wl,--no-gc-sections -fmessage-length=0 -ffile-prefix-map=/tmp/go-build4181491618=/tmp/go-build -gno-record-gcc-switches'

What did you do?

  1. create a simple unit test.
package main

import (
	"fmt"
	"testing"
)

func TestDemo(t *testing.T) {
	fmt.Println("hello world")
}
  1. install qemu-user-static on ubuntu24.
          sudo apt-get update
          sudo apt-get -y install qemu-user-static
  1. cross build and test the code.
export GOOS=linux
export GOARCH=mips64
go test -v -coverprofile="coverage.txt" -covermode=atomic ./...

What did you see happen?

  1. got crash
fatal error: unexpected signal during runtime execution
[signal SIGBUS: bus error code=0x1 addr=0xc000094b34 pc=0x59f18]

goroutine 1 gp=0xc0000021c0 m=0 mp=0x342d20 [running]:
runtime.throw({0x219894, 0x2a})
	/usr/local/go/src/runtime/panic.go:1023 +0x58 fp=0xc000094a68 sp=0xc000094a40 pc=0x5f000
runtime.sigpanic()
	/usr/local/go/src/runtime/signal_unix.go:865 +0x5e4 fp=0xc000094ac8 sp=0xc000094a68 pc=0x81b04
runtime.netpollinit()
	/usr/local/go/src/runtime/netpoll_epoll.go:38 +0xf8 fp=0xc000094b58 sp=0xc000094ad0 pc=0x59f18
runtime.netpollGenericInit()
	/usr/local/go/src/runtime/netpoll.go:218 +0xa8 fp=0xc000094b68 sp=0xc000094b58 pc=0x59568
runtime.doaddtimer(0xc000030008, 0xc00007e058)
	/usr/local/go/src/runtime/time.go:294 +0x60 fp=0xc000094bc0 sp=0xc000094b68 pc=0x8d070
runtime.addtimer(0xc00007e058)
	/usr/local/go/src/runtime/time.go:280 +0xfc fp=0xc000094c00 sp=0xc000094bc0 pc=0x8cf34
time.startTimer(0xc00007e058)
	/usr/local/go/src/runtime/time.go:215 +0x40 fp=0xc000094c10 sp=0xc000094c00 pc=0xa8dd0
time.AfterFunc(0x8bb2c97000, 0xc0000261a0)
	/usr/local/go/src/time/sleep.go:172 +0xd4 fp=0xc000094c40 sp=0xc000094c10 pc=0xf4e64
testing.(*M).startAlarm(0xc000110000)
	/usr/local/go/src/testing/testing.go:2352 +0x104 fp=0xc000094c98 sp=0xc000094c40 pc=0x1a1b8c
testing.(*M).Run(0xc000110000)
	/usr/local/go/src/testing/testing.go:2025 +0x7ac fp=0xc000094ee0 sp=0xc000094c98 pc=0x19e96c
main.main()
	_testmain.go:81 +0x228 fp=0xc000094f68 sp=0xc000094ee0 pc=0x1c24e0
runtime.main()
	/usr/local/go/src/runtime/proc.go:271 +0x39c fp=0xc000094fd8 sp=0xc000094f68 pc=0x62b74
runtime.goexit({})
	/usr/local/go/src/runtime/asm_mips64x.s:671 +0x4 fp=0xc000094fd8 sp=0xc000094fd8 pc=0xab6f4

goroutine 2 gp=0xc000002700 m=nil [force gc (idle)]:
runtime.gopark(0x21d800, 0x341e10, 0x11, 0xa, 0x1)
	/usr/local/go/src/runtime/proc.go:402 +0x140 fp=0xc000042fa8 sp=0xc000042f90 pc=0x63250
runtime.goparkunlock(...)
	/usr/local/go/src/runtime/proc.go:408
runtime.forcegchelper()
	/usr/local/go/src/runtime/proc.go:326 +0x13c fp=0xc000042fd8 sp=0xc000042fa8 pc=0x62fec
runtime.goexit({})
	/usr/local/go/src/runtime/asm_mips64x.s:671 +0x4 fp=0xc000042fd8 sp=0xc000042fd8 pc=0xab6f4
created by runtime.init.5 in goroutine 1
	/usr/local/go/src/runtime/proc.go:314 +0x48

goroutine 17 gp=0xc000084000 m=nil [GC sweep wait]:
runtime.gopark(0x21d800, 0x342080, 0xc, 0x9, 0x1)
	/usr/local/go/src/runtime/proc.go:402 +0x140 fp=0xc00003e788 sp=0xc00003e770 pc=0x63250
runtime.goparkunlock(...)
	/usr/local/go/src/runtime/proc.go:408
runtime.bgsweep(0xc000080000)
	/usr/local/go/src/runtime/mgcsweep.go:278 +0x108 fp=0xc00003e7c8 sp=0xc00003e788 pc=0x44950
runtime.gcenable.gowrap1()
	/usr/local/go/src/runtime/mgc.go:203 +0x64 fp=0xc00003e7d8 sp=0xc00003e7c8 pc=0x33cd4
runtime.goexit({})
	/usr/local/go/src/runtime/asm_mips64x.s:671 +0x4 fp=0xc00003e7d8 sp=0xc00003e7d8 pc=0xab6f4
created by runtime.gcenable in goroutine 1
	/usr/local/go/src/runtime/mgc.go:203 +0xc4

goroutine 18 gp=0xc0000841c0 m=nil [GC scavenge wait]:
runtime.gopark(0x21d800, 0x3423e0, 0xd, 0xa, 0x2)
	/usr/local/go/src/runtime/proc.go:402 +0x140 fp=0xc00003ef80 sp=0xc00003ef68 pc=0x63250
runtime.goparkunlock(...)
	/usr/local/go/src/runtime/proc.go:408
runtime.(*scavengerState).park(0x3423e0)
	/usr/local/go/src/runtime/mgcscavenge.go:425 +0x9c fp=0xc00003efa8 sp=0xc00003ef80 pc=0x414a4
runtime.bgscavenge(0xc000080000)
	/usr/local/go/src/runtime/mgcscavenge.go:653 +0x80 fp=0xc00003efc8 sp=0xc00003efa8 pc=0x41be8
runtime.gcenable.gowrap2()
	/usr/local/go/src/runtime/mgc.go:204 +0x64 fp=0xc00003efd8 sp=0xc00003efc8 pc=0x33c5c
runtime.goexit({})
	/usr/local/go/src/runtime/asm_mips64x.s:671 +0x4 fp=0xc00003efd8 sp=0xc00003efd8 pc=0xab6f4
created by runtime.gcenable in goroutine 1
	/usr/local/go/src/runtime/mgc.go:204 +0x130

goroutine 19 gp=0xc000084380 m=nil [finalizer wait]:
runtime.gopark(0x21d560, 0x39fd20, 0x10, 0xa, 0x1)
	/usr/local/go/src/runtime/proc.go:402 +0x140 fp=0xc000042730 sp=0xc000042718 pc=0x63250
runtime.runfinq()
	/usr/local/go/src/runtime/mfinal.go:194 +0x198 fp=0xc0000427d8 sp=0xc000042730 pc=0x32690
runtime.goexit({})
	/usr/local/go/src/runtime/asm_mips64x.s:671 +0x4 fp=0xc0000427d8 sp=0xc0000427d8 pc=0xab6f4
created by runtime.createfing in goroutine 1
	/usr/local/go/src/runtime/mfinal.go:164 +0xa8
FAIL	godemo	0.059s
FAIL

What did you expect to see?

test success.

ps: go1.21 and go1.23 works fine.

@timandy timandy changed the title cmd/go: cross build mips64/mips64le on ubuntu24 crash cmd/go: cross build mips64/mips64le on ubuntu24 crash(only go1.22) Mar 6, 2025
@gabyhelp gabyhelp added the BugReport Issues describing a possible bug in the Go implementation. label Mar 6, 2025
@JunyangShao
Copy link
Contributor

Does this issue also affect 1.23 and 1.24? You mentioned 1.23 is working but 1.22 is broken. Note that only the two most recent versions of Go are supported. https://go.dev/doc/devel/release#policy. We are closing this issue for now, feel free to reopen it if it appears again in a newer Go. 😊

CC @golang/runtime @golang/compiler for visibility.

@cherrymui
Copy link
Member

Is it reproducible with actual hardware, or at least full system emulation? Userspace emulation tends to be not very reliable, especially for less common platforms like MIPS64. Also, userspace emulation is not a supported platform.

@cherrymui cherrymui added the WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. label Mar 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
BugReport Issues describing a possible bug in the Go implementation. WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.
Projects
None yet
Development

No branches or pull requests

4 participants