-
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
cmd/go: go1.11.4 toolchain3 build fail with "slice bounds out of range" on 32-bit MIPS on Debian buildd #29402
Comments
Weird. The code does:
Which should not be able to panic. I can't seem to gomote a linux-mips or linux-mipsle machine. Someone with access to such a machine care to verify and do a bisect? |
Hi Randall, Thank you for the suggestion! I have finally sat down and got a "schroot" environment set up on the Debian mipsel and mips development machines and got a "git bisect run" going on both machines:
where ../build-go.sh has this: #!/bin/sh
cd src
./make.bash I will go back check the result in a few hours. :-) Have a Happy Christmas! 🎄 |
Here is the result of
Bisect log:
See:
|
Thanks for the bisect. |
I don't have a MIPS machine on hand, but by visual inspection I think this is mis-compiled. Simple reproducer:
On tip, I got
that is, returning constant false (R0 is the zero register). In MIPS.rules,
This rule is problematic. |
Change https://golang.org/cl/155798 mentions this issue: |
@anthonyfok could you test CL https://go-review.googlesource.com/c/go/+/155798 on a MIPS machine? Thanks! |
@cherrymui You are totally amazing! I think you have nailed the problem!
The tests are still being run. I will report back when all the test results are ready. Thanks again! And wish you a very Happy Christmas season! |
@cherrymui The full build logs are in:
|
@anthonyfok Thank you! |
@gopherbot please consider this for backport to 1.11, otherwise release-branch.go1.11 would fail to build on 32-bit MIPS. Thanks! |
Backport issue(s) opened: #29442 (for 1.11). Remember to create the cherry-pick CL(s) as soon as the patch is submitted to master, according to https://golang.org/wiki/MinorReleases. |
Change https://golang.org/cl/155799 mentions this issue: |
(SGTconst [c] (SRLconst _ [d])) && 0 <= int32(c) && uint32(d) <= 31 && 1<<(32-uint32(d)) <= int32(c) -> (MOVWconst [1]) This rule is problematic. 1<<(32-uint32(d)) <= int32(c) meant to say that it is true if c is greater than the largest possible value of the right shift. But when d==1, 1<<(32-1) is negative and results in the wrong comparison. Rewrite the rules in a more direct way. Updates #29402. Fixes #29442. Change-Id: I5940fc9538d9bc3a4bcae8aa34672867540dc60e Reviewed-on: https://go-review.googlesource.com/c/155798 Run-TryBot: Cherry Zhang <[email protected]> TryBot-Result: Gobot Gobot <[email protected]> Reviewed-by: Keith Randall <[email protected]> (cherry picked from commit 6a64efc) Reviewed-on: https://go-review.googlesource.com/c/155799 Reviewed-by: David Chase <[email protected]>
go1.11.4 fails to build toolchain3 with a "panic: runtime error: slice bounds out of range" on 32-bit MIPS architectures (mips, mipsel (or mipsle)) on Debian buildd. This seems to be a new problem because go1.11.2 and go1.11.3 built fine.
Here is where it failed:
See full build logs here:
Sorry, I haven't had the time to try to study this in depth by logging into Debian's remote 32-bit MIPS machine yet, but thought I should try my luck here first. :-) Many thanks!
The text was updated successfully, but these errors were encountered: