-
Notifications
You must be signed in to change notification settings - Fork 17.9k
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/asm: "compile: loop" compiler bug? #49716
Comments
The function span6 in assembler of golang will exit with "span must be looping" when n > 20. go/src/cmd/internal/obj/x86/asm6.go Line 2177 in e30ebaa
But I find that the fucntion span in inferno-os (which go convert from) will exit with "span must be looping" when n > 50. Maybe we should also modify it to n > 50 in golang? |
cc @cherrymui |
Change https://golang.org/cl/366094 mentions this issue: |
Yeah, 20 is rather too small. We could increase it to, say, 500 or 1000. |
@gopherbot please consider this for backport to 1.17, it's a regression. While upgrading to 1.17 from 1.16, several of our targets fail to build due to this error. We have verified that this fix works for us by patching it. We do not see any other workaround. We would like to throw a voice out there that this solves a real regression for us that was introduced in 1.17 and we'd like to be able to use the latest release again :) cc: @cherrymui Thanks so much for the fix! |
Backport issue(s) opened: #50942 (for 1.17). 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/383214 mentions this issue: |
… assert loop for span6 Updates #49716. Fixes #50942. Change-Id: I7ed73f874c2ee1ee3f31c9c4428ed484167ca803 Reviewed-on: https://go-review.googlesource.com/c/go/+/366094 Reviewed-by: Cherry Mui <cherryyz@google.com> Trust: Heschi Kreinick <heschi@google.com> (cherry picked from commit 14f2b2a) Reviewed-on: https://go-review.googlesource.com/c/go/+/383214 Trust: Cherry Mui <cherryyz@google.com> Run-TryBot: Cherry Mui <cherryyz@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Alex Rakoczy <alex@golang.org>
What version of Go are you using (
go version
)?I have tested all 1.16 and 1.17 versions, the bug does not occur in any 1.16.x version and occurs in every 1.17.x version.
Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
To test a feature I wanted to run my program with the race detector but it would fail with the error "compile: loop" which seems to originate in https://github.com/golang/go/blob/master/src/cmd/internal/obj/x86/asm6.go#L2179
However, the error occurred in a part of the program that was unaffected by the feature I wanted to test. Rather in a slightly modified version of go-syslog (https://pkg.go.dev/gopkg.in/mcuadros/go-syslog.v2). Since I can't share the original code I've build a test case that can reliably reproduce the error:
To make things clear, I'm trying to run the above with the race detector:
Without race detector the program runs fine.
Note: There are a bunch of comments in the code above. Each of those is a change that makes the bug disappear but the careful observer might notice that several of these should have no impact on how the program operates.
What did you expect to see?
The program starting with the race detector.
What did you see instead?
The text was updated successfully, but these errors were encountered: