-
Notifications
You must be signed in to change notification settings - Fork 17.9k
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,runtime: go tip breaks github.com/ethereum/go-ethereum/rlp #32595
Comments
Found a reproducer. But very oddly, it fails only inside a test. Not in a main function. func TestMy(t *testing.T) {
deref := reflect.ValueOf(new([0]byte)).Elem().Interface()
t.Log(reflect.DeepEqual(deref, [0]byte{}))
} This gives false at tip, but true with 1.12. But running this inside a |
As I see a new([0]byte) there and an interface. Is this a case of pointers to zero sized types may or may not be equal? https://golang.org/ref/spec#Comparison_operators One thing I remember that changed in relation to zero sized allocations in go1.13 was: https://go-review.googlesource.com/c/go/+/155840 |
@martisch the weird thing is that it's only occurs inside a test. |
This is strange. It is a real bug, though. With the stack-allocated defer CL, there are at runtime two The second Somehow a real Next up, try to figure out why we're promoting one of these internal-only types to a real type. Particularly, why this happens with defer structs and not with other similar types (map buckets, map iteration structs, temp bufs for string ops). |
I guess we need to mark the compiler-created type NoAlg? (as map buckets do) So it won't get pulled into typelink. |
Seems like a I think what is going on is that we have a regular Not marking the byte array in the defer struct as noalg is probably the simplest fix, and I will do that for 1.13. (It isn't a big deal, as the alg pointer for |
Change https://golang.org/cl/182357 mentions this issue: |
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
No.
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
What did you expect to see?
Test passed.
What did you see instead?
The test still works with go 1.12.6 and earlier.
I can't produce with minimal example, but cherry pick point to fff4f59
cc @randall77
The text was updated successfully, but these errors were encountered: