-
Notifications
You must be signed in to change notification settings - Fork 18k
cmd/compile: wrong liveness map #18860
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
Labels
Milestone
Comments
CL https://golang.org/cl/36030 mentions this issue. |
CL https://golang.org/cl/23924 mentions this issue. |
CL https://golang.org/cl/38133 mentions this issue. |
gopherbot
pushed a commit
that referenced
this issue
Mar 13, 2017
Move the zeroing of results earlier. In particular, they need to come before any move-to-heap operations, as those require allocation. Those allocations are points at which the GC can see the uninitialized result slots. For the function: func f() (x, y, z *int) { defer(){}() escape(&y) return } We used to generate code like this: x = nil y = nil &y = new(int) z = nil Now we will generate: x = nil y = nil z = nil &y = new(int) Since the fix for #18860, the return slots are always live if there is a defer, so the former ordering allowed the GC to see junk in the z slot. Fixes #19078 Change-Id: I71554ae437549725bb79e13b2c100b2911d47ed4 Reviewed-on: https://go-review.googlesource.com/38133 Run-TryBot: Keith Randall <[email protected]> TryBot-Result: Gobot Gobot <[email protected]> Reviewed-by: Matthew Dempsky <[email protected]>
gopherbot
pushed a commit
that referenced
this issue
Apr 21, 2017
The experiment "clobberdead" clobbers all pointer fields that the compiler thinks are dead, just before and after every safepoint. Useful for debugging the generation of live pointer bitmaps. Helped find the following issues: Update #15936 Update #16026 Update #16095 Update #18860 Change-Id: Id1d12f86845e3d93bae903d968b1eac61fc461f9 Reviewed-on: https://go-review.googlesource.com/23924 Run-TryBot: Keith Randall <[email protected]> Reviewed-by: Matthew Dempsky <[email protected]> Reviewed-by: Cherry Zhang <[email protected]>
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
At the call to
g
,r
should be marked as live. It isn't.Any defer makes all of the output args live at any (possibly panicing) call.
Found using the dead-slot clobberer, https://go-review.googlesource.com/c/23924/
Seems to be around for a while, at least 1.6.
I'm not sure why the dead-slot clobberer didn't find this before.
(Note to self: original detection from
encoding/gob/encoder_test.go:encodeAndRecover
.)The text was updated successfully, but these errors were encountered: