]> git.ipfire.org Git - thirdparty/zstd.git/commit
[lib] Fix fuzzer timeouts by backing off overflow correction 2627/head
authorNick Terrell <terrelln@fb.com>
Fri, 7 May 2021 04:56:51 +0000 (21:56 -0700)
committerNick Terrell <terrelln@fb.com>
Fri, 7 May 2021 05:03:41 +0000 (22:03 -0700)
commitc2555f8c6f2787add261a082e8fadcc1c0af68ae
tree6ae5f676fa6e29c6cc277c0aaf44e01626ab7b98
parent0d058469526a07febed7026c90f5212f601bb963
[lib] Fix fuzzer timeouts by backing off overflow correction

Linearly back off the frequency of overflow correction based on the
number of times the `ZSTD_window_t` has been overflow corrected. This
will still allow the fuzzer to quickly find overflow correction bugs,
while also keeping good speed for larger inputs.

Additionally, the `nbOverflowCorrections` variable can be useful for
debugging coredumps, since we can inspect the `ZSTD_CCtx` to see if
overflow correction has happened yet.

I've verified this fixes the timeouts in OSS-Fuzz (176 seconds -> 6
seconds). I've also verified that fuzzers and `fuzzer` and `zstreamtest`
still catch the row-hash overflow correction bug.
lib/compress/zstd_compress_internal.h