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/compile: <autogenerated>:1:0: invalid instruction: 00000 (/home/xxx/main.go:8) MOVQ $0, "".n+2147483680(SP) #25507
Comments
CC: @dr2chase @randall77 |
If this works on any recent release, it’d be super helpful if someone wanted to bisect. |
I don't think we ever expect this to work. You're putting a 2GB object on the stack. We limit stacks to 1GB. We could obviously use a better error message. We should detect bad cases like this earlier in compilation, before we try to make a stack frame so big that instructions can't address it. |
If I'm reading correctly it's only 256MiB, and it works in the playground: https://play.golang.org/p/IpWRtSqV26f |
@bcmills your code is running amd64p32 architecture . |
Ah, oops. I had missed that the array was |
I thought we had a check for large stack frames already: |
@josharian Looks like the stack size check is for the frame of the function itself. It does not include the size of the arguments, which would be part of the parent function. So we would fail if there were a call to |
Change https://golang.org/cl/115036 mentions this issue: |
Change https://golang.org/cl/115195 mentions this issue: |
The stack frame includes the callee args section. At the point where we were checking the frame size, that part of the frame had not been computed yet. Move the check later so we can include the callee args size. Fixes #20780 Update #25507 Change-Id: Iab97cb89b3a24f8ca19b9123ef2a111d6850c3fe Reviewed-on: https://go-review.googlesource.com/115195 Run-TryBot: Keith Randall <khr@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
What version of Go are you using (
go version
)?go version go1.10.2 linux/amd64
Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?linux/amd64
What did you do?
go build main.go
What did you see instead?
cat main.go
The text was updated successfully, but these errors were encountered: