Created attachment 799579 [details] build.log (ppc64, 1.18.5) [...] + GOROOT=/usr/lib/go-bootstrap + GOOS= + GOARCH= + GO111MODULE=off + /usr/lib/go-bootstrap/bin/go build -o cmd/dist/dist ./cmd/dist ./make.bash: line 198: 151723 Segmentation fault (core dumped) GOROOT="$GOROOT_BOOTSTRAP" GOOS="" GOARCH="" GO111MODULE=off "$GOROOT_BOOTSTRAP/bin/go" build -o cmd/dist/dist ./cmd/dist * ERROR: dev-lang/go-1.18.5::gentoo failed (compile phase): * build failed
Created attachment 799581 [details] build.log (ppc64, 1.19) Same for 1.19.
Created attachment 799583 [details] emerge --info
https://github.com/golang/go/issues/51787 maybe?
I'm having similar issues and think it is related to https://bugs.gentoo.org/840311#c14.
(In reply to Sam James from comment #3) > https://github.com/golang/go/issues/51787 maybe? I tried the patch (https://github.com/alpinelinux/aports/commit/866f2e147cfbb06eec9179e7323be6d2f82b5290) which is suggested in the issue. It applies but it does not work out. Also tried buildling with GOEXPERIMENT=noregabi emerge -1 go FEATURES="-sandbox -usersandbox“ emerge -1 go or using sandbox-2.25 as suggested in the bug motori pointed to but it didn'T work out either.
confirmed, just hit this on timberdoodle what's interesting is that ANYTHING compilied by go will segfault, even go-md2man.
(gdb) run Starting program: /usr/lib/go-bootstrap/bin/go Program received signal SIGSEGV, Segmentation fault. 0x0000000000043cb8 in runtime.argv_index (argv=0x0, i=1) at /home/william/repos/github.com/golang/go-linux-ppc64-bootstrap/src/runtime/runtime1.go:63 63 /home/william/repos/github.com/golang/go-linux-ppc64-bootstrap/src/runtime/runtime1.go: No such file or directory. (gdb) bt full #0 0x0000000000043cb8 in runtime.argv_index (argv=0x0, i=1) at /home/william/repos/github.com/golang/go-linux-ppc64-bootstrap/src/runtime/runtime1.go:63 No locals. #1 runtime.sysargs (argc=0, argv=0x0) at /home/william/repos/github.com/golang/go-linux-ppc64-bootstrap/src/runtime/os_linux.go:228 n = 1 auxv = <optimized out> fd = <optimized out> buf = <optimized out> #2 0x00000000000590ec in runtime.args (c=<optimized out>, v=<optimized out>) at /home/william/repos/github.com/golang/go-linux-ppc64-bootstrap/src/runtime/runtime1.go:69 No locals. #3 0x000000000007aec4 in runtime.args (c=0, v=0x0) at <autogenerated>:1 No locals. #4 0x0000000000076f40 in runtime.rt0_go () at /home/william/repos/github.com/golang/go-linux-ppc64-bootstrap/src/runtime/asm_ppc64x.s:85 No locals.
after putting source into expected location: Program received signal SIGSEGV, Segmentation fault. 0x0000000000043cb8 in runtime.argv_index (argv=0x0, i=1) at /home/william/repos/github.com/golang/go-linux-ppc64-bootstrap/src/runtime/runtime1.go:63 63 return *(**byte)(add(unsafe.Pointer(argv), uintptr(i)*goarch.PtrSize))
I suspect kernel is to blame and I think it's the pwnkit argv fix that triggered it. timberdoodle was running 5.15.32-gentoo-dist-hardened until recent update and go/docker was fine I've updated to 5.15.63-gentoo-dist-hardene and started noticing segfaults. pwnkit fix landed to 5.15.y here https://github.com/gregkh/linux/commit/1290eb4412aa0f0e9f3434b406dc8e255da85f9e and was released as 5.15.33 https://cdn.kernel.org/pub/linux/kernel/v5.x/ChangeLog-5.15.33 I still have old kernel around, so it's easy to test by booting to it.
confirmed, go still works on 5.15.32 on ppc64be
found upstream fix https://github.com/golang/go/commit/823e5d8afaaf9fff0cc2ab04e7fc0a62b1023c3e go1.19.1 is fine and contains the fix. so we'll need a new cut of go-bootstrap and get rid of 1.16.6
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=cf7fb9cdd4b89f94c978566eb2da669c24acbe25 commit cf7fb9cdd4b89f94c978566eb2da669c24acbe25 Author: Georgy Yakovlev <gyakovlev@gentoo.org> AuthorDate: 2022-09-19 02:39:57 +0000 Commit: Georgy Yakovlev <gyakovlev@gentoo.org> CommitDate: 2022-09-19 02:42:12 +0000 dev-lang/go-bootstrap: unkeyword known broken versions on ppc64 go-bootstrap-1.18.6 can be used instead, it works. Closes: https://bugs.gentoo.org/865143 Signed-off-by: Georgy Yakovlev <gyakovlev@gentoo.org> dev-lang/go-bootstrap/go-bootstrap-1.16.6.ebuild | 4 ++-- dev-lang/go-bootstrap/go-bootstrap-1.19.ebuild | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) Additionally, it has been referenced in the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ae84039bf03f535f7285475093a41182f176cd6a commit ae84039bf03f535f7285475093a41182f176cd6a Author: Georgy Yakovlev <gyakovlev@gentoo.org> AuthorDate: 2022-09-19 02:34:30 +0000 Commit: Georgy Yakovlev <gyakovlev@gentoo.org> CommitDate: 2022-09-19 02:34:30 +0000 dev-lang/go-bootstrap: stabilize 1.18.6 for ppc64 Bug: https://bugs.gentoo.org/865143 Signed-off-by: Georgy Yakovlev <gyakovlev@gentoo.org> dev-lang/go-bootstrap/go-bootstrap-1.18.6.ebuild | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)