-
Notifications
You must be signed in to change notification settings - Fork 18k
runtime: crash in GC #7205
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
Looks like live values are wrong: package main import "reflect" func baz(bx reflect.Value) bool { b := bx.Interface() return b != byte(99) } ../bin/go tool 6g -live -S issue7205.go /usr/local/google/home/khr/go/issue7205.go:5: live at entry to baz: bx b /usr/local/google/home/khr/go/issue7205.go:6: live at call to Value.Interface: bx b /usr/local/google/home/khr/go/issue7205.go:7: live at call to convT2E: bx b /usr/local/google/home/khr/go/issue7205.go:7: live at call to efaceeq: bx Looking at the assembly, there's no zeroing of b before the call to Interface(). |
Simpler repro: package main var i interface{} func foo() func baz() bool { foo() b := i return b != byte(99) } The main bug is that any local or return value live at the start of the function needs to be zeroed. This shouldn't happen, but does in this situation because of... The secondary bug is that the write to b in this situation is not considered a kill of b because an interface{} is a fat value. The "write" actually occurs with two separate instructions and neither is obviously a kill by itself. Not sure how to fix it just yet. Still looking... |
This issue was updated by revision 28479f2. LGTM=iant R=golang-codereviews, iant CC=golang-codereviews https://golang.org/cl/50730044 |
I have a fix for comment #2. I also changed the compiler as we discussed Tuesday, to crash if it finds any local variable or result variable live on entry to the function. That has turned up a handful related problems, not all of which I've been able to fix yet. Owner changed to @rsc. |
This issue was closed by revision 91b1f7c. Status changed to Fixed. |
This issue was closed.
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
The text was updated successfully, but these errors were encountered: