Skip to content

Seekable hang fix#2516

Merged
senhuang42 merged 2 commits intofacebook:devfrom
senhuang42:seekable_hang_fix
Mar 3, 2021
Merged

Seekable hang fix#2516
senhuang42 merged 2 commits intofacebook:devfrom
senhuang42:seekable_hang_fix

Conversation

@senhuang42
Copy link

This PR prevents the issue described in #2506 of seekable decompression hanging.

ZSTD_seekable_decompress() may get stuck re-decompressing the input in an infinite loop (see line 451: targetFrame = ZSTD_seekable_offsetToFrameIndex(zs, zs->decompressedOffset);). I'm not aware of any valid reason to decompress more input than actually exists for seekable decompression in a single ZSTD_seekable_decompress() call, so we should check that we aren't reading too much input.

Thanks @mlindsay for discovering issue!

Test Plan:

  • New test passes with PR (and fails without)
  • Manual roundtrip testing with examples in seekable_format/examples
    • We'll want to add a fuzzer and maybe some more unit tests in the future so that we can test changes better.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants