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

Serialization of MemberBox with a delegate is broken #429

Closed
szegedi opened this issue Apr 24, 2018 · 0 comments
Closed

Serialization of MemberBox with a delegate is broken #429

szegedi opened this issue Apr 24, 2018 · 0 comments

Comments

@szegedi
Copy link
Contributor

szegedi commented Apr 24, 2018

Serialization of MemberBox with a non-null delegateTo field is broken: the field is declared transient, but never restored upon deserialization. This results in incorrectly deserialized objects.

It can be fixed in two ways:

  1. fail early: throw an exception from writeObject if serialization is attempted with a non-null delegateTo.
  2. make it work: make the field non-transient.

Now, it's only NativeError that uses the delegate mechanism, and is typically setting it to otherwise serializable values. It seems to me that making the field non-transient is harmless. It was originally made transient in d357f56 11 years ago by @norrisboyd; not sure why – possibly due to a mistake?

Note that making it non-transient will change the serialization format of MemberBox, though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant