Skip to content
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

encoding/gob: error decoding a slice of pointers to recursive type #47542

Open
dragos-scio opened this issue Aug 5, 2021 · 2 comments
Open
Labels
NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone

Comments

@dragos-scio
Copy link

What version of Go are you using (go version)?

$ go version
go version go1.15.14 darwin/amd64

Does this issue reproduce with the latest release?

Yes

What operating system and processor architecture are you using (go env)?

go env Output
It reproduces in playground too

What did you do?

https://play.golang.org/p/Tjcurb98oUg

What did you expect to see?

Serialize / deserialize correctly.

What did you see instead?

If the first value passed is a list of pointers, it doesn't deserialize

@dragos-scio
Copy link
Author

@shivaal-scio noticed this related bug, and how to encode / decode a non pointer version to avoid the issue
#2995 (comment)

@seankhliao seankhliao changed the title gob: wrong type (map[string][]*main.Result) for received field .Children encoding/gob: error decoding a recursive type Aug 7, 2021
@seankhliao seankhliao changed the title encoding/gob: error decoding a recursive type encoding/gob: error decoding a slice of pointers to recursive type Aug 7, 2021
@seankhliao
Copy link
Member

cc @robpike

seems to be some initialization that works for the non pointer version
slightly shorter repro

@seankhliao seankhliao added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Aug 7, 2021
@seankhliao seankhliao added this to the Unplanned milestone Aug 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
None yet
Development

No branches or pull requests

2 participants