]> git.ipfire.org Git - thirdparty/zstd.git/log
thirdparty/zstd.git
21 months agoextended the fix to ZSTDMT's Buffer Pool 3786/head
Yann Collet [Sun, 8 Oct 2023 07:25:17 +0000 (00:25 -0700)] 
extended the fix to ZSTDMT's Buffer Pool

21 months agoremoved unused macro constant
Yann Collet [Sun, 8 Oct 2023 06:32:22 +0000 (23:32 -0700)] 
removed unused macro constant

21 months agofixes suggested by @ebiggers
Yann Collet [Sun, 8 Oct 2023 06:29:42 +0000 (23:29 -0700)] 
fixes suggested by @ebiggers

21 months agoremoved FlexArray pattern from CCtxPool
Yann Collet [Sun, 8 Oct 2023 03:19:45 +0000 (20:19 -0700)] 
removed FlexArray pattern from CCtxPool

within ZSTDMT_.
This pattern is flagged by less forgiving variants of ubsan
notably used during compilation of the Linux Kernel.

There are 2 other places in the code where this pattern is used.
This fixes just one of them.

21 months agoMerge pull request #3752 from paulmenzel/fix-pzstd-makefile
Yann Collet [Sun, 8 Oct 2023 02:32:22 +0000 (19:32 -0700)] 
Merge pull request #3752 from paulmenzel/fix-pzstd-makefile

Fix pzstd Makefile to allow setting `DESTDIR` and `BINDIR` separately

21 months agoMerge pull request #3763 from dloidolt/fix_lib/README.md
Yann Collet [Sun, 8 Oct 2023 02:31:36 +0000 (19:31 -0700)] 
Merge pull request #3763 from dloidolt/fix_lib/README.md

Fix a very small formatting typo in the lib/README.md file

21 months agoMerge pull request #3772 from DimitriPapadopoulos/WIN32
Yann Collet [Sun, 8 Oct 2023 02:30:18 +0000 (19:30 -0700)] 
Merge pull request #3772 from DimitriPapadopoulos/WIN32

Do not test WIN32, instead test _WIN32

21 months agoMerge pull request #3771 from DimitriPapadopoulos/codespell
Yann Collet [Sun, 8 Oct 2023 02:29:41 +0000 (19:29 -0700)] 
Merge pull request #3771 from DimitriPapadopoulos/codespell

Fix new typos found by codespell

22 months agoMerge pull request #3777 from facebook/fix_x32
Yann Collet [Mon, 2 Oct 2023 23:25:43 +0000 (16:25 -0700)] 
Merge pull request #3777 from facebook/fix_x32

fix x32 tests on Github CI

22 months agoStop suppressing pointer-overflow UBSAN errors
Nick Terrell [Wed, 27 Sep 2023 00:53:26 +0000 (17:53 -0700)] 
Stop suppressing pointer-overflow UBSAN errors

* Remove all pointer-overflow suppressions from our UBSAN builds/tests.
* Add `ZSTD_ALLOW_POINTER_OVERFLOW_ATTR` macro to suppress
  pointer-overflow at a per-function level. This is a superior approach
  because it also applies to users who build zstd with UBSAN.
* Add `ZSTD_wrappedPtr{Diff,Add,Sub}()` that use these suppressions.
  The end goal is to only tag these functions with
  `ZSTD_ALLOW_POINTER_OVERFLOW`. But we can start by annoting functions
  that rely on pointer overflow, and gradually transition to using
  these.
* Add `ZSTD_maybeNullPtrAdd()` to simplify pointer addition when the
  pointer may be `NULL`.
* Fix all the fuzzer issues that came up. I'm sure there will be a lot
  more, but these are the ones that came up within a few minutes of
  running the fuzzers, and while running GitHub CI.

22 months agoRevert "Work around nullptr-with-nonzero-offset warning"
Nick Terrell [Fri, 25 Aug 2023 18:18:56 +0000 (11:18 -0700)] 
Revert "Work around nullptr-with-nonzero-offset warning"

This reverts commit c27fa399042f466080e79bb4fd8a4871bc0bcf28.

22 months agofix x32 tests on Github CI 3777/head
Yann Collet [Thu, 28 Sep 2023 04:18:20 +0000 (21:18 -0700)] 
fix x32 tests on Github CI

ubuntu-22.04 seems to have problems with x32 recently
switching to ubuntu-20.04 which seems to work fine so far

https://github.com/actions/runner-images/issues/8397

22 months agoMerge pull request #3774 from facebook/dependabot/github_actions/actions/checkout...
Yann Collet [Mon, 25 Sep 2023 06:34:06 +0000 (23:34 -0700)] 
Merge pull request #3774 from facebook/dependabot/github_actions/actions/checkout-4.1.0

Bump actions/checkout from 4.0.0 to 4.1.0

22 months agoBump actions/checkout from 4.0.0 to 4.1.0 3774/head
dependabot[bot] [Mon, 25 Sep 2023 05:18:07 +0000 (05:18 +0000)] 
Bump actions/checkout from 4.0.0 to 4.1.0

Bumps [actions/checkout](https://github.com/actions/checkout) from 4.0.0 to 4.1.0.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/3df4ab11eba7bda6032a0b82a6bb43b11571feac...8ade135a41bc03ea155e62e844d188df1ea18608)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
22 months agoDo not test WIN32, instead test _WIN32 3772/head
Dimitri Papadopoulos [Sat, 23 Sep 2023 17:03:18 +0000 (19:03 +0200)] 
Do not test WIN32, instead test _WIN32

To the best of my knowledge:
* `_WIN32` and `_WIN64` are defined by the compiler,
* `WIN32` and `WIN64` are defined by the user, to indicate whatever
  the user chooses them to indicate. They mean 32-bit and 64-bit Windows
  compilation by convention only.

See:
https://accu.org/journals/overload/24/132/wilson_2223/

Windows compilers in general, and MSVC in particular, have been defining
`_WIN32` and `_WIN64` for a long time, provably at least since Visual Studio
2015, and in practice as early as in the days of 16-bit Windows.

See:
https://learn.microsoft.com/en-us/cpp/preprocessor/predefined-macros?view=msvc-140
https://learn.microsoft.com/en-us/windows/win32/winprog64/the-tools

Tests used to be inconsistent, sometimes testing `_WIN32`, sometimes
`_WIN32` and `WIN32`. This brings consistency to Windows detection.

22 months agoFix new typos found by codespell 3771/head
Dimitri Papadopoulos [Sat, 23 Sep 2023 16:56:01 +0000 (18:56 +0200)] 
Fix new typos found by codespell

22 months agoImprove macro guards for ZSTD_assertValidSequence
Nick Terrell [Fri, 22 Sep 2023 18:51:15 +0000 (11:51 -0700)] 
Improve macro guards for ZSTD_assertValidSequence

Refine the macro guards to define the functions exactly when they are
needed.

This fixes the chromium build with zstd.

Thanks to @GregTho for reporting!

22 months agoFix a very small formatting typo in the lib/README.md file 3763/head
Dominik Loidolt [Tue, 19 Sep 2023 14:22:47 +0000 (16:22 +0200)] 
Fix a very small formatting typo in the lib/README.md file

22 months agoMerge pull request #3755 from facebook/estimate_doc
Yann Collet [Tue, 19 Sep 2023 05:32:40 +0000 (22:32 -0700)] 
Merge pull request #3755 from facebook/estimate_doc

added some documentation on ZSTD_estimate*Size() variants

22 months agoadded some documentation on ZSTD_estimate*Size() variants 3755/head
Yann Collet [Wed, 13 Sep 2023 18:35:19 +0000 (11:35 -0700)] 
added some documentation on ZSTD_estimate*Size() variants

as a follow up for #3747

22 months agoMerge pull request #3749 from facebook/dependabot/github_actions/actions/checkout...
Yann Collet [Tue, 12 Sep 2023 20:58:08 +0000 (13:58 -0700)] 
Merge pull request #3749 from facebook/dependabot/github_actions/actions/checkout-4.0.0

Bump actions/checkout from 3.5.3 to 4.0.0

22 months agoMerge pull request #3745 from klausholstjacobsen/qnx-support
Yann Collet [Tue, 12 Sep 2023 20:43:59 +0000 (13:43 -0700)] 
Merge pull request #3745 from klausholstjacobsen/qnx-support

Added qnx in the posix test section of platform.h

22 months agoMerge pull request #3750 from facebook/dependabot/github_actions/actions/upload-artif...
Yann Collet [Tue, 12 Sep 2023 20:43:00 +0000 (13:43 -0700)] 
Merge pull request #3750 from facebook/dependabot/github_actions/actions/upload-artifact-3.1.3

Bump actions/upload-artifact from 3.1.2 to 3.1.3

22 months ago[pzstd]: Fix `DESTDIR` handling to allow setting `BINDIR` 3752/head
Paul Menzel [Tue, 12 Sep 2023 17:12:19 +0000 (19:12 +0200)] 
[pzstd]: Fix `DESTDIR` handling to allow setting `BINDIR`

Currently, setting `BINDIR` and `DESTDIR` separately is not possible, so
the command below fails, as BINDIR is set explicitly:

    $ make -j80 install PREFIX=/usr EPREFIX=/usr BINDIR=/usr/bin SBINDIR=/usr/sbin LIBEXECDIR=/usr/libexec SYSCONFDIR=/etc SHAREDSTATEDIR=/var LOCALST ATEDIR=/var LIBDIR=/usr/lib INCLUDEDIR=/usr/include DATAROOTDIR=/usr/share DATADIR=/usr/share INFODIR=/usr/share/info LOCALEDIR=/usr/share/locale MAND IR=/usr/share/man DOCDIR=/usr/share/doc/zstd DESTDIR=/dev/shm/bee-pmenzel/zstd/zstd-1.5.5-0/image -C contrib/pzstd DESTDIR=/dev/shm/bee-pmenzel/zstd/zstd-1.5.5-0/image
    make: Entering directory
    '/dev/shm/bee-pmenzel/zstd/zstd-1.5.5-0/source/contrib/pzstd' CFLAGS="  -I../../lib -I../../lib/common -I../../programs -I. -DNDEBUG -O3 -Wall -Wextra -Wno-deprecated-declarations   " LDFLAGS=" -O3 -Wall -Wextra -pedantic  " make -C ../../lib libzstd.a
    make[1]: Entering directory '/dev/shm/bee-pmenzel/zstd/zstd-1.5.5-0/source/lib'
    make[1]: Leaving directory '/dev/shm/bee-pmenzel/zstd/zstd-1.5.5-0/source/lib'
    g++ main.o ../../programs/util.o Options.o Pzstd.o SkippableFrame.o ../../lib/libzstd.a           -O3 -Wall -Wextra -pedantic    -pthread -o pzstd
    install -d -m 755 /usr/bin/
    install -m 755 pzstd /usr/bin/pzstd
    install: cannot create regular file '/usr/bin/pzstd': Permission denied
    make: *** [Makefile:116: install] Error 1

So, do not prefix `BINDIR` with `DESTDIR`, and adapt all paths for
installation. This is more common, and, for example, `programs/Makefile`
does the same.

Fixes: 8b4e84249b ("[pzstd] Fix Makefile")
22 months agoBump actions/upload-artifact from 3.1.2 to 3.1.3 3750/head
dependabot[bot] [Mon, 11 Sep 2023 05:09:05 +0000 (05:09 +0000)] 
Bump actions/upload-artifact from 3.1.2 to 3.1.3

Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 3.1.2 to 3.1.3.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](https://github.com/actions/upload-artifact/compare/0b7f8abb1508181956e8e162db84b466c27e18ce...a8a3f3ad30e3422c9c7b888a15615d19a852ae32)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
22 months agoBump actions/checkout from 3.5.3 to 4.0.0 3749/head
dependabot[bot] [Mon, 11 Sep 2023 05:09:02 +0000 (05:09 +0000)] 
Bump actions/checkout from 3.5.3 to 4.0.0

Bumps [actions/checkout](https://github.com/actions/checkout) from 3.5.3 to 4.0.0.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/c85c95e3d7251135ab7dc9ce3241c5835cc595a9...3df4ab11eba7bda6032a0b82a6bb43b11571feac)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
22 months agoMerge pull request #3739 from JohanMabille/cmake
Yann Collet [Sun, 10 Sep 2023 13:32:24 +0000 (06:32 -0700)] 
Merge pull request #3739 from JohanMabille/cmake

Fixed zstd cmake shared build on windows

22 months agoMerge pull request #3733 from ldv-alt/zdictlib_fix_prototype_mismatch
Yann Collet [Sun, 10 Sep 2023 13:31:52 +0000 (06:31 -0700)] 
Merge pull request #3733 from ldv-alt/zdictlib_fix_prototype_mismatch

zdictlib: fix prototype mismatch

23 months agoAdded qnx in the posix test section of platform.h 3745/head
klausholstjacobsen [Sun, 3 Sep 2023 08:10:23 +0000 (10:10 +0200)] 
Added qnx in the posix test section of platform.h

23 months agoFixed zstd cmake shared build on windows 3739/head
Johan Mabille [Fri, 25 Aug 2023 22:40:35 +0000 (00:40 +0200)] 
Fixed zstd cmake shared build on windows

23 months agoFix & refactor Huffman repeat tables for dictionaries
Nick Terrell [Thu, 24 Aug 2023 21:41:21 +0000 (14:41 -0700)] 
Fix & refactor Huffman repeat tables for dictionaries

The Huffman repeat mode checker assumed that the CTable was zeroed in the region `[maxSymbolValue + 1, 256)`.
This assumption didn't hold for tables built in the dictionaries, because it didn't go through the same codepath.

Since this code was originally written, we added a header to the CTable that specifies the `tableLog`.
Add `maxSymbolValue` to that header, and check that the table's `maxSymbolValue` is at least the block's `maxSymbolValue`.

This solution is cleaner because we write this header for every CTable we build, so it can't be missed in any code path.

Credit to OSS-Fuzz

23 months agoWork around nullptr-with-nonzero-offset warning
Nick Terrell [Thu, 24 Aug 2023 23:33:42 +0000 (16:33 -0700)] 
Work around nullptr-with-nonzero-offset warning

See comment.

23 months agozdictlib: fix prototype mismatch 3733/head
Dmitry V. Levin [Tue, 8 Aug 2023 08:00:00 +0000 (08:00 +0000)] 
zdictlib: fix prototype mismatch

Fix the following warnings reported by the compiler when
ZDICTLIB_STATIC_API is not defined to ZDICTLIB_API:

lib/dictBuilder/cover.c:1122:21: warning: redeclaration of 'ZDICT_optimizeTrainFromBuffer_cover' with different visibility (old visibility
preserved)
lib/dictBuilder/cover.c:736:21: warning: redeclaration of 'ZDICT_trainFromBuffer_cover' with different visibility (old visibility
+preserved)
lib/dictBuilder/fastcover.c:549:1: warning: redeclaration of 'ZDICT_trainFromBuffer_fastCover' with different visibility (old visibility
preserved)
lib/dictBuilder/fastcover.c:618:1: warning: redeclaration of 'ZDICT_optimizeTrainFromBuffer_fastCover' with different visibility (old
visibility preserved)

23 months agoMerge pull request #3720 from QBos07/cygwin-msys2-support
Yann Collet [Tue, 22 Aug 2023 23:29:34 +0000 (16:29 -0700)] 
Merge pull request #3720 from QBos07/cygwin-msys2-support

Updated Makefiles for full MSYS2 and Cygwin installation and testing …

23 months agoMerge pull request #3728 from 0o001/dev
Yann Collet [Tue, 22 Aug 2023 20:33:47 +0000 (13:33 -0700)] 
Merge pull request #3728 from 0o001/dev

fix: ZSTD_BUILD_DECOMPRESSION message

23 months agoNo longer reject dictionaries with literals maxSymbolValue < 255
Nick Terrell [Mon, 21 Aug 2023 18:33:29 +0000 (11:33 -0700)] 
No longer reject dictionaries with literals maxSymbolValue < 255

We already have logic in our Huffman encoder to validate Huffman tables with missing symbols.
We use this for higher compression levels to re-use the previous blocks statistics, or when the dictionaries table has zero-weighted symbols.
This check was leftover as an oversight from before we added validation for Huffman tables.

I validated that the `dictionary_loader` fuzzer has coverage of every line in the `ZSTD_loadCEntropy()` function to validate that it is correctly testing this function.

23 months agoMerge pull request #3726 from facebook/fullbench_dctx
Yann Collet [Mon, 21 Aug 2023 19:35:51 +0000 (12:35 -0700)] 
Merge pull request #3726 from facebook/fullbench_dctx

added ZSTD_decompressDCtx() benchmark option to fullbench

23 months agoMerge pull request #3730 from facebook/dependabot/github_actions/github/codeql-action...
Felix Handte [Mon, 21 Aug 2023 16:47:26 +0000 (09:47 -0700)] 
Merge pull request #3730 from facebook/dependabot/github_actions/github/codeql-action-2.21.4

Bump github/codeql-action from 2.20.3 to 2.21.4

23 months agoBump github/codeql-action from 2.20.3 to 2.21.4 3730/head
dependabot[bot] [Mon, 21 Aug 2023 05:51:56 +0000 (05:51 +0000)] 
Bump github/codeql-action from 2.20.3 to 2.21.4

Bumps [github/codeql-action](https://github.com/github/codeql-action) from 2.20.3 to 2.21.4.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/46ed16ded91731b2df79a2893d3aea8e9f03b5c4...a09933a12a80f87b87005513f0abb1494c27a716)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
23 months agofix: ZSTD_BUILD_DECOMPRESSION message 3728/head
Mustafa UZUN [Sat, 19 Aug 2023 12:44:53 +0000 (15:44 +0300)] 
fix: ZSTD_BUILD_DECOMPRESSION message

23 months agoadded ZSTD_decompressDCtx() benchmark option to fullbench 3726/head
Yann Collet [Wed, 16 Aug 2023 17:43:39 +0000 (10:43 -0700)] 
added ZSTD_decompressDCtx() benchmark option to fullbench

useful to compare the difference between ZSTD_decompress
and ZSTD_decompressDCtx().

23 months agoMerge pull request #3725 from felixhandte/msan-unpoison-cwksp-on-free
Felix Handte [Wed, 16 Aug 2023 17:18:31 +0000 (10:18 -0700)] 
Merge pull request #3725 from felixhandte/msan-unpoison-cwksp-on-free

Unpoison Workspace Memory Before Custom-Free

23 months agoUnpoison Workspace Memory Before Freeing to Custom Free 3725/head
W. Felix Handte [Wed, 16 Aug 2023 16:09:12 +0000 (12:09 -0400)] 
Unpoison Workspace Memory Before Freeing to Custom Free

MSAN is hooked into the system malloc, but when the user provides a custom
allocator, it may not provide the same cleansing behavior. So if we leave
memory poisoned and return it to the user's allocator, where it is re-used
elsewhere, our poisoning can blow up in some other context.

23 months agoEasy: Move Helper Functions Up
W. Felix Handte [Wed, 16 Aug 2023 16:08:52 +0000 (12:08 -0400)] 
Easy: Move Helper Functions Up

23 months agoImprove dual license wording in README
Nick Terrell [Sat, 12 Aug 2023 00:09:07 +0000 (17:09 -0700)] 
Improve dual license wording in README

We are licensed under BSD or GPLv2. It is clear in our headers, but not in the README.

Fixes #3717

23 months agoUpdated Makefiles for full MSYS2 and Cygwin installation and testing support. 3720/head
Quentin Boswank [Sun, 13 Aug 2023 17:44:15 +0000 (19:44 +0200)] 
Updated Makefiles for full MSYS2 and Cygwin installation and testing support.

They are Linux-like environments under Windows and have all the tools needed to support staged installation and testing.

Beware: this only affects the make build system.

2 years agoMerge pull request #3712 from alexsifivetw/fix_typo
Yann Collet [Wed, 2 Aug 2023 18:11:31 +0000 (11:11 -0700)] 
Merge pull request #3712 from alexsifivetw/fix_typo

Fixed typo

2 years agoFixed typo 3712/head
jysh1214 [Tue, 1 Aug 2023 02:43:33 +0000 (10:43 +0800)] 
Fixed typo

2 years agoMerge pull request #3701 from nikohoffren/grammar-fix
Yann Collet [Mon, 31 Jul 2023 10:25:17 +0000 (03:25 -0700)] 
Merge pull request #3701 from nikohoffren/grammar-fix

Fix typographical error in README.md

2 years agoMerge pull request #3704 from void0red/dev
Yann Collet [Sun, 30 Jul 2023 01:16:14 +0000 (18:16 -0700)] 
Merge pull request #3704 from void0red/dev

fileio_asyncio: handle malloc fails in AIO_ReadPool_create

2 years agofileio_asyncio: handle malloc fails in AIO_ReadPool_create 3704/head
void0red [Fri, 21 Jul 2023 04:17:03 +0000 (12:17 +0800)] 
fileio_asyncio: handle malloc fails in AIO_ReadPool_create

2 years agoUpdate fileio.c: fix build failure with enabled LTO
Gianfranco Costamagna [Fri, 7 Jul 2023 07:26:30 +0000 (09:26 +0200)] 
Update fileio.c: fix build failure with enabled LTO

For some reasons when LTO is enabled, the compiler complains about statbuf variable not being correctly initialized, even though the variable has an assert != NULL just few lines below (FIO_getDictFileStat)

This is the fixed build failure:
x86_64-linux-gnu-gcc -g -O2 -ffile-prefix-map=/<<PKGBUILDDIR>>=. -flto=auto -ffat-lto-objects -fstack-protector-strong -Wformat -Werror=format-security -fdebug-prefix-map=/<<PKGBUILDDIR>>=/usr/src/libzstd-1.5.5+dfsg2-1 -Wall -Wextra -Wcast-qual -Wcast-align -Wshadow -Wstrict-aliasing=1 -Wswitch-enum -Wdeclaration-after-statement -Wstrict-prototypes -Wundef -Wpointer-arith -Wvla -Wformat=2 -Winit-self -Wfloat-equal -Wwrite-strings -Wredundant-decls -Wmissing-prototypes -Wc++-compat -g -Werror -Wa,--noexecstack -Wdate-time -D_FORTIFY_SOURCE=2 -DXXH_NAMESPACE=ZSTD_ -DDEBUGLEVEL=1 -DZSTD_LEGACY_SUPPORT=5 -DZSTD_MULTITHREAD -DZSTD_GZCOMPRESS -DZSTD_GZDECOMPRESS -DZSTD_LZMACOMPRESS -DZSTD_LZMADECOMPRESS -DZSTD_LZ4COMPRESS -DZSTD_LZ4DECOMPRESS -DZSTD_LEGACY_SUPPORT=5  -c -MT obj/conf_086c46a51a716b674719b8acb8484eb8/zstdcli_trace.o -MMD -MP -MF obj/conf_086c46a51a716b674719b8acb8484eb8/zstdcli_trace.d -o obj/conf_086c46a51a716b674719b8acb8484eb8/zstdcli_trace.o zstdcli_trace.c
In function ‘UTIL_isRegularFileStat’,
    inlined from ‘UTIL_getFileSizeStat’ at util.c:524:10,
    inlined from ‘FIO_createDResources’ at fileio.c:2230:30:
util.c:209:12: error: ‘statbuf.st_mode’ may be used uninitialized [-Werror=maybe-uninitialized]
  209 |     return S_ISREG(statbuf->st_mode) != 0;
      |            ^
fileio.c: In function ‘FIO_createDResources’:
fileio.c:2223:12: note: ‘statbuf’ declared here
 2223 |     stat_t statbuf;
      |            ^
lto1: all warnings being treated as errors

2 years agoSave one byte on the frame epilogue
Jacob Greenfield [Tue, 18 Jul 2023 14:48:46 +0000 (10:48 -0400)] 
Save one byte on the frame epilogue

2 years agoMerge pull request #3665 from gjasny/fix-asm-for-xcode
Yann Collet [Thu, 20 Jul 2023 08:48:39 +0000 (01:48 -0700)] 
Merge pull request #3665 from gjasny/fix-asm-for-xcode

Fix Intel Xcode builds with assembly

2 years agoFix typographical error in README.md 3701/head
Niko Hoffrén [Wed, 19 Jul 2023 18:49:43 +0000 (21:49 +0300)] 
Fix typographical error in README.md

2 years agoMerge pull request #3697 from facebook/dependabot/github_actions/github/codeql-action...
Elliot Gorokhovsky [Tue, 11 Jul 2023 20:37:20 +0000 (13:37 -0700)] 
Merge pull request #3697 from facebook/dependabot/github_actions/github/codeql-action-2.20.3

Bump github/codeql-action from 2.20.1 to 2.20.3

2 years agoBump github/codeql-action from 2.20.1 to 2.20.3 3697/head
dependabot[bot] [Mon, 10 Jul 2023 05:37:59 +0000 (05:37 +0000)] 
Bump github/codeql-action from 2.20.1 to 2.20.3

Bumps [github/codeql-action](https://github.com/github/codeql-action) from 2.20.1 to 2.20.3.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/f6e388ebf0efc915c6c5b165b019ee61a6746a38...46ed16ded91731b2df79a2893d3aea8e9f03b5c4)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2 years agoMerge pull request #3677 from facebook/detectOverflow
Yann Collet [Wed, 5 Jul 2023 07:59:08 +0000 (00:59 -0700)] 
Merge pull request #3677 from facebook/detectOverflow

Changed the decoding loop to detect more invalid cases of corruption sooner

2 years agoMerge pull request #3688 from nidhijaju/hide-asm-apple
Yann Collet [Fri, 30 Jun 2023 02:40:37 +0000 (19:40 -0700)] 
Merge pull request #3688 from nidhijaju/hide-asm-apple

Hide ASM symbols on Apple platforms

2 years agoMerge pull request #3689 from facebook/dependabot/github_actions/github/codeql-action...
Elliot Gorokhovsky [Wed, 28 Jun 2023 01:05:52 +0000 (18:05 -0700)] 
Merge pull request #3689 from facebook/dependabot/github_actions/github/codeql-action-2.20.1

Bump github/codeql-action from 2.3.2 to 2.20.1

2 years agoMerge pull request #3690 from facebook/dependabot/github_actions/ossf/scorecard-actio...
Elliot Gorokhovsky [Wed, 28 Jun 2023 01:05:32 +0000 (18:05 -0700)] 
Merge pull request #3690 from facebook/dependabot/github_actions/ossf/scorecard-action-2.2.0

Bump ossf/scorecard-action from 2.1.3 to 2.2.0

2 years agoMerge pull request #3686 from embg/ldm_error
Elliot Gorokhovsky [Mon, 26 Jun 2023 17:43:20 +0000 (13:43 -0400)] 
Merge pull request #3686 from embg/ldm_error

Clean up a false error message in the LDM debug log

2 years agoBump ossf/scorecard-action from 2.1.3 to 2.2.0 3690/head
dependabot[bot] [Mon, 26 Jun 2023 05:59:43 +0000 (05:59 +0000)] 
Bump ossf/scorecard-action from 2.1.3 to 2.2.0

Bumps [ossf/scorecard-action](https://github.com/ossf/scorecard-action) from 2.1.3 to 2.2.0.
- [Release notes](https://github.com/ossf/scorecard-action/releases)
- [Changelog](https://github.com/ossf/scorecard-action/blob/main/RELEASE.md)
- [Commits](https://github.com/ossf/scorecard-action/compare/80e868c13c90f172d68d1f4501dee99e2479f7af...08b4669551908b1024bb425080c797723083c031)

---
updated-dependencies:
- dependency-name: ossf/scorecard-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2 years agoBump github/codeql-action from 2.3.2 to 2.20.1 3689/head
dependabot[bot] [Mon, 26 Jun 2023 05:59:38 +0000 (05:59 +0000)] 
Bump github/codeql-action from 2.3.2 to 2.20.1

Bumps [github/codeql-action](https://github.com/github/codeql-action) from 2.3.2 to 2.20.1.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/f3feb00acb00f31a6f60280e6ace9ca31d91c76a...f6e388ebf0efc915c6c5b165b019ee61a6746a38)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2 years agohide asm functions on apple platforms 3688/head
Nidhi Jaju [Mon, 26 Jun 2023 00:07:30 +0000 (00:07 +0000)] 
hide asm functions on apple platforms

2 years agoMerge pull request #3684 from emaste/dev
Yann Collet [Sat, 24 Jun 2023 05:56:07 +0000 (22:56 -0700)] 
Merge pull request #3684 from emaste/dev

Update FreeBSD CI images to latest supported releases

2 years agosuppress false error message in LDM mode 3686/head
Elliot Gorokhovsky [Thu, 22 Jun 2023 01:52:50 +0000 (18:52 -0700)] 
suppress false error message in LDM mode

2 years agoUpdate FreeBSD CI images to latest supported releases 3684/head
Ed Maste [Wed, 21 Jun 2023 16:16:26 +0000 (12:16 -0400)] 
Update FreeBSD CI images to latest supported releases

2 years agofixed incorrect test in Win32 pthread wrapper
Yann Collet [Tue, 20 Jun 2023 15:34:26 +0000 (08:34 -0700)] 
fixed incorrect test in Win32 pthread wrapper

reported by @Banzai24-yht in #3683

2 years agofixed static analyzer false positive regarding @sequence initialization 3677/head
Yann Collet [Fri, 16 Jun 2023 23:24:48 +0000 (16:24 -0700)] 
fixed static analyzer false positive regarding @sequence initialization

make a mock initialization to please the tool

2 years agoadapted long decoder to new decodeSequences
Yann Collet [Fri, 16 Jun 2023 22:52:00 +0000 (15:52 -0700)] 
adapted long decoder to new decodeSequences

removed older decodeSequences

2 years agochanged ZSTD_decompressSequences_bodySplitLitBuffer() decoding loop
Yann Collet [Fri, 16 Jun 2023 22:32:07 +0000 (15:32 -0700)] 
changed ZSTD_decompressSequences_bodySplitLitBuffer() decoding loop

to behave more like the regular decoding loop.

2 years agoremoved _old variant from splitLit
Yann Collet [Fri, 16 Jun 2023 19:31:23 +0000 (12:31 -0700)] 
removed _old variant from splitLit

2 years agochanged (partially) the decodeSequences flow logic
Yann Collet [Fri, 16 Jun 2023 18:56:22 +0000 (11:56 -0700)] 
changed (partially) the decodeSequences flow logic

this allows detecting overflow events without a checksum.

2 years agoMerge pull request #3676 from facebook/overflow_zeroes
Yann Collet [Fri, 16 Jun 2023 01:16:41 +0000 (18:16 -0700)] 
Merge pull request #3676 from facebook/overflow_zeroes

Bitstream produces only zeroes after an overflow event

2 years agofixed MEM_STATIC already defined in Linux Kernel mode 3676/head
Yann Collet [Thu, 15 Jun 2023 03:03:39 +0000 (20:03 -0700)] 
fixed MEM_STATIC already defined in Linux Kernel mode

2 years agofix : unused attribute for FORCE_INLINE functions
Yann Collet [Wed, 14 Jun 2023 23:32:51 +0000 (16:32 -0700)] 
fix : unused attribute for FORCE_INLINE functions

fix2 : reloadDStreamFast is used by decompress4x2,
modified the entry point, so that it works fine in this case too.

2 years agomake the bitstream generate only 0-value bits after an overflow
Yann Collet [Wed, 14 Jun 2023 22:42:37 +0000 (15:42 -0700)] 
make the bitstream generate only 0-value bits after an overflow

2 years agoMerge pull request #3674 from facebook/zeroSeq_noExtra
Yann Collet [Tue, 13 Jun 2023 23:17:07 +0000 (16:17 -0700)] 
Merge pull request #3674 from facebook/zeroSeq_noExtra

detect extraneous bytes in the Sequences section

2 years agodetect extraneous bytes in the Sequences section 3674/head
Yann Collet [Tue, 13 Jun 2023 18:43:45 +0000 (11:43 -0700)] 
detect extraneous bytes in the Sequences section

when nbSeq == 0.

Reported by @ip7z

2 years agoMerge pull request #3671 from facebook/dependabot/github_actions/actions/checkout...
Yann Collet [Mon, 12 Jun 2023 16:58:53 +0000 (09:58 -0700)] 
Merge pull request #3671 from facebook/dependabot/github_actions/actions/checkout-3.5.3

Bump actions/checkout from 3.5.2 to 3.5.3

2 years agoBump actions/checkout from 3.5.2 to 3.5.3 3671/head
dependabot[bot] [Mon, 12 Jun 2023 06:00:14 +0000 (06:00 +0000)] 
Bump actions/checkout from 3.5.2 to 3.5.3

Bumps [actions/checkout](https://github.com/actions/checkout) from 3.5.2 to 3.5.3.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/8e5e7e5ab8b370d6c329ec480221332ada57f0ab...c85c95e3d7251135ab7dc9ce3241c5835cc595a9)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2 years agoMerge pull request #3669 from facebook/zeroSeq_2B
Yann Collet [Tue, 6 Jun 2023 04:06:15 +0000 (00:06 -0400)] 
Merge pull request #3669 from facebook/zeroSeq_2B

fixed decoder behavior when nbSeqs==0 is encoded using 2 bytes

2 years agofixed decoder behavior when nbSeqs==0 is encoded using 2 bytes 3669/head
Yann Collet [Mon, 5 Jun 2023 23:03:00 +0000 (16:03 -0700)] 
fixed decoder behavior when nbSeqs==0 is encoded using 2 bytes

The sequence section starts with a number, which tells how sequences are present in the section.
If this number if 0, the section automatically ends.

The number 0 can be represented using the 1 byte or the 2 bytes formats.
That's because the 2-bytes formats fully overlaps the 1 byte format.

However, when 0 is represented using the 2-bytes format,
the decoder was expecting the sequence section to continue,
and was looking for FSE tables, which is incorrect.

Fixed this behavior, in both the reference decoder and the educational behavior.

In practice, this behavior never happens,
because the encoder will always select the 1-byte format to represent 0,
since this is more efficient.

Completed the fix with a new golden sample for tests,
a clarification of the specification,
and a decoder errata paragraph.

2 years agoMerge pull request #3664 from facebook/llu
Yann Collet [Mon, 5 Jun 2023 19:03:27 +0000 (15:03 -0400)] 
Merge pull request #3664 from facebook/llu

changed LLU suffix into ULL for Visual 2012 and lower

2 years agoMerge pull request #3659 from facebook/fixHarness
Yann Collet [Mon, 5 Jun 2023 19:03:14 +0000 (15:03 -0400)] 
Merge pull request #3659 from facebook/fixHarness

Fixed a bug in the educational decoder

2 years agoMerge pull request #3668 from facebook/fix3667
Yann Collet [Mon, 5 Jun 2023 19:02:55 +0000 (15:02 -0400)] 
Merge pull request #3668 from facebook/fix3667

fix a minor inefficiency in compress_superblock

2 years agofix a minor inefficiency in compress_superblock 3668/head
Yann Collet [Mon, 5 Jun 2023 16:51:52 +0000 (09:51 -0700)] 
fix a minor inefficiency in compress_superblock

and in `decodecorpus`:
the specific case `nbSeq=127` can be represented using the 1-byte format.
Note that both the 1-byte and the 2-bytes formats are valid to represent this case,
so there was no "error", produced data remains valid,
it's just that the 1-byte format is more efficient.

fix #3667

Credit to @ip7z for finding this issue.

2 years agoFix Intel Xcode builds with assembly 3665/head
Gregor Jasny [Fri, 2 Jun 2023 10:34:56 +0000 (12:34 +0200)] 
Fix Intel Xcode builds with assembly

When forcing the source file language to `C`, Xcode enforces
the file to be compiled as `C` by appending `-x c` to the
compiler command line.

For now try to limit the damage and only enforce the language
if the ASM and C compilers differ.

Reproducer (CMake `3.26.4`, Xcode `14.3`):
```
cmake -S build/cmake -B _b -GXcode -DCMAKE_OSX_ARCHITECTURES=x86_64
cmake --build _b
```

Fix: #3622

2 years agochanged LLU suffix into ULL for Visual 2012 and lower 3664/head
Yann Collet [Wed, 31 May 2023 20:29:53 +0000 (13:29 -0700)] 
changed LLU suffix into ULL for Visual 2012 and lower

both suffixes are supposed to be valid,
but for some reason, Visual 2012 and lower only support ULL.

2 years agoFixed a bug in the educational decoder 3659/head
Yann Collet [Sat, 27 May 2023 18:22:30 +0000 (11:22 -0700)] 
Fixed a bug in the educational decoder

Credit to Igor Pavlov

2 years agoAdd options in Makefile to cmake
Tao He [Thu, 25 May 2023 14:48:01 +0000 (22:48 +0800)] 
Add options in Makefile to cmake

Signed-off-by: Tao He <sighingnow@gmail.com>
2 years agoFix UBSAN issue (zero addition to NULL)
Nick Terrell [Thu, 25 May 2023 21:35:49 +0000 (14:35 -0700)] 
Fix UBSAN issue (zero addition to NULL)

Fix UBSAN issue that came up internally.

2 years agoMerge pull request #3631 from facebook/example_streaming_mt
Yann Collet [Wed, 24 May 2023 00:38:28 +0000 (20:38 -0400)] 
Merge pull request #3631 from facebook/example_streaming_mt

minor : update streaming_compression example

2 years agoGet zstd working with ARM64EC on Windows
Duncan Horn [Mon, 1 May 2023 21:29:52 +0000 (14:29 -0700)] 
Get zstd working with ARM64EC on Windows

2 years agoMerge pull request #3623 from felixhandte/compile-out-compressors
Felix Handte [Mon, 22 May 2023 21:38:10 +0000 (17:38 -0400)] 
Merge pull request #3623 from felixhandte/compile-out-compressors

Allow Build-Time Exclusion of Individual Compression Strategies

2 years agoReorder Definitions in zstd_opt.c to Group Under Macro Guards (Slightly) 3623/head
W. Felix Handte [Mon, 22 May 2023 16:41:48 +0000 (12:41 -0400)] 
Reorder Definitions in zstd_opt.c to Group Under Macro Guards (Slightly)

2 years agoReorder Definitions in zstd_lazy.c to Group Under Macro Guards
W. Felix Handte [Mon, 22 May 2023 16:37:03 +0000 (12:37 -0400)] 
Reorder Definitions in zstd_lazy.c to Group Under Macro Guards

2 years agoAlso Allow/Document/Test Excluding dfast and Up
W. Felix Handte [Thu, 4 May 2023 16:31:41 +0000 (12:31 -0400)] 
Also Allow/Document/Test Excluding dfast and Up

2 years agoAdd Documentation to lib/README.md
W. Felix Handte [Thu, 4 May 2023 16:20:02 +0000 (12:20 -0400)] 
Add Documentation to lib/README.md