1
0
mirror of https://github.com/facebook/zstd.git synced 2025-07-29 11:21:22 +03:00

2060 Commits

Author SHA1 Message Date
61d08b0e42 fix test
a margin of 4 is insufficient to guarantee compression success.
2024-10-17 09:37:23 -07:00
730d2dce41 fix test 2024-10-15 18:44:40 -07:00
de6cc98e07 fix incorrect pointer manipulation
fix #4155
2024-10-01 09:25:26 -07:00
1f5df587fa tests/decodecorpus: add more advanced options
- add option to force a specific block type
- add option to force a specific literal tyle
- add option to generate only frame headers
- add option to skip generating magic numbers

Co-authored-by: Maciej Dudek <mdudek@antmicro.com>
Co-authored-by: Pawel Czarnecki <pczarnecki@antmicro.com>
Co-authored-by: Robert Winkler <rwinkler@antmicro.com>
Co-authored-by: Roman Dobrodii <rdobrodii@antmicro.com>
2024-07-26 09:47:16 +02:00
3de0541aef Merge pull request #4079 from elasota/truncated-huff-state-error
Throw error if Huffman weight initial states are truncated
2024-06-30 16:17:03 -07:00
0938308ff6 Throw error if Huffman weight initial states are truncated 2024-06-20 17:46:16 -04:00
2d736d9c50 Fix new typos found by codespell 2024-06-20 20:12:16 +02:00
f19c98228f Fix $filter and Msys/Cygwin
- switched the patter and input of $filter into the right places
- added pattern wildcard to MSYS_NT & CYGWIN_NT as they change with windows versions
- correctly identify MSYS2, even in an env like MINGW64
2024-06-05 18:37:27 +02:00
be6a182006 Unit test for external sequence producer + static CCtx + streaming (#4063) 2024-06-03 12:42:27 -04:00
ff7a151f2e update test name 2024-04-21 10:44:50 -07:00
01cea2e1e2 fixed ISO C incompatibility
for good this time... probably
2024-04-13 02:37:13 +07:00
1d5e9705db fixed memory leaks and almost all undefined behaviour 2024-04-13 02:24:14 +07:00
103a85e6f6 Use md5sum rather than gmd5sum for FreeBSD
Reference:	https://man.freebsd.org/cgi/man.cgi?query=md5sum
2024-03-27 20:53:52 +08:00
81a5e5d438 [fuzz] Turn off -Werror by default
This was causing OSS-Fuzz errors, due to compiler differences.
* Fix the issue
* Also turn off -Werror so we don't fail fuzzer builds for warnings
* Turn on -Werror in our CI
2024-03-26 16:34:36 -07:00
dc1f7b560b fix -Werror=pointer-arith in fuzzers (#3983) 2024-03-21 15:16:38 -04:00
6679d0ca7b Merge pull request #3982 from embg/fuzzer_readme
Document the process for adding a new fuzzer
2024-03-21 11:10:03 -07:00
1d3f664fce Merge pull request #3979 from yoniko/Werror-fuzz
Fail on errors when building fuzzers
2024-03-21 10:41:34 -07:00
731f4b70fc Fix & fuzz ZSTD_generateSequences
This function was seriously flawed:
* It didn't do output bounds checks
* It produced invalid sequences when an uncompressed or RLE block was emitted
* It produced invalid sequences when the block splitter was enabled
* It produced invalid sequences when ZSTD_c_targetCBlockSize was enabled

I've attempted to fix these issues, but this function is just a bad idea,
so I've marked it as deprecated and unsafe. We should replace it with
`ZSTD_extractSequences()` which operates on a compressed frame.
2024-03-21 07:18:05 -07:00
741b87bbe1 Fuzzing and bugfixes for magicless-format decoding (#3976)
* fuzzing and bugfixes for magicless format

* reset dctx before each decompression

* do not memcmp empty buffers

* nit: decompressor errata
2024-03-20 19:22:34 -04:00
f62b2663b9 Add docs on how to add a new fuzzer 2024-03-19 14:05:23 -07:00
3487a60950 Fail on errors when building fuzzers
Fails on errors when building fuzzers with `fuzz.py` (adds `Werror`).
Currently allows `declaration-after-statement`, `c++-compat` and
`deprecated` as they are abundant in code (some fixes to
`declaration-after-statement` are presented in this commit).
2024-03-18 15:51:28 -07:00
6a0052a409 Fix bugs in simple decompression fuzzer (#3978)
Fixes 2 issue in `simple_decompress.c`:
1. Wrong type used for storing the results of `ZSTD_findDecompressedSize` resulting in never matching to `ZSTD_CONTENTSIZE_ERROR` or `ZSTD_CONTENTSIZE_UNKNOWN`.

2. Experimental API is used (`ZSTD_findDecompressedSize`) without defining `ZSTD_STATIC_LINKING_ONLY`.
2024-03-18 15:36:40 -07:00
7d970bd83c Implement one-shot fallback for magicless format (#3971) 2024-03-18 10:55:53 -04:00
2215101cad Add a Few Tests 2024-03-13 16:32:04 -04:00
4bd911ae41 Merge pull request #3954 from facebook/zeroSeq_sample
Add the zeroSeq sample
2024-03-12 15:31:01 -07:00
f65b9e27ce Exercise ZSTD_findDecompressedSize() in the simple decompression fuzzer (#3959)
* Improve decompression fuzzer

* Fix legacy frame header fuzzer crash, add unit test
2024-03-12 17:07:06 -04:00
92fbd42894 Export ZSTD_LEGACY_SUPPORT in tests/Makefile (#3955)
This doesn't affect most of the targets, but will help me sleep better at night knowing that future refactors won't break the legacy support.

Should have been included in https://github.com/facebook/zstd/pull/3943 but I noticed after that merged, so putting up a separate PR.
2024-03-12 14:36:54 -04:00
5a66afa051 Add common file extensions to --exclude-compressed (#3951) 2024-03-12 13:49:06 -04:00
37ff4f91eb removed golden-decompression/.gitignore
replaced by an exclusion rule in tests/.gitignore
2024-03-12 10:47:27 -07:00
0ae98ba215 add same .gitignore rule in golden-decompression/
as requested by @embg
2024-03-12 09:47:54 -07:00
8688c6ed92 Merge pull request #3942 from facebook/fix3719
Fix #3719 : mixing -c, -o and --rm
2024-03-12 09:44:52 -07:00
ca0fc763e3 Merge pull request #3948 from facebook/tests_2927
add tests inspired from #2927
2024-03-12 09:43:59 -07:00
b39c76765b Add the zeroSeq sample
that should have been part of #3674
2024-03-12 09:28:25 -07:00
fe7c645a7e Merge pull request #3937 from facebook/offset0
new method to deal with offset==0 erroneous edge case
2024-03-12 09:25:06 -07:00
e0872806df Use ZSTD_LEGACY_SUPPORT=5 in make test (#3943) 2024-03-12 10:08:26 -04:00
74e856a195 add tests inspired from #2927
centered around -T# and --fast=# arguments
2024-03-11 17:57:57 -07:00
fbd9e628ae added tests 2024-03-11 12:17:34 -07:00
eb5f7a7fa2 produced golden sample for the offset==0 decoder test
is correctly detected as corrupted by new version,
and is accepted (changed into offset==1) by older version.

updated documentation accordingly, with an hexadecimal representation.
2024-03-09 00:33:44 -08:00
2abe8d63e0 fix LLU->ULL
LLU is a correct prefix according to C99 & C11 standards (but not C90).
However, older versions of Visual Studio do not work with it.
Replace by ULL, which doesn't have this issue.

Fixes https://github.com/facebook/zstd/issues/3647
2024-03-04 00:16:01 -08:00
e385c3dd46 Merge pull request #3753 from facebook/make2
minor Makefile refactoring
2024-03-03 19:13:00 -08:00
6719794379 fixed some regressionTests
but not all
2024-02-23 18:48:29 -08:00
3b40100058 fix long sequences (> 64 KB) 2024-02-23 15:35:12 -08:00
6b11fc436c fix issue with incompressible sections 2024-02-23 14:53:56 -08:00
1e240af30a fix datagen size control 2024-02-20 18:06:56 -08:00
83598aa106 datagen generates lorem ipsum by default 2024-02-20 15:24:25 -08:00
695d154cac fuzz: control debuglevel from Makefile
and make the compilation faster
2024-02-08 16:23:52 -08:00
06b5b37b8d Merge pull request #3895 from facebook/fix_3793
Improve compression of Arrays of Integers (High compression mode)
2024-02-05 20:12:24 -08:00
887f5b62ae update compression results for regression tests 2024-02-05 01:27:22 -08:00
641749fc09 fix uasan dictionary_stream_round_trip fuzz test 2024-02-05 00:36:10 -08:00
9ae3bf5ee2 update compression results
good news: there are only improvements
2024-02-03 17:52:50 -08:00