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
runtime: fmt.Print non-empty go:notinheap values crashes in runtime.typedmemmove #48399
Comments
|
Change https://golang.org/cl/350153 mentions this issue: |
I've updated that CL, and as part of that update, it doesn't actually fix this issue anymore. It fixes a more subtle issue regarding what kind of pointers are allowed in the data field of an interface. I'm not sure there's anything to fix here. |
This CL fixes the subtle issue that Elem can promote a not-in-heap pointer, which could be any bit pattern, into an unsafe.Pointer, which the garbage collector can see. If that resulting value is bad, it can crash the GC. Make sure that we don't introduce bad pointers that way. We can make Elem() panic, because any such bad pointers are in the Go heap, and not-in-heap pointers are not allowed to point into the Go heap. Update #48399 Change-Id: Ieaf35a611b16b4dfb5e907e229ed4a2aed30e18c Reviewed-on: https://go-review.googlesource.com/c/go/+/350153 Trust: Keith Randall <khr@golang.org> Trust: Ian Lance Taylor <iant@golang.org> Run-TryBot: Keith Randall <khr@golang.org> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
@randall77 Anything else to do here? Based on your last comment, it seems like this should be closed? |
Yes, I'll close. |
See https://play.golang.org/p/N-IOr9IXNa-, found while investigating #42018. Note that printing the empty S1 type works, whereas the non-empty S2 crashes:
This happes with go tip as well.
CC @randall77
The text was updated successfully, but these errors were encountered: