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: value converted to uintptr escapes to heap #28369
Comments
Note that uintptr is treated specially because reasons, but this "obvious" change to escassign in esc.go
produced a build that (1) failed some tests in horrible crashy ways and (2) passed all the escape analysis tests. This was supposed to be easy, and instead it looks interesting. |
One of the places where this wrong-fix causes a difference in allocation behavior is test/gogcrt.go, line 174
Putting this off (unless someone else is interested) till after the freeze. |
Hello @dr2chase @randall77, shall we punt this to Go1.13? If for Go1.13, @dr2chase let's team up and work on this issue during the cycle. |
Definitely punt to 1.13, this is not a crash, and I don't think this is a regression, either. I don't much like the the bit about my change passing escape analysis tests, yet producing a sometimes-crashing build. |
My escape analysis rewrite keep n allocated on the stack. |
@ainar-g A regress test case CL would be great! |
Change https://golang.org/cl/172358 mentions this issue: |
This is my first change to test/, so I'm not entirely sure I've done it correctly. |
Playground: https://play.golang.org/p/AP4_XYd5tFX.
n
here shouldn't escape, since its address is only taken for debugging purposes. The usage ofunsafe.Pointer
is correct, see (2). If I comment out line 9, cmd/compile doesn't moven
to heap, as it should.The text was updated successfully, but these errors were encountered: