-
Notifications
You must be signed in to change notification settings - Fork 17.7k
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
runtime: fatal error: AllThreadsSyscall6 results differ between threads; runtime corrupted [mipsle] #56426
Comments
I don't have this hardware but I could try to reproduce it on qemu at least if that'd help and this isn't a known dup? |
This might be related to #51192? (CC @golang/runtime) |
Hmm, https://man7.org/linux/man-pages/man2/syscall.2.html#NOTES seems to indicate that the syscall ABI for MIPS does return two values. 🤔 |
(attn @golang/mips) |
We've previously fixed this for ppc64 (#42178) with https://go.dev/cl/266202 and later https://go.dev/cl/385796. The latter is probably what we want if mips really doesn't use r2. |
Since we have a good idea of what this might be and the fix is straightforward, assigning to @golang/mips to follow up. Feel free to toss it back if you run into issues. |
@cherrymui pointed out that this register may only be used for a few system calls. But if the kernel does not clobber it, it may be best to have Syscall6 zero the register prior to the SYSCALL instruction. |
Change https://go.dev/cl/445695 mentions this issue: |
…message (Fixing the most important part of this bug.) Updates #56426 Change-Id: If657ae47a5fe7dacc31d2c487e53e9f2dd5d03bf Reviewed-on: https://go-review.googlesource.com/c/go/+/445695 TryBot-Result: Gopher Robot <gobot@golang.org> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> Auto-Submit: Brad Fitzpatrick <bradfitz@golang.org> Reviewed-by: Ian Lance Taylor <iant@google.com> Reviewed-by: Michael Pratt <mpratt@google.com>
…message (Fixing the most important part of this bug.) Updates golang#56426 Change-Id: If657ae47a5fe7dacc31d2c487e53e9f2dd5d03bf Reviewed-on: https://go-review.googlesource.com/c/go/+/445695 TryBot-Result: Gopher Robot <gobot@golang.org> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> Auto-Submit: Brad Fitzpatrick <bradfitz@golang.org> Reviewed-by: Ian Lance Taylor <iant@google.com> Reviewed-by: Michael Pratt <mpratt@google.com>
All mips variant perform syscalls similarly. R2 (v0) holds r1 and R3 (v1) holds r2 of a syscall. The latter is only used by 2-ret syscalls. A 1-ret syscall would not touch R3 but keeps it as is, making r2 be a random value. Always reset it to 0 before SYSCALL to fix the issue. Fixes golang#56426
All mips variant perform syscalls similarly. R2 (v0) holds r1 and R3 (v1) holds r2 of a syscall. The latter is only used by 2-ret syscalls. A 1-ret syscall would not touch R3 but keeps it as is, making r2 be a random value. Always reset it to 0 before SYSCALL to fix the issue. Fixes golang#56426
Change https://go.dev/cl/452975 mentions this issue: |
We just got a bug report from a user that
AllThreadsSyscall6
(via a call tosyscall.Setuid
without cgo) crashed.Does AllThreadsSyscall not work on mipsle?
Go 1.19.2
GOARCH=mipsle
(https://openwrt.org/toh/hwdata/gehua/gehua_ghl-r-001)CGO_ENABLED=0
(from tailscale/tailscale#6060)
/cc @hdhoang @maisem @ianlancetaylor @aclements
The text was updated successfully, but these errors were encountered: