-
Notifications
You must be signed in to change notification settings - Fork 18k
encoding/gob: non-deterministic breakage encoding map[string]interface{} #3026
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
Confirmed by running program. This may not be a valid use of interfaces in gobs since you are not registering them, but then again they only hold basic language types. Regardless, gob should do the same thing on each run of the program. While the encoded bytes may depend on iteration order, whether the program works at all should not. Labels changed: added priority-go1, go1-must, removed priority-triage. Owner changed to @robpike. Status changed to Accepted. |
Comment 2 by francis@tikitakistudio.com: I'll just add that I only started experiencing this issue after migrating my AppEngine Go code from the previous stable release (API 3, r60.3) to the new beta SDK (API go1beta, weekly.2012-02-07). |
Encode is correct. Decode is wrong and the true error was missed. type definition { map "" id=65 key id=6 elem id=8 } "foo" interface value, type "map[string]interface {}" id=65; valueLength 20 "bar" interface value, type "string" id=6; valueLength 5 "baz" "test" interface value, type "string" id=6; valueLength 9 "testing" Unable to deserialize data: gob: gob: internal error: inconsistent indirection instr 1 ut 0 I am sending a fix that diagnoses the internal error correctly while I think about the underlying problem. It's inconsistent because of a bug in how caching works for type engines, and the order of creation is affected by the order of the data in the map. I am attaching a pickled version of the bug that is 100% reliable. (you need to enable encoding/gob/debug.go) Attachments:
|
This issue was closed by revision 420f713. 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.
by francis@tikitakistudio.com:
Attachments:
The text was updated successfully, but these errors were encountered: