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

Fixed error in compressing lz4raw with large offsets #140

Merged
merged 1 commit into from
May 15, 2022
Merged

Conversation

jorgecarleitao
Copy link
Owner

@jorgecarleitao jorgecarleitao commented May 15, 2022

There was a typo in the implementation compared to the rest of the implementations.

The situation is as follows:

  • we have an existing buffer of len L
  • the compression required a maximum of B bytes. We thus need to re-resize the buffer to L + B
  • The compression uses b <= B bytes

We resized the buffer to B bytes (instead of B + L). Thus, when b > B - L, the compression fails. This is more likely to happen when L>>B.

In V1 pages, L == 0 and thus this is not an issue. However, in V2 pages, L != 0 and we have a problem (compression errors)

@jorgecarleitao jorgecarleitao added the bug Something isn't working label May 15, 2022
@codecov-commenter
Copy link

codecov-commenter commented May 15, 2022

Codecov Report

Merging #140 (2053ae1) into main (47edd88) will not change coverage.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##             main     #140   +/-   ##
=======================================
  Coverage   74.35%   74.35%           
=======================================
  Files          78       78           
  Lines        3588     3588           
=======================================
  Hits         2668     2668           
  Misses        920      920           
Impacted Files Coverage Δ
src/compression.rs 84.61% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 47edd88...2053ae1. Read the comment docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants