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/internal/ssa: SIGSEGV building 1.16 toolchain2 on openbsd/mips64 #44332

Closed
fuhry opened this issue Feb 17, 2021 · 3 comments
Closed
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.
Milestone

Comments

@fuhry
Copy link

fuhry commented Feb 17, 2021

===>  Building for go-1.16
Building Go cmd/dist using /usr/ports/pobj/go-1.16/go-openbsd-mips64-bootstrap. (go1.16 openbsd/mips64)
Building Go toolchain1 using /usr/ports/pobj/go-1.16/go-openbsd-mips64-bootstrap.
Building Go bootstrap cmd/go (go_bootstrap) using Go toolchain1.
Building Go toolchain2 using go_bootstrap and Go toolchain1.
# cmd/compile/internal/ssa
unexpected fault address 0xc00b209d87
fatal error: fault
[signal SIGSEGV: segmentation violation code=0x2 addr=0xc00b209d87 pc=0x19e78]

goroutine 1 [running]:
runtime.throw(0x610916, 0x5)
        /usr/local/go/src/runtime/panic.go:1117 +0x6c fp=0xc00b206a08 sp=0xc00b2069e0 pc=0x50c34
runtime.sigpanic()
        /usr/local/go/src/runtime/signal_unix.go:741 +0x368 fp=0xc00b206a38 sp=0xc00b206a08 pc=0x6e3d8
runtime.readUnaligned64(...)
        /usr/local/go/src/runtime/alg.go:366
runtime.memhashFallback(0xc00b209d80, 0x91e36743, 0x1f, 0x1)
        /usr/local/go/src/runtime/hash64.go:43 +0x308 fp=0xc00b206a40 sp=0xc00b206a40 pc=0x19e78
runtime.strhashFallback(0xc00b581888, 0x91e36743, 0xc00b5818f0)
        /usr/local/go/src/runtime/alg.go:54 +0x50 fp=0xc00b206a68 sp=0xc00b206a40 pc=0x12858
runtime.evacuate_faststr(0x5abec0, 0xc00006ee10, 0x1e)
        /usr/local/go/src/runtime/map_faststr.go:437 +0x308 fp=0xc00b206b10 sp=0xc00b206a68 pc=0x26d78
runtime.growWork_faststr(0x5abec0, 0xc00006ee10, 0x41e)
        /usr/local/go/src/runtime/map_faststr.go:390 +0x8c fp=0xc00b206b30 sp=0xc00b206b10 pc=0x26a1c
runtime.mapassign_faststr(0x5abec0, 0xc00006ee10, 0xc0108dc7e0, 0x19, 0x98f560)
        /usr/local/go/src/runtime/map_faststr.go:226 +0x434 fp=0xc00b206b90 sp=0xc00b206b30 pc=0x2689c
bootstrap/cmd/internal/obj.(*Link).LookupInit(0xc0003bc000, 0xc0108dc7e0, 0x19, 0xc00b206c08, 0x48f158)
        /usr/ports/pobj/go-1.16/go/src/cmd/internal/obj/sym.go:128 +0x128 fp=0xc00b206bd0 sp=0xc00b206b90 pc=0x13f698
bootstrap/cmd/compile/internal/types.(*Sym).Linksym(0xc0108e4540, 0xc0108e4540)
        /usr/ports/pobj/go-1.16/go/src/cmd/compile/internal/types/sym.go:94 +0xec fp=0xc00b206c18 sp=0xc00b206bd0 pc=0x14aea4
bootstrap/cmd/compile/internal/gc.dtypesym(0xc0108802a0, 0xc0108dbc80)
        /usr/ports/pobj/go-1.16/go/src/cmd/compile/internal/gc/reflect.go:1152 +0x84 fp=0xc00b206dd0 sp=0xc00b206c18 pc=0x48f16c
bootstrap/cmd/compile/internal/gc.dextratype(0xc0107dfa00, 0x38, 0xc0099efb00, 0x0, 0x38)
        /usr/ports/pobj/go-1.16/go/src/cmd/compile/internal/gc/reflect.go:660 +0xe0 fp=0xc00b206e80 sp=0xc00b206dd0 pc=0x48cb60
bootstrap/cmd/compile/internal/gc.dtypesym(0xc0099efb00, 0xc0099efb00)
        /usr/ports/pobj/go-1.16/go/src/cmd/compile/internal/gc/reflect.go:1352 +0x98c fp=0xc00b207038 sp=0xc00b206e80 pc=0x48fa74
bootstrap/cmd/compile/internal/gc.dtypesym(0xc0099efb60, 0xc010730f00)
        /usr/ports/pobj/go-1.16/go/src/cmd/compile/internal/gc/reflect.go:1210 +0x9c0 fp=0xc00b2071f0 sp=0xc00b207038 pc=0x48faa8
bootstrap/cmd/compile/internal/gc.dtypesym(0xc0099ef980, 0xc0099ef980)
        /usr/ports/pobj/go-1.16/go/src/cmd/compile/internal/gc/reflect.go:1359 +0xbe0 fp=0xc00b2073a8 sp=0xc00b2071f0 pc=0x48fcc8
bootstrap/cmd/compile/internal/gc.dtypesym(0xc0099f64e0, 0xc0001707e0)
        /usr/ports/pobj/go-1.16/go/src/cmd/compile/internal/gc/reflect.go:1199 +0xa50 fp=0xc00b207560 sp=0xc00b2073a8 pc=0x48fb38
bootstrap/cmd/compile/internal/gc.dtypesym(0xc0099f6420, 0xc0099f6420)
        /usr/ports/pobj/go-1.16/go/src/cmd/compile/internal/gc/reflect.go:1359 +0xbe0 fp=0xc00b207718 sp=0xc00b207560 pc=0x48fcc8
bootstrap/cmd/compile/internal/gc.dtypesym(0xc0099fb560, 0xc0107c4080)
        /usr/ports/pobj/go-1.16/go/src/cmd/compile/internal/gc/reflect.go:1348 +0x924 fp=0xc00b2078d0 sp=0xc00b207718 pc=0x48fa0c
bootstrap/cmd/compile/internal/gc.dtypesym(0xc010745bc0, 0x10000c000ecbc40)
        /usr/ports/pobj/go-1.16/go/src/cmd/compile/internal/gc/reflect.go:1359 +0xbe0 fp=0xc00b207a88 sp=0xc00b2078d0 pc=0x48fcc8
bootstrap/cmd/compile/internal/gc.compile(0xc00122e160)
        /usr/ports/pobj/go-1.16/go/src/cmd/compile/internal/gc/pgen.go:266 +0x31c fp=0xc00b207b00 sp=0xc00b207a88 pc=0x476824
bootstrap/cmd/compile/internal/gc.funccompile(0xc00122e160)
        /usr/ports/pobj/go-1.16/go/src/cmd/compile/internal/gc/pgen.go:220 +0x114 fp=0xc00b207b50 sp=0xc00b207b00 pc=0x4763bc
bootstrap/cmd/compile/internal/gc.Main(0x63e7e8)
        /usr/ports/pobj/go-1.16/go/src/cmd/compile/internal/gc/main.go:762 +0x2f90 fp=0xc00b207f10 sp=0xc00b207b50 pc=0x4504b0
main.main()
        /usr/ports/pobj/go-1.16/go/src/cmd/compile/main.go:52 +0xc0 fp=0xc00b207f80 sp=0xc00b207f10 pc=0x56ea88
runtime.main()
        /usr/local/go/src/runtime/proc.go:225 +0x30c fp=0xc00b207fd8 sp=0xc00b207f80 pc=0x53be4
runtime.goexit()
        /usr/local/go/src/runtime/asm_mips64x.s:631 +0x4 fp=0xc00b207fd8 sp=0xc00b207fd8 pc=0x904b4
go tool dist: FAILED: /usr/ports/pobj/go-1.16/go/pkg/tool/openbsd_mips64/go_bootstrap install -gcflags=all= -ldflags=all= -i cmd/asm cmd/cgo cmd/compile cmd/link: exit status 2
*** Error 2 in . (Makefile:101 'do-build': @cd /usr/ports/pobj/go-1.16/go/src &&  ulimit -d $(ulimit -H -d) &&  /usr/bin/env -i GO386=387 PO...)
*** Error 2 in . (/usr/ports/infrastructure/mk/bsd.port.mk:2921 '/usr/ports/pobj/go-1.16/build-mips64/.build_done': @cd /usr/ports/lang/go &...)
*** Error 2 in /usr/ports/lang/go (/usr/ports/infrastructure/mk/bsd.port.mk:2584 'build': @lock=go-1.16;  export _LOCKS_HELD=" go-1.16";   /...)

Caveat: this is a seriously underpowered octeon (mips64) machine with only 512MB of RAM and 2 cores.

I cross built a mips64 go1.16 bootstrap toolchain on an amd64 system without issues, and modified the port to use this bootstrap.

cc @4a6f656c (maintainer of openbsd lang/go port)

@randall77
Copy link
Contributor

Can you disassemble the compiler and see what instruction caused that fault? The address it faulted on looks ok.

Are there any issues with unaligned reads on your machine?

@toothrot toothrot added NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. labels Feb 17, 2021
@toothrot toothrot added this to the Backlog milestone Feb 17, 2021
@4a6f656c
Copy link
Contributor

OpenBSD on mips64 is a strict alignment architecture, however that should not be the issue here - runtime.memhashFallback (which has runtime.readUnaligned64 inlined) uses lbu instructions. For what it is worth, I do not see the issue on an Octeon machine here (which runs the openbsd-mips64 builder for https://build.golang.org/). Does it always fail with the same traceback?

@gopherbot
Copy link

Timed out in state WaitingForInfo. Closing.

(I am just a bot, though. Please speak up if this is a mistake or you have the requested information.)

@golang golang locked and limited conversation to collaborators Mar 17, 2022
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. WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.
Projects
None yet
Development

No branches or pull requests

5 participants