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: compiler hangs without optimizations #29144
Comments
The file github.com/zonedb/zonedb/zones.go has a fairly large composite literal. I suspect that the compiler isn't hanging as such, it's just taking a lot of memory, perhaps causing your system to thrash. CC @randall77 |
Although actually it doesn't take very long to build that package on my laptop. |
It's the difference between It's the |
Looks like it is spending most of its time (and space) in live variable analysis in the register allocator. |
That's impressive. With Why do we need live variable analysis with |
We could implement a second, simpler register allocator for |
Hi all! The bug also can be reproduced with go version go1.13 linux/amd64 |
Another confirmation. This gets triggered when running go code in intellij on debug mode, if the zonedb package is added to the code, as Intellij adds those gcflags by default. Version: go version go1.13.3 linux/amd64 |
If someone wants to dig into this, it might be useful to know whether there is one key optimization omitted by -N that makes the difference. If so, perhaps (say) there might be a way to do a subset of that optimization even with -N to keep sizes reasonable. |
This reproduces on 1.20.3 on darwin/arm64. Specifically, because of this handy module https://github.com/pioz/faker/ which contains some large literals as well, for example the one in https://github.com/pioz/faker/blob/master/address.go (beware, it kinda hangs Chrome for a bit as well). |
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes, reproduced using go 1.11, 1.11.2 and 1.10
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
Run
go build -gcflags=all="-N -l" -x main.go
ordlv debug main.go
on the following:What did you expect to see?
A successful build.
What did you see instead?
The compiler hangs and consumes large amounts of memory.
The command from the process above shows:
It's also interesting that
go build -gcflags="-N -l" main.go
completes successfully and works usingdlv exec main.exe
but does not with the commands above. I'm not entirely sure if this is a go problem or an issue with the library (or delve) but figured I would start here since an optimized build completes without issue.The text was updated successfully, but these errors were encountered: