go 1.17.1 in docker (m1) Segmentation Fault

2,109 views
Skip to first unread message

Rémi Philippe

unread,
Sep 15, 2021, 3:05:52 PM9/15/21
to golang-nuts
Hello,
Not sure if anyone has seen this, it seems everything build with go 1.17.1 crashes in docker desktop (4.0.1) on Apple M1 if it's cross launched. The error is
qemu: uncaught target signal 11 (Segmentation fault) - core dumped


for example:
```
package main


import (
"fmt"
"os"
)


func main() {
fmt.Printf("Hello World\n")
os.Exit(0)
}
```

container running native:

root@c3d42421a803:/go/src/t# ./main
Hello World
root@c3d42421a803:/go/src/t# arch
aarch64
root@c3d42421a803:/go/src/t# ps afx
PID TTY STAT TIME COMMAND
8 pts/1 Ss 0:00 /bin/bash
21 pts/1 R+ 0:00 \_ ps afx
1 pts/0 Ss+ 0:00 /bin/bash

container running as amd64 (docker --platform linux/amd64)

root@201bdbdb4d64:/go/src/t# go build main.go
qemu: uncaught target signal 11 (Segmentation fault) - core dumped Segmentation fault
root@201bdbdb4d64:/go/src/t# arch
x86_64
root@201bdbdb4d64:/go/src/t# ps afx
PID TTY STAT TIME COMMAND
1 pts/0 Ssl 0:00 /usr/bin/qemu-x86_64 /bin/bash
1108 ? Rl+ 0:00 /bin/ps afx
root@201bdbdb4d64:/go/src/t#

No problems with 1.16.8. Core dumps don't give anything really useful.

Thanks,
Remi

Andrey T.

unread,
Sep 16, 2021, 2:28:16 PM9/16/21
to golang-nuts
Hi Remi,

You might want to open a bug on https://github.com/golang/go/issues/new and try to check if 1.17 (not 1.17.1) has the same problem - that will reduce the scope of thing to verify for dev team

Andrey

Rémi Philippe

unread,
Sep 17, 2021, 11:10:10 AM9/17/21
to golang-nuts

Hey Andrey,
I tried with 1.17, same issue. I've raised a bug (https://github.com/golang/go/issues/48439) as it seems to impact all go commands (not just build).
It's clearly linked to qemu/docker

Thanks!
Remi

prasanna kelkar

unread,
Jun 9, 2023, 12:25:40 PM6/9/23
to golang-nuts
I don't see a real solution in the issue that was opened. Any other known workarounds to fix this issue?
Reply all
Reply to author
Forward
0 new messages