Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 865143 - >=dev-lang/go-1.18.5 - /usr/lib/go-bootstrap/bin/go build -o cmd/dist/dist ./cmd/dist ./make.bash: line 198: 151723 Segmentation fault
Summary: >=dev-lang/go-1.18.5 - /usr/lib/go-bootstrap/bin/go build -o cmd/dist/dist ./...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: PPC64 Linux
: Normal normal
Assignee: William Hubbs
URL: https://github.com/golang/go/commit/8...
Whiteboard:
Keywords:
Depends on: 871633
Blocks:
  Show dependency tree
 
Reported: 2022-08-14 10:06 UTC by ernsteiswuerfel
Modified: 2022-09-19 05:43 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
build.log (ppc64, 1.18.5) (go-1.18.5:20220814-095508.log,3.64 KB, text/plain)
2022-08-14 10:06 UTC, ernsteiswuerfel
Details
build.log (ppc64, 1.19) (go-1.19:20220814-095710.log,3.62 KB, text/plain)
2022-08-14 10:06 UTC, ernsteiswuerfel
Details
emerge --info (file_865143.txt,6.39 KB, text/plain)
2022-08-14 10:07 UTC, ernsteiswuerfel
Details

Note You need to log in before you can comment on or make changes to this bug.
Description ernsteiswuerfel archtester 2022-08-14 10:06:08 UTC
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
Comment 1 ernsteiswuerfel archtester 2022-08-14 10:06:40 UTC
Created attachment 799581 [details]
build.log (ppc64, 1.19)

Same for 1.19.
Comment 2 ernsteiswuerfel archtester 2022-08-14 10:07:11 UTC
Created attachment 799583 [details]
emerge --info
Comment 3 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-08-16 02:46:39 UTC
https://github.com/golang/go/issues/51787 maybe?
Comment 4 moritori 2022-08-17 08:46:56 UTC
I'm having similar issues and think it is related to https://bugs.gentoo.org/840311#c14.
Comment 5 ernsteiswuerfel archtester 2022-08-17 14:53:42 UTC
(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.
Comment 6 Georgy Yakovlev archtester gentoo-dev 2022-09-18 22:34:37 UTC
confirmed, just hit this on timberdoodle

what's interesting is that ANYTHING compilied by go will segfault, even go-md2man.
Comment 7 Georgy Yakovlev archtester gentoo-dev 2022-09-18 22:36:18 UTC
(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.
Comment 8 Georgy Yakovlev archtester gentoo-dev 2022-09-18 22:40:17 UTC
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))
Comment 9 Georgy Yakovlev archtester gentoo-dev 2022-09-18 23:19:43 UTC
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.
Comment 10 Georgy Yakovlev archtester gentoo-dev 2022-09-18 23:29:09 UTC
confirmed, go still works on 5.15.32 on ppc64be
Comment 11 Georgy Yakovlev archtester gentoo-dev 2022-09-18 23:55:36 UTC
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
Comment 12 Larry the Git Cow gentoo-dev 2022-09-19 02:43:36 UTC
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(-)