Skip to content

[lib] Fix bug in loading LDM dictionary in MT mode#2138

Merged
terrelln merged 2 commits intofacebook:devfrom
terrelln:ldm-fix
May 14, 2020
Merged

[lib] Fix bug in loading LDM dictionary in MT mode#2138
terrelln merged 2 commits intofacebook:devfrom
terrelln:ldm-fix

Conversation

@terrelln
Copy link
Contributor

@terrelln terrelln commented May 14, 2020

Exposed when loading a dictionary < LDM minMatch bytes in MT mode.

Test Plan:
Add a unit test that catches the bug, and run the zstreamtest reproducer.

CC=clang make -j zstreamtest fuzzer MOREFLAGS="-O0 -fsanitize=address"
./zstreamtest -vv -i100000000 -t1 --newapi -s7065 -t3925297
./fuzzer -v -i1

Exposed when loading a dictionary < LDM minMatch bytes in MT mode.

Test Plan:
```
CC=clang make -j zstreamtest MOREFLAGS="-O0 -fsanitize=address"
./zstreamtest -vv -i100000000 -t1 --newapi -s7065 -t3925297
```

TODO: Add an explicit test that loads a small dictionary in MT mode
@Cyan4973
Copy link
Contributor

Thanks @terrelln ! The fix looks good to me.
We should indeed consider adding a relevant test as part of the PR.

@terrelln
Copy link
Contributor Author

We should indeed consider adding a relevant test as part of the PR.

Currently writing it.

@terrelln
Copy link
Contributor Author

Unit test added.

@terrelln terrelln merged commit 9ff4991 into facebook:dev May 14, 2020
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