-
Notifications
You must be signed in to change notification settings - Fork 828
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
Buffer underflow while deserializing with Collection type field removed (with reproducible test case) #834
Comments
@BrotherJing: Thank you for the detailed bug report! I'm currently on vacation and won't be able to look into this for a couple of weeks. If you want, you can submit a PR with a fix and I'll merge it. |
@BrotherJing: I was able to reproduce your problem and have debugged it for some time but was unable to come up with a solution. The problem seems to be related to I currently don't have the capacity to spend a lot of time on this issue and would greatly appreciate it if someone could look into this and help with fixing the issue. |
@theigl, we came across a similar issue, is there more documentation and examples on CompatibleFieldSerializer as it is supposed to be the simplest and most compatible. https://github.com/EsotericSoftware/kryo#compatiblefieldserializer wiki also has to be updated to readUnknownFieldData default: true. From what I gathered, if we set readUnknownFieldData:true it handle unknown fields and if reading fails due to class removed? chunkedEncoding:true will gracefully skip. Assuming, most people will use the simplest configuration for CompatibleFieldSerializer to support graceful deserialization with backward/forward compatibility, any idea why this is not a major bug?
|
Apart from the Readme, there is only the JavaDoc for the serializers.
I added the missing default values to the documentation. Your understanding is correct.
What do you mean by "this"? This ticket or that I'm not the original author of the serializers, but I am pretty sure that chunked encoding is disabled by default, because it has a significant performance overhead and users should opt-in if they really need it. |
@BrotherJing: After some more hours of debugging, I managed to get to the bottom of this. Chunked input failed to correctly skip a chunk after a buffer underflow. The underflow is caused by another issue that I cannot fix at this point, but my proposed changes will solve your problem. |
@BrotherJing: Please test your issue against the latest Kryo Snapshots. |
@BrotherJing , any luck with the latest snapshot? @theigl, as a follow up from previous discussion, why would this config throw exception when deserializing bytes with a new registered class added? Shouldn't CompatibleFieldSerializer, chunkedEncoding and warnUnregisteredClasses(true) work gracefully?
|
Describe the bug
Got KryoException: Buffer underflow when I try to deserialize data after remove a field with Collection type from the class.
To Reproduce
First, serialize the original object.
Then, comment field
aaa
, and runGot
FYI, The kryo I use:
Environment:
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: