]> git.ipfire.org Git - thirdparty/zstd.git/log
thirdparty/zstd.git
3 years agoNits 3127/head
Elliot Gorokhovsky [Thu, 12 May 2022 16:53:15 +0000 (12:53 -0400)] 
Nits

3 years agoNits
Elliot Gorokhovsky [Mon, 9 May 2022 22:26:10 +0000 (18:26 -0400)] 
Nits

3 years agoCorrect and clarify repcode offset history logic
Elliot Gorokhovsky [Mon, 9 May 2022 21:17:11 +0000 (17:17 -0400)] 
Correct and clarify repcode offset history logic

3 years agoMerge pull request #3126 from embg/fix_freebsd_ci
Elliot Gorokhovsky [Mon, 9 May 2022 23:48:13 +0000 (19:48 -0400)] 
Merge pull request #3126 from embg/fix_freebsd_ci

Unbreak FreeBSD CI

3 years agoUnbreak FreeBSD CI 3126/head
Elliot Gorokhovsky [Mon, 9 May 2022 22:28:03 +0000 (18:28 -0400)] 
Unbreak FreeBSD CI

3 years agoMerge pull request #3114 from embg/fast_extdict_pipeline2
Elliot Gorokhovsky [Thu, 5 May 2022 19:06:47 +0000 (15:06 -0400)] 
Merge pull request #3114 from embg/fast_extdict_pipeline2

Software pipeline for ZSTD_compressBlock_fast_extDict

3 years agoUpdate results.csv 3114/head
Elliot Gorokhovsky [Wed, 4 May 2022 20:05:37 +0000 (16:05 -0400)] 
Update results.csv

3 years agoMerge pull request #3122 from eli-schwartz/betterlinkage
Yann Collet [Mon, 2 May 2022 17:56:37 +0000 (10:56 -0700)] 
Merge pull request #3122 from eli-schwartz/betterlinkage

meson: for internal linkage, link to both libzstd and a static copy of it

3 years agomeson: for internal linkage, link to both libzstd and a static copy of it 3122/head
Eli Schwartz [Thu, 28 Apr 2022 22:22:55 +0000 (18:22 -0400)] 
meson: for internal linkage, link to both libzstd and a static copy of it

Partial, Meson-only implementation of #2976 for non-MSVC builds.

Due to the prevalence of private symbol reuse, linking to a shared
library is simply utterly unreliable, but we still want to defer to the
shared library for installable applications. By linking to both, we can
share symbols where possible, and statically link where needed.

This means we no longer need to manually track every file that needs to
be extracted and reused.

The flip side is that MSVC completely does not support this, so for MSVC
builds we just link to a full static copy even where
-Ddefault_library=shared.

As a side benefit, by using library inclusion rather than including
extra explicit object files, the zstd program shrinks in size slightly
(~4kb).

3 years agomeson: avoid rebuilding some libzstd sources in the programs
Eli Schwartz [Tue, 10 Aug 2021 02:53:15 +0000 (22:53 -0400)] 
meson: avoid rebuilding some libzstd sources in the programs

These need to be explicitly included as we use their private symbols,
but we don't need to recompile them when we can reuse the existing
objects.

Minus 7 compile steps.

3 years agomeson: avoid rebuilding some libzstd files in the test programs
Eli Schwartz [Tue, 10 Aug 2021 03:19:52 +0000 (23:19 -0400)] 
meson: avoid rebuilding some libzstd files in the test programs

The poolTests program already linked to libzstd, and later to
libtestcommon with included libzstd objects. So this was redundant.

Minus 4 compile steps.

3 years agoRemove hasStep variant (not enough wins to justify the code size increase)
Elliot Gorokhovsky [Thu, 28 Apr 2022 22:05:39 +0000 (18:05 -0400)] 
Remove hasStep variant (not enough wins to justify the code size increase)

3 years agoFinal nit
Elliot Gorokhovsky [Thu, 28 Apr 2022 18:49:45 +0000 (14:49 -0400)] 
Final nit

3 years agoRevert "Hardcode repcode safety check, fix cosmetic nits"
Elliot Gorokhovsky [Wed, 27 Apr 2022 22:16:21 +0000 (18:16 -0400)] 
Revert "Hardcode repcode safety check, fix cosmetic nits"

This reverts commit 518cb83833074d304dfcaa93cfc16039ea4683c8.

3 years agoHardcode repcode safety check, fix cosmetic nits
Elliot Gorokhovsky [Tue, 26 Apr 2022 21:54:25 +0000 (17:54 -0400)] 
Hardcode repcode safety check, fix cosmetic nits

3 years agoMerge pull request #3117 from cuishuang/dev
Yann Collet [Tue, 26 Apr 2022 17:02:04 +0000 (10:02 -0700)] 
Merge pull request #3117 from cuishuang/dev

fix some typos

3 years agofix some typos 3117/head
cuishuang [Tue, 26 Apr 2022 09:40:23 +0000 (17:40 +0800)] 
fix some typos

Signed-off-by: cuishuang <imcusg@gmail.com>
3 years agoOptimize repcode predicate, hardcode hasStep == 0 scenario, cosmetic fixes
Elliot Gorokhovsky [Wed, 20 Apr 2022 15:50:00 +0000 (11:50 -0400)] 
Optimize repcode predicate, hardcode hasStep == 0 scenario, cosmetic fixes

3 years agoMerge pull request #3039 from eli-schwartz/meson
Yann Collet [Tue, 19 Apr 2022 22:51:19 +0000 (15:51 -0700)] 
Merge pull request #3039 from eli-schwartz/meson

Meson fixups for Windows

3 years agoMerge pull request #3112 from facebook/man2
Yann Collet [Tue, 19 Apr 2022 22:36:47 +0000 (15:36 -0700)] 
Merge pull request #3112 from facebook/man2

updated man page, providing more details for --train mode

3 years agoNits
Elliot Gorokhovsky [Tue, 19 Apr 2022 15:36:06 +0000 (11:36 -0400)] 
Nits

3 years agoPort noDict pipeline
Elliot Gorokhovsky [Thu, 14 Apr 2022 18:19:19 +0000 (14:19 -0400)] 
Port noDict pipeline

3 years agoupdated man pages 3112/head
Yann Collet [Thu, 14 Apr 2022 01:57:27 +0000 (18:57 -0700)] 
updated man pages

had to run the conversion script on Ubuntu, as it doesn't run correctly on macos anymore.

3 years agoupdated man page, providing more details for --train mode
Yann Collet [Thu, 14 Apr 2022 01:51:59 +0000 (18:51 -0700)] 
updated man page, providing more details for --train mode

following questions from #3111.

Note : only the source markdown has been updated,
the actual man page zstd.1 still need to be processed.

3 years agoMerge pull request #3094 from dirkmueller/usage_cleanup
Yann Collet [Tue, 5 Apr 2022 14:09:54 +0000 (07:09 -0700)] 
Merge pull request #3094 from dirkmueller/usage_cleanup

Split help in long and short version, cleanup formatting

3 years agoMerge pull request #3108 from paulmenzel/fix-typo-in-zstd.1
Yann Collet [Mon, 4 Apr 2022 06:12:06 +0000 (23:12 -0700)] 
Merge pull request #3108 from paulmenzel/fix-typo-in-zstd.1

Remove superfluous *not* in description of `--long[=#]` in zstd(1)

3 years agozstd.1: Remove superfluous *not* in description of `--long[=#]` 3108/head
Paul Menzel [Sun, 3 Apr 2022 05:26:49 +0000 (07:26 +0200)] 
zstd.1: Remove superfluous *not* in description of `--long[=#]`

Resolves: https://github.com/facebook/zstd/issues/3101

3 years agoDisable visual-2015 tests (#3106)
Elliot Gorokhovsky [Thu, 31 Mar 2022 16:26:20 +0000 (12:26 -0400)] 
Disable visual-2015 tests (#3106)

3 years agoMerge pull request #3103 from facebook/fix45586
Yann Collet [Wed, 30 Mar 2022 17:08:57 +0000 (10:08 -0700)] 
Merge pull request #3103 from facebook/fix45586

fix minor bug in sequence_compression_api tester

3 years agofix minor bug in sequence_compression_api tester 3103/head
Yann Collet [Tue, 29 Mar 2022 23:45:09 +0000 (16:45 -0700)] 
fix minor bug in sequence_compression_api tester

margin was merely slightly too short for extra splitting.

3 years agoSplit help in long and short version, cleanup formatting 3094/head
Dirk Müller [Thu, 10 Mar 2022 00:34:12 +0000 (01:34 +0100)] 
Split help in long and short version, cleanup formatting

Adopt the more standard Usage: formatting style
List short and long options alongside where available
Print lists as a table
Use command style description

3 years agoMerge pull request #3052 from dirkmueller/gzip_keep
Nick Terrell [Mon, 28 Mar 2022 17:35:21 +0000 (10:35 -0700)] 
Merge pull request #3052 from dirkmueller/gzip_keep

Keep original file if -c or --stdout is given

3 years agoSoftware pipeline for ZSTD_compressBlock_fast_dictMatchState (#3086)
Elliot Gorokhovsky [Thu, 17 Mar 2022 16:35:11 +0000 (09:35 -0700)] 
Software pipeline for ZSTD_compressBlock_fast_dictMatchState (#3086)

* prefetch dict content inside loop

* ip0/ip1 pipeline

* add L2_4 prefetch to dms pipeline

* Remove L1 prefetch

* Remove L2 prefetching

* Reduce # of gotos

* Cosmetic fixes

* Check final position sometimes

* Track step size as in bc768bc

* Fix nits

3 years agoMerge pull request #3095 from dpelle/typo-and-grammar-fixes
Nick Terrell [Mon, 14 Mar 2022 16:17:21 +0000 (09:17 -0700)] 
Merge pull request #3095 from dpelle/typo-and-grammar-fixes

Typo and grammar fixes

3 years agoOn more mistake (Node -> Note) 3095/head
Dominique Pelle [Sat, 12 Mar 2022 23:08:55 +0000 (00:08 +0100)] 
On more mistake (Node -> Note)

3 years agoTypo and grammar fixes
Dominique Pelle [Sat, 12 Mar 2022 07:52:40 +0000 (08:52 +0100)] 
Typo and grammar fixes

3 years agoMerge pull request #3088 from cyberknight777/dev
Nick Terrell [Fri, 11 Mar 2022 18:01:11 +0000 (10:01 -0800)] 
Merge pull request #3088 from cyberknight777/dev

[contrib][linux] Fix a warning in zstd_reset_cstream()

3 years agoMerge pull request #3093 from dirkmueller/cli_tests_fixup
Nick Terrell [Thu, 10 Mar 2022 18:41:52 +0000 (10:41 -0800)] 
Merge pull request #3093 from dirkmueller/cli_tests_fixup

Handle newer less versions in zstdless testing

3 years agoHandle newer less versions in zstdless testing 3093/head
Dirk Müller [Wed, 9 Mar 2022 23:25:05 +0000 (00:25 +0100)] 
Handle newer less versions in zstdless testing

Newer less versions appear to have changed how stderr
and stdout are showing error messages. hardcode the
expected behavior to make the tests pass with any less version.

Also set locale to C so that the strings are matching.

3 years ago[contrib][linux] Make zstd_reset_cstream() functionally identical to ZSTD_resetCStream() 3088/head
Cyber Knight [Thu, 10 Mar 2022 07:32:13 +0000 (15:32 +0800)] 
[contrib][linux] Make zstd_reset_cstream() functionally identical to ZSTD_resetCStream()

- As referenced by Nick Terrelln ~ the ZSTD maintainer in the linux kernel, making zstd_reset_cstream() functionally identical to ZSTD_resetCStream() would be the perfect way to fix the warning without touching any core functions or breaking other parts of the code.

Suggested-by: Nick Terrell <terrelln@fb.com>
Signed-off-by: Cyber Knight <cyberknight755@gmail.com>
3 years agoMerge pull request #3092 from terrelln/2022-03-09-decoder-errata-doc
Nick Terrell [Wed, 9 Mar 2022 23:10:29 +0000 (15:10 -0800)] 
Merge pull request #3092 from terrelln/2022-03-09-decoder-errata-doc

[doc] Add decompressor errata document

3 years ago[doc] Add decompressor errata document 3092/head
Nick Terrell [Wed, 9 Mar 2022 22:39:13 +0000 (14:39 -0800)] 
[doc] Add decompressor errata document

Add a document that lists the known bugs in the decoder where valid
frames are rejected, along with the version that they were fixed.

3 years agoKeep original file if -c or --stdout is given 3052/head
Dirk Müller [Mon, 7 Feb 2022 19:39:15 +0000 (20:39 +0100)] 
Keep original file if -c or --stdout is given

Set removeSrcFile back to false when -c or --stdout is used to improve
compatibility with gzip(1) behavior.

gzip(1) is removing the original file on compression unless --stdout or
/-c is used. zstd is defaulting to keep the file unless --rm is used or
when it is called via a gzip symlink, in which it is removing by
default. Specifying -c/--stdout turns this behavior off.

3 years agoMerge pull request #3059 from dirkmueller/gzip_fast_best
Felix Handte [Tue, 8 Mar 2022 20:32:06 +0000 (15:32 -0500)] 
Merge pull request #3059 from dirkmueller/gzip_fast_best

Implement more gzip compatibility (#3037)

3 years agoMerge pull request #3079 from niamster/cmake-compat-5
Yann Collet [Tue, 8 Mar 2022 08:21:23 +0000 (00:21 -0800)] 
Merge pull request #3079 from niamster/cmake-compat-5

build:cmake: enable ZSTD legacy support by default

3 years ago[contrib][linux] Use ZSTD_CCtx_setPledgedSrcSize() instead of ZSTD_CCtx_reset()
Cyber Knight [Tue, 8 Mar 2022 05:38:06 +0000 (13:38 +0800)] 
[contrib][linux] Use ZSTD_CCtx_setPledgedSrcSize() instead of ZSTD_CCtx_reset()

- The previous patch throws the following warning:

 ../linux/lib/zstd/zstd_compress_module.c: In function ‘zstd_reset_cstream’:
../linux/lib/zstd/zstd_compress_module.c:136:34: error: enum conversion when passing argument 2 of ‘ZSTD_CCtx_reset’ is invalid in C++ [-Werror=c++-compat]
  136 |  return ZSTD_CCtx_reset(cstream, pledged_src_size);
      |                                  ^~~~~~~~~~~~~~~~
In file included from ../linux/include/linux/zstd.h:26,
                 from ../linux/lib/zstd/zstd_compress_module.c:15:
../linux/include/linux/zstd_lib.h:501:20: note: expected ‘ZSTD_ResetDirective’ {aka ‘enum <anonymous>’} but argument is of type ‘long long unsigned int’
  501 | ZSTDLIB_API size_t ZSTD_CCtx_reset(ZSTD_CCtx* cctx, ZSTD_ResetDirective reset);
      |                    ^~~~~~~~~~~~~~~
cc1: all warnings being treated as errors

Since we have a choice to either use ZSTD_CCtx_reset or ZSTD_CCtx_setPledgedSrcSize instead of ZSTD_resetCStream, let's switch to ZSTD_CCtx_setPledgedSrcSize to not have any unnecessary warns alongside the kernel build and CI test build.

Signed-off-by: Cyber Knight <cyberknight755@gmail.com>
3 years ago[contrib][linux] Fix a warning in zstd_reset_cstream()
Cyber Knight [Mon, 7 Mar 2022 03:55:33 +0000 (11:55 +0800)] 
[contrib][linux] Fix a warning in zstd_reset_cstream()

- This fixes the below warning:

../lib/zstd/zstd_compress_module.c: In function 'zstd_reset_cstream':
../lib/zstd/zstd_compress_module.c:136:9: warning: 'ZSTD_resetCStream' is deprecated [-Wdeprecated-declarations]
  136 |         return ZSTD_resetCStream(cstream, pledged_src_size);
      |         ^~~~~~
In file included from ../include/linux/zstd.h:26,
                 from ../lib/zstd/zstd_compress_module.c:15:
../include/linux/zstd_lib.h:2277:8: note: declared here
 2277 | size_t ZSTD_resetCStream(ZSTD_CStream* zcs, unsigned long long pledgedSrcSize);
      |        ^~~~~~~~~~~~~~~~~

ZSTD_resetCstream is deprecated and zstd_CCtx_reset is suggested to use hence let's switch to it.

Signed-off-by: Cyber Knight <cyberknight755@gmail.com>
3 years agoMerge pull request #3060 from rex4539/typos
Yann Collet [Sat, 5 Mar 2022 22:21:58 +0000 (14:21 -0800)] 
Merge pull request #3060 from rex4539/typos

Fix typos

3 years agoFix typos 3060/head
Dimitris Apostolou [Wed, 9 Feb 2022 06:58:23 +0000 (08:58 +0200)] 
Fix typos

3 years agofix the assertion in readLinesFromFile (#3084)
Xi Ruoyao [Fri, 4 Mar 2022 19:56:44 +0000 (03:56 +0800)] 
fix the assertion in readLinesFromFile (#3084)

* fix the assertion in readLinesFromFile

When the file is not terminated by endline, readLineFromFile will append
a '\0' for the last line.  In this case pos + lineLength == dstCapacity.

* test: don't print very long text garbage

3 years agoMerge pull request #3080 from TocarIP/tokarip/static_bmi2
Yann Collet [Thu, 3 Mar 2022 20:49:40 +0000 (12:49 -0800)] 
Merge pull request #3080 from TocarIP/tokarip/static_bmi2

Enable STATIC_BMI2 for gcc/clang

3 years agoEnable STATIC_BMI2 for gcc/clang 3080/head
Ilya Tokar [Tue, 1 Mar 2022 23:49:10 +0000 (18:49 -0500)] 
Enable STATIC_BMI2 for gcc/clang

Some usage (e.g. BIT_getLowerBit) uses it without checking for MSVC,
so enabling for clang gives a small performance boost.

3 years agoFix CI failures by adding apt-get update to Github Actions (#3082)
Elliot Gorokhovsky [Thu, 3 Mar 2022 19:52:06 +0000 (14:52 -0500)] 
Fix CI failures by adding apt-get update to Github Actions (#3082)

* Fix CI failures by adding apt-get update to Makefile

* Fix travis failure caused by apt-get update

* Move apt-get update from Makefile to Github Actions .yml

* Revert .travis.yml change

* Fix typo

3 years agoMerge pull request #3081 from terrelln/dict-load-zero
Nick Terrell [Wed, 2 Mar 2022 20:58:51 +0000 (12:58 -0800)] 
Merge pull request #3081 from terrelln/dict-load-zero

[programs] Fix infinite loop when empty input is passed to trainer

3 years ago[programs] Fix infinite loop when empty input is passed to trainer 3081/head
Nick Terrell [Wed, 2 Mar 2022 19:04:04 +0000 (11:04 -0800)] 
[programs] Fix infinite loop when empty input is passed to trainer

When an empty input file was passed to the dictionary trainer, it would infinite loop.
The added test case exposes the bug, and is fixed with this PR.

3 years agobuild:cmake: enable ZSTD legacy support by default 3079/head
Dmytro Milinevskyi [Tue, 1 Mar 2022 17:29:47 +0000 (18:29 +0100)] 
build:cmake: enable ZSTD legacy support by default

3 years agoMerge pull request #3075 from TocarIP/tokarip/bzhi
Elliot Gorokhovsky [Thu, 24 Feb 2022 21:52:48 +0000 (16:52 -0500)] 
Merge pull request #3075 from TocarIP/tokarip/bzhi

Use helper function for bit manipulations.

3 years agoUse helper function for bit manipulations. 3075/head
Ilya Tokar [Wed, 23 Feb 2022 22:59:56 +0000 (17:59 -0500)] 
Use helper function for bit manipulations.

We already have BIT_getLowerBits, so use it. Benefits are 2fold:
1) Somewhat cleaner code
2) We are now using bzhi instructions, when available. Performance
delta is too small for microbenchmarks, but avoiding load still helps
larger applications, by reducing data cache pressure.

3 years agoMerge pull request #3045 from embg/asm_refactor
Elliot Gorokhovsky [Thu, 17 Feb 2022 18:08:08 +0000 (13:08 -0500)] 
Merge pull request #3045 from embg/asm_refactor

Refactor bitwise intrinsics

3 years agoReplace XOR with subtraction for readability 3045/head
Elliot Gorokhovsky [Wed, 16 Feb 2022 21:49:42 +0000 (16:49 -0500)] 
Replace XOR with subtraction for readability

3 years agoFix fuzzer.c nits and replace CLZ fallback
Elliot Gorokhovsky [Wed, 16 Feb 2022 16:16:55 +0000 (11:16 -0500)] 
Fix fuzzer.c nits and replace CLZ fallback

3 years agoAdd back check to prevent Win32 static analysis issues
Elliot Gorokhovsky [Tue, 15 Feb 2022 16:41:09 +0000 (11:41 -0500)] 
Add back check to prevent Win32 static analysis issues

3 years agoAdd tests for bitwise intrinsics
Elliot Gorokhovsky [Mon, 14 Feb 2022 22:15:30 +0000 (17:15 -0500)] 
Add tests for bitwise intrinsics

3 years agobits.h refactor and bugfix
Elliot Gorokhovsky [Mon, 14 Feb 2022 21:08:00 +0000 (16:08 -0500)] 
bits.h refactor and bugfix

3 years agoFix nits
Elliot Gorokhovsky [Mon, 7 Feb 2022 17:22:04 +0000 (12:22 -0500)] 
Fix nits

3 years agoPull out software fallbacks
Elliot Gorokhovsky [Mon, 31 Jan 2022 19:59:51 +0000 (14:59 -0500)] 
Pull out software fallbacks

3 years agoMove bitwise builtins into bits.h
Elliot Gorokhovsky [Fri, 21 Jan 2022 18:29:14 +0000 (11:29 -0700)] 
Move bitwise builtins into bits.h

3 years agoMerge pull request #3063 from embg/largeNbDicts
Elliot Gorokhovsky [Fri, 11 Feb 2022 18:55:35 +0000 (13:55 -0500)] 
Merge pull request #3063 from embg/largeNbDicts

Bugfix and new features for largeNbDicts benchmark

3 years agoBugfix and new features for largeNbDicts benchmark 3063/head
Elliot Gorokhovsky [Tue, 8 Feb 2022 16:49:31 +0000 (11:49 -0500)] 
Bugfix and new features for largeNbDicts benchmark

3 years agoMerge pull request #3054 from ooosssososos/patch-1
Yann Collet [Fri, 11 Feb 2022 16:13:09 +0000 (08:13 -0800)] 
Merge pull request #3054 from ooosssososos/patch-1

[trace] Add aarch64 to supported architectures for zstd_trace

3 years agoImplement more gzip compatibility (#3037) 3059/head
Dirk Müller [Tue, 8 Feb 2022 20:32:42 +0000 (21:32 +0100)] 
Implement more gzip compatibility (#3037)

-n --no-name is the current behavior already, so we can implement
this as a noop.

--best is an alias for -9 in gzip

add basic cli tests.

3 years agoMerge pull request #3061 from embg/debug_ci_windows
Elliot Gorokhovsky [Wed, 9 Feb 2022 21:29:56 +0000 (16:29 -0500)] 
Merge pull request #3061 from embg/debug_ci_windows

Debug Windows CI failures

3 years agoReplace "windows-latest" with "windows-2019" in CI workflows 3061/head
Elliot Gorokhovsky [Wed, 9 Feb 2022 19:44:46 +0000 (14:44 -0500)] 
Replace "windows-latest" with "windows-2019" in CI workflows

3 years agoMove zstdgrep and zstdless tests to cli-tests (#3057)
binhdvo [Wed, 9 Feb 2022 16:21:33 +0000 (11:21 -0500)] 
Move zstdgrep and zstdless tests to cli-tests (#3057)

* Move zstdgrep and zstdless tests to cli-tests

Co-authored-by: Binh Vo <binhvo@fb.com>
3 years agoMerge pull request #3055 from terrelln/cli-test-symlinks
Nick Terrell [Tue, 8 Feb 2022 00:16:50 +0000 (16:16 -0800)] 
Merge pull request #3055 from terrelln/cli-test-symlinks

[cli-tests] Fix zstd symlinks

3 years ago[cli-tests] Fix zstd symlinks 3055/head
Nick Terrell [Mon, 7 Feb 2022 23:20:42 +0000 (15:20 -0800)] 
[cli-tests] Fix zstd symlinks

The zstd symlinks, notably `zstdcat`, weren't working as expected
because only the `tests/cli-tests/bin/zstd` wrapper was symlinked. We
still invoked `zstd` with the name `zstd`. The fix is to create a
directory of zstd symlinks in `tests/cli-tests/bin/symlinks` for each
name that zstd recognizes. And when `tets/cli-tests/bin/zstd` is
invoked, it selects the correct symlink to call.

See the test `zstd-cli/zstdcat.sh` for an example of how it would work.

3 years ago[trace] Add aarch64 to supported architectures for zstd_trace 3054/head
Oscar Shi [Mon, 7 Feb 2022 22:41:07 +0000 (14:41 -0800)] 
[trace] Add aarch64 to supported architectures for zstd_trace

Arm Toolchain should support weak symbols

3 years agoMerge pull request #3050 from shadchin/patch-1
Nick Terrell [Fri, 4 Feb 2022 19:23:19 +0000 (11:23 -0800)] 
Merge pull request #3050 from shadchin/patch-1

Select legacy level for cmake

3 years agoMerge pull request #3042 from u1f35c/fix2968
Yann Collet [Fri, 4 Feb 2022 15:50:58 +0000 (07:50 -0800)] 
Merge pull request #3042 from u1f35c/fix2968

Fix required decompression memory usage reported by -vv + --long

3 years agoMerge pull request #3046 from rex4539/typos
Yann Collet [Fri, 4 Feb 2022 15:50:25 +0000 (07:50 -0800)] 
Merge pull request #3046 from rex4539/typos

Fix typos

3 years agoSelect legacy level for cmake 3050/head
Alexander Shadchin [Fri, 4 Feb 2022 11:24:58 +0000 (14:24 +0300)] 
Select legacy level for cmake

3 years agoMacos playtest envvars fix (#3035)
Yonatan Komornik [Fri, 4 Feb 2022 02:42:20 +0000 (18:42 -0800)] 
Macos playtest envvars fix (#3035)

* playtests.sh: fix for a bug in macos' /bin/sh that persists temporary env vars when introduced before function calls
* cli-tests/run.py: Do not use existing ZSTD* envvars

3 years agoAdd rails for huffman table log calculation (#3047)
binhdvo [Wed, 2 Feb 2022 20:12:48 +0000 (15:12 -0500)] 
Add rails for huffman table log calculation (#3047)

3 years agoFix typos 3046/head
Dimitris Apostolou [Wed, 2 Feb 2022 17:32:31 +0000 (19:32 +0200)] 
Fix typos

3 years agoFix required decompression memory usage reported by -vv + --long 3042/head
Jonathan McDowell [Tue, 1 Feb 2022 11:20:30 +0000 (03:20 -0800)] 
Fix required decompression memory usage reported by -vv + --long

The use of --long alters the window size internally in the underlying
library (lib/compress/zstd_compress.c:ZSTD_getCParamsFromCCtxParams),
which changes the memory required for decompression. This means that the
reported requirement from the zstd binary when -vv is specified is
incorrect.

A full fix for this would be to add an API call to be able to retrieve
the required decompression memory from the library, but as a
lighterweight fix we can just take account of the fact we've enabled
long mode and update our verbose output appropriately.

Fixes #2968

3 years agoMerge pull request #3040 from facebook/fix44239
Yann Collet [Tue, 1 Feb 2022 21:33:01 +0000 (13:33 -0800)] 
Merge pull request #3040 from facebook/fix44239

fix 44239

3 years agofix 44239 3040/head
Yann Collet [Mon, 31 Jan 2022 17:34:04 +0000 (09:34 -0800)] 
fix 44239

credit to oss-fuzz

This issue could happen when using the new Sequence Compression API in Explicit Delimiter Mode
with a too small dstCapacity.
In which case, there was one place where the buffer size wasn't checked.

3 years agoMerge pull request #3036 from facebook/fix44168
Yann Collet [Tue, 1 Feb 2022 18:10:32 +0000 (10:10 -0800)] 
Merge pull request #3036 from facebook/fix44168

fixed bug 44168

3 years agoMerge branch 'dev' into fix44168 3036/head
Yann Collet [Tue, 1 Feb 2022 01:31:55 +0000 (17:31 -0800)] 
Merge branch 'dev' into fix44168

3 years agoTravis CI: fix by installing pip compatible with python 3.6 (#3041)
Yonatan Komornik [Tue, 1 Feb 2022 00:49:49 +0000 (16:49 -0800)] 
Travis CI: fix by installing pip compatible with python 3.6 (#3041)

Pip install script no longer supports python3.6 by default, switched to a script that does.

3 years agoupdate sequence_compression_api fuzzer test
Yann Collet [Tue, 1 Feb 2022 00:17:11 +0000 (16:17 -0800)] 
update sequence_compression_api fuzzer test

to check for under-sized dstCapacity.

3 years agoAsyncIO compression part 2 - added async read and asyncio to compression code (#3022)
Yonatan Komornik [Mon, 31 Jan 2022 23:43:41 +0000 (15:43 -0800)] 
AsyncIO compression part 2 - added async read and asyncio to compression code (#3022)

* Compression asyncio:
- Added asyncio functionality for compression flow
- Added ReadPool for async reads, implemented in both comp and decomp flows

3 years agoMerge pull request #3020 from terrelln/cli-tests
Nick Terrell [Mon, 31 Jan 2022 18:02:27 +0000 (10:02 -0800)] 
Merge pull request #3020 from terrelln/cli-tests

Add new CLI testing platform

3 years agotravis CI: update meson image to one with a python that isn't EOL 3039/head
Eli Schwartz [Mon, 31 Jan 2022 03:38:04 +0000 (22:38 -0500)] 
travis CI: update meson image to one with a python that isn't EOL

Currently the build errors out with:

```
ERROR: This script does not work on Python 3.6 The minimum supported Python version is 3.7. Please use https://bootstrap.pypa.io/pip/3.6/get-pip.py instead.
```

While in theory this advice could be followed to get a better pip on
xenial, Meson has now deprecated python 3.6 support too, and the next
(unreleased) version requires python 3.7

There are a couple solutions to this:
- hold the version of pip, allow pip to only install 3.6-compatible
  versions of meson (effectively freezing meson going forward)
- install python 3.7 on xenial
- update to a 2-year-old image instead of a 4-year-old one

Option 3 is the simplest.

3 years agomeson: valgrind wrapper should return correct errors
Eli Schwartz [Mon, 31 Jan 2022 02:45:19 +0000 (21:45 -0500)] 
meson: valgrind wrapper should return correct errors

While trying to raise an exception on failures, it instead raised an
exception for misusing the exception. CalledProcessError is only
supposed to be used when given a return code and a command, and it
prints:

Command '{cmd}' returned non-zero exit status {ret}

Passing an error message string instead, just errored out with:

TypeError: __init__() missing 1 required positional argument

Instead use the subprocess module's base error which does accept string
messages. Everything that used to error out, still errors out, but now
they do so with a slightly prettier console message.

3 years agomeson: never require a libm
Eli Schwartz [Mon, 31 Jan 2022 02:02:44 +0000 (21:02 -0500)] 
meson: never require a libm

libm is not guaranteed to exist. POSIX requires the math functions to
exist, but doesn't require to have it be a standalone library.

On platforms where libm exists as a standalone library, it will always
be found by meson -- it is shipped with libc.

If it is not found, then we can safely assume the linker will make the
math functions available by default.

See https://mesonbuild.com/howtox.html#add-math-library-lm-portably

Fixes building with bin_tests=true on Windows.

3 years agomeson: fix resource file compilation on Windows
Eli Schwartz [Mon, 31 Jan 2022 01:42:35 +0000 (20:42 -0500)] 
meson: fix resource file compilation on Windows

It needs to know about the correct include directories on its own.

3 years agoFix static analysis false-positives 3020/head
Nick Terrell [Sun, 30 Jan 2022 20:16:16 +0000 (12:16 -0800)] 
Fix static analysis false-positives

* It couldn't detect that the `fastCoverParams` can't be non-null, since it was just an assertion.
* It thought we were accesing `wksp->dtable` beyond the bounds because we were using it to set the `workSpace` value. Instead, compute the workspace size used in a different way.

3 years agofixed bug 44168
Yann Collet [Sun, 30 Jan 2022 00:23:21 +0000 (16:23 -0800)] 
fixed bug 44168

discovered by oss-fuzz

It's a bug in the test itself :
ZSTD_compressBound() as an upper bound of the compress size
only works for data compressed "normally".
But in situations where many flushes are forcefully introduced,
this creates many more blocks,
each of which has a potential to increase the size by 3 bytes.
In extreme cases (lots of small incompressible blocks), the expansion can go beyond ZSTD_compressBound().

This situation is similar when using the CompressSequences() API
with Explicit Block Delimiters.
In which case, each explicit block acts like a deliberate flush.
When employed by a fuzzer, it's possible to generate scenarios like the one described above,
with tons of incompressible blocks of small sizes,
thus going beyond ZSTD_compressBound().

fix : when using Explicit Block Delimiters, use a larger bound, to account for this scenario.

3 years agoMerge pull request #3027 from brailovich/dev
Yann Collet [Sat, 29 Jan 2022 23:40:43 +0000 (15:40 -0800)] 
Merge pull request #3027 from brailovich/dev

fix for -r on empty directory