Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
cmd/go: go1.11.4 toolchain3 build fail with "slice bounds out of range" on 32-bit MIPS on Debian buildd #29402
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!
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?
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
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).
This rule is problematic.
@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:
(SGTconst [c] (SRLconst _ [d])) && 0 <= int32(c) && uint32(d) <= 31 && 1<<(32-uint32(d)) <= int32(c) -> (MOVWconst ) 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 <firstname.lastname@example.org> TryBot-Result: Gobot Gobot <email@example.com> Reviewed-by: Keith Randall <firstname.lastname@example.org> (cherry picked from commit 6a64efc) Reviewed-on: https://go-review.googlesource.com/c/155799 Reviewed-by: David Chase <email@example.com>