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

Fix corruption when using HeapBytez #318

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

subes
Copy link
Contributor

@subes subes commented Sep 14, 2021

encountered a corruption issue when using zero copy using HeapCoder which internally uses HeapBytez. The error occurs frequently when using unwrapped Netty-Pooled-Buffers because they use a very long byte[] array and extract slices from it for pooled ByteBuf instances. When giving those to FST we have to be careful to not use the "off" which is likely to be in the thousands to be applied to the source which should have a 0 index (+byteoff) instead. Please also backport to 2.x branch for Java 8 support!

encountered a corruption issue when using zero copy using HeapCoder which internally uses HeapBytez. The error occurs frequently when using unwrapped Netty-Pooled-Buffers because they use a very long byte[] array and extract slices from it for pooled ByteBuf instances. When giving those to FST we have to be careful to not use the "off" which is likely to be in the thousands to be applied to the source which should have a 0 index (+byteoff) instead. Please also backport to 2.x branch for Java 8 support!
@subes
Copy link
Contributor Author

subes commented Sep 14, 2021

Here is also a backport to java 8 for this: https://github.com/subes/fast-serialization/tree/java8backport
I used the commit before the java 14 changes to base this off for a 2.58 (you need to adjust the version number before release). Sadly there was no 2.57 tag so dunno if I got the correct commit for the backport.

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

Successfully merging this pull request may close these issues.

1 participant