-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
[fuzz] Superblock fuzz issues #1891
Conversation
Great fix @bimbashrestha ! Could you also add a unit test able to catch this bug please ? |
I can't seem to figure out why the dictionary_round_trip is now failing. Here is the end of the debug trace. Any thoughts?
|
I would check and see what new code is being triggered that causes the problem. Is |
Ah I think I found it. We can't rely on cSize == 0 to discriminate noCompress blocks when we confirm rep codes. Checking explicitly now. |
assert(!ZSTD_isError(ZSTD_compress2(cctx, compressedBuffer, 1339, CNBuffer, 1278))); | ||
ZSTD_freeCCtx(cctx); | ||
} | ||
DISPLAYLEVEL(3, "OK \n"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Checked that this fails before this patch.
lib/compress/zstd_compress.c
Outdated
@@ -2513,7 +2515,7 @@ static size_t ZSTD_compressBlock_targetCBlockSize(ZSTD_CCtx* zc, | |||
} | |||
} | |||
|
|||
if (!ZSTD_isError(cSize) && !usingNoCompressSuperBlock) { | |||
if (!ZSTD_isError(cSize) && compressSuperBlock) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
However, when (!usingNoCompressSuperBlock), there is still a possibility that a compress block was sent. It's just no longer divided into sub-blocks.
I think this was a mistake. Now we should only enter this branch if the block sent is compressed. And this should take care of the rep codes too I believe.
Let's discuss that again tomorrow. |
Good ! This is getting pretty close ! Only a few minor details remaining. |
Looks like there are some new OSS-Fuzz issues with this patch. |
It may help to run the fuzzers locally for ~1 hour once you have the fix, in case there are more bugs. You can follow the instructions in |
It could be a case of this bug blocking oss-fuzz from making progress and now it can find a new one. |
Fixing 2 fuzzer issues