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 snappy crc32c checksum #10048
fix snappy crc32c checksum #10048
Conversation
Can one of the admins verify this patch? |
@andyxning can you add a testcase ? |
@normanmaurer Will do. |
@andyxning please ping me once done. |
0c258c2
to
971fbb9
Compare
@normanmaurer Update is done. PTAL. |
@normanmaurer If this PR will be merged, when will the next release will be cut? |
@netty-bot test this please |
@andyxning can you please fix the checkstyle error ?:
|
971fbb9
to
cfe26de
Compare
@normanmaurer Comments addressed. PTAL again. |
@netty-bot test this please |
@andyxning I just noticed you did not sign our ICLA yet... Can you do and let me know once done ? |
@andyxning there are test failures... not sure if your change is incorrect or if the tests needs to be fixed ? |
cfe26de
to
be77d45
Compare
@normanmaurer CLA is Done. codes are updated. |
@netty-bot test this please |
@andyxning there are still failures |
Test Result (4 failures / ±0) io.netty.handler.codec.compression.SnappyFrameDecoderTest.testInvalidChecksumDoesNotThrowException |
be77d45
to
0f44dce
Compare
@netty-bot test this please |
0f44dce
to
05c4eb8
Compare
@normanmaurer Ut are resolved. PTAL. This is the last time that i will ping you for reviewing this PR, i promise. :-) |
@netty-bot test this please |
@andyxning thanks a lot! |
Motivation: The Snappy crc32c checksum produced by SnappyFrameEncoder maybe failed to be validated on other languages snappy decoder, such as golang/snappy. Modification: - make the 4-byte cast later after the mask operation. Because whether retaining the higher 4-7 bytes in a long java type will make difference in (checksum >> 15 | checksum << 17) + 0xa282ead8 result. Result: Checksum correctly calculated
@normanmaurer When will the next release will be cut and a new jar will be pushed to maven? |
Is this a breaking change? |
@martinfurmanski I dont think so... Why you think it is ? To me it seems like we did not correctly calculate the checksum before. |
@normanmaurer I didn't look at the details, but what I mean is if the prior patch version of netty is talking with this version, are they now calculating differently and can mismatch? |
@martinfurmanski I didn't think about this... yes I think this could happen if the crc value overflows |
Motivation: The Snappy crc32c checksum produced by SnappyFrameEncoder maybe failed to be validated on other languages snappy decoder, such as golang/snappy. Modification: - make the 4-byte cast later after the mask operation. Because whether retaining the higher 4-7 bytes in a long java type will make difference in (checksum >> 15 | checksum << 17) + 0xa282ead8 result. Result: Checksum correctly calculated
Motivation:
Explain here the context, and why you're making that change.
What is the problem you're trying to solve.
Modification: The Snappy crc32c checksum produced by
SnappyFrameEncoder
maybe failed to be validated on other languages snappy decoder, such as golang/snappy.Describe the modifications you've done.
Result:
Fixes #.
If there is no issue then describe the changes introduced by this PR.
This will make the 4-byte cast later after the mask operation. Because whether retaining the higher 4-7 bytes in a long java type will make difference in
(checksum >> 15 | checksum << 17) + 0xa282ead8
result.