1
0
mirror of https://github.com/facebook/zstd.git synced 2025-03-07 01:10:04 +02:00

10860 Commits

Author SHA1 Message Date
Uilian Ries
0986e1e630 Add Conan to readme
Signed-off-by: Uilian Ries <uilianries@gmail.com>
2024-07-26 09:45:06 +02:00
Yann Collet
0ff651dd87
Merge pull request #4096 from tpetazzoni/build-fix
lib/libzstd.mk: fix typo in the definition of LIB_BINDIR
2024-07-16 14:09:43 -07:00
Thomas Petazzoni
5d63f186cc lib/libzstd.mk: fix typo in the definition of LIB_BINDIR
Commit f4dbfce79cb2b82fb496fcd2518ecd3315051b7d ("define LIB_SRCDIR
and LIB_BINDIR") significantly reworked the build logic, but in its
introduction of LIB_BINDIR a typo was made.

It was introduced as such:

+LIB_SRCDIR ?= $(dir $(realpath $(lastword $(MAKEFILE_LIST))))
+LIB_BINDIR ?= $(LIBSRC_DIR)

But the definition of LIB_BINDIR has a typo: it should use
$(LIB_SRCDIR) not $(LIBSRC_DIR).

Due to this, $(LIB_BINDIR) is empty, therefore in programs/Makefile,
-L$(LIB_BINDIR) is expanded to just -L, and consequently when trying
to link the "zstd" binary with the libzstd library, it cannot find it:

host/lib/gcc/powerpc64-buildroot-linux-gnu/13.3.0/../../../../powerpc64-buildroot-linux-gnu/bin/ld: cannot find -lzstd: No such file or directory

This commit fixes the build by fixing this typo.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
2024-07-13 13:53:53 +02:00
@RubenKelevra
b320d096a4
clarify when to use '--single-thread' with '--patch-from'
Using '--single-thread' with '--patch-from' on compression levels above 15 will lead to significantly worse compression ratios.

Corrected the man page not suggest anymore to do this.
2024-07-07 19:43:49 +02:00
Yann Collet
ab02fd342f
Merge pull request #4086 from Adenilson/fix01
[zstd][dict] Ensure that dictionary training functions are fully reen…
2024-07-04 00:23:55 -07:00
Joseph Lee
1f72f52bc1
gen_html: Fix build error in windows 2024-07-03 12:26:15 +09:00
Adenilson Cavalcanti
345bcb5ff7 [zstd][dict] Ensure that dictionary training functions are fully reentrant
The two main functions used for dictionary training using the COVER
algorithm require initialization of a COVER_ctx_t where a call
to qsort() is performed.

The issue is that the standard C99 qsort() function doesn't offer
a way to pass an extra parameter for the comparison function callback
(e.g. a pointer to a context) and currently zstd relies on a *global*
static variable to hold a pointer to a context needed to perform
the sort operation.

If a zstd library user invokes either ZDICT_trainFromBuffer_cover or
ZDICT_optimizeTrainFromBuffer_cover from multiple threads, the
global context may be overwritten before/during the call/execution to qsort()
in the initialization of the COVER_ctx_t, thus yielding to crashes
and other bad things (Tm) as reported on issue #4045.

Enters qsort_r(): it was designed to address precisely this situation,
to quote from the documention [1]: "the comparison function does not need to
use global variables to pass through arbitrary arguments, and is therefore
reentrant and safe to use in threads."

It is available with small variations for multiple OSes (GNU, BSD[2],
Windows[3]), and the ISO C11 [4] standard features on annex B-21 qsort_s() as
part of the <stdlib.h>. Let's hope that compilers eventually catch up
with it.

For now, we have to handle the small variations in function parameters
for each platform.

The current fix solves the problem by allowing each executing thread
pass its own COVER_ctx_t instance to qsort_r(), removing the use of
a global pointer and allowing the code to be reentrant.

Unfortunately for *BSD, we cannot leverage qsort_r() given that its API
has changed on newer versions of FreeBSD (14.0) and the other BSD variants
(e.g. NetBSD, OpenBSD) don't implement it.

For such cases we provide a fallback that will work only requiring support
for compilers implementing support for C90.

[1] https://man7.org/linux/man-pages/man3/qsort_r.3.html
[2] https://man.freebsd.org/cgi/man.cgi?query=qsort_r
[3] https://learn.microsoft.com/en-us/cpp/c-runtime-library/reference/qsort-s?view=msvc-170
[4] https://www.open-std.org/jtc1/sc22/wg14/www/docs/n1548.pdf
2024-07-01 23:52:31 -07:00
Yann Collet
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
Yann Collet
4fe0ba0328
Merge pull request #4068 from DimitriPapadopoulos/codespell
Fix new typos found by codespell
2024-06-29 16:04:05 -07:00
elasota
0938308ff6 Throw error if Huffman weight initial states are truncated 2024-06-20 17:46:16 -04:00
Dimitri Papadopoulos
44e83e9180
Fix typos not found by codespell 2024-06-20 20:16:25 +02:00
Dimitri Papadopoulos
2d736d9c50
Fix new typos found by codespell 2024-06-20 20:12:16 +02:00
Yann Collet
17b5315016
Merge pull request #4076 from facebook/fix_macos_build
fix macos build
2024-06-18 22:16:00 -07:00
Yann Collet
80170f6aad fix macos build
weird: after replacing the UNAME line with an identical one,
it does work properly now(??).
Possibly a case of hidden special character?
2024-06-18 20:24:00 -07:00
Elliot Gorokhovsky
3242ac598e
Expose size estimation helpers for Linux (#4064) 2024-06-14 14:38:48 -04:00
Yann Collet
6a77f213c4
Merge pull request #4073 from facebook/cygwin_install
added a cygwin install test to check #4067
2024-06-12 11:58:54 -07:00
Yann Collet
d7a84a683f added cygwin install test 2024-06-12 10:57:15 -07:00
Yann Collet
aa76eeafb7
Merge pull request #4067 from QBos07/filterfix
Fix $filter operants and Msys/Cygwin
2024-06-12 10:55:18 -07:00
Yann Collet
7ddf633a8a
Merge pull request #4065 from embg/freebsd_ci
Drop support for FreeBSD 13.2 CI
2024-06-12 09:54:25 -07:00
Quentin Boswank
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
Yann Collet
2acf90431a minor:doc: specify decompression behavior in presence of multiple concatenated frames
directly at ZSTD_decompress() level.
2024-06-03 18:30:23 -07:00
Elliot Gorokhovsky
be6a182006
Unit test for external sequence producer + static CCtx + streaming (#4063) 2024-06-03 12:42:27 -04:00
Elliot Gorokhovsky
949689facf Drop FreeBSD 13.2 CI 2024-06-03 08:36:07 -07:00
Yann Collet
f70fb7c870
Merge pull request #4046 from josepho0918/iar
Improve support for IAR compiler with attributes and intrinsics
2024-05-29 15:33:19 -07:00
Yann Collet
c5862f7731
Merge pull request #4054 from jbajic/fix-missing-newline
[fix] Add newline when file exceeds 128KB
2024-05-29 15:32:54 -07:00
Federico Maresca
5e9a6c2fe4
Refactor dictionary matchfinder index safety check (#4039) 2024-05-29 12:35:24 -04:00
Jure Bajic
4c6a519fdd [fix] Add newline when file exceeds 128KB 2024-05-26 11:34:24 +02:00
Yann Collet
0e2ceb2d50
Merge pull request #4050 from Adenilson/fix_legacy_nullptr01
[fix] Add check on failed allocation in legacy/zstd_v06
2024-05-21 10:30:45 -07:00
Adenilson Cavalcanti
1872688e0a [fix] Add check on failed allocation in legacy/zstd_v06
As reported by Ben Hawkes in #4026, a failure to allocate a zstd context
would lead to a dereference of a NULL pointer due to a missing check
on the returned result of ZSTDv06_createDCtx().

This patch fix the issue by adding a check for valid returned pointer.
2024-05-17 15:40:28 -07:00
Joseph Chen
5fadd8e6b1 revert FSE_readNCount_body attribute 2024-05-15 10:47:50 +08:00
Joseph Chen
2955d92ac0 Improve support for IAR compiler with attributes and intrinsics 2024-05-14 17:01:19 +08:00
Yann Collet
78955f5f9d
Merge pull request #4040 from facebook/dependabot/github_actions/msys2/setup-msys2-2.23.0
Bump msys2/setup-msys2 from 2.22.0 to 2.23.0
2024-05-13 09:15:07 -07:00
dependabot[bot]
4356192cb2
Bump msys2/setup-msys2 from 2.22.0 to 2.23.0
Bumps [msys2/setup-msys2](https://github.com/msys2/setup-msys2) from 2.22.0 to 2.23.0.
- [Release notes](https://github.com/msys2/setup-msys2/releases)
- [Changelog](https://github.com/msys2/setup-msys2/blob/main/CHANGELOG.md)
- [Commits](cc11e9188b...d0e80f58df)

---
updated-dependencies:
- dependency-name: msys2/setup-msys2
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-05-13 05:18:11 +00:00
Richard Barnes
97291fc502 Increase x-compatibility 2024-04-29 09:19:24 -04:00
Richard Barnes
d7cb47036c Make zstd.h compatible with -Wzero-as-null-pointer-constant 2024-04-29 09:19:24 -04:00
Felix Handte
fe67503f84
Merge pull request #4029 from facebook/dependabot/github_actions/github/codeql-action-3.25.1
Bump github/codeql-action from 3.24.10 to 3.25.1
2024-04-26 08:39:39 -07:00
Yann Collet
f65dde9860
Merge pull request #4031 from facebook/docDStream
update documentation of ZSTD_decompressStream()
2024-04-25 14:11:32 -07:00
Yann Collet
a86f5f3f33 update documentation of ZSTD_decompressStream()
slightly more precise, by recommending to check the return value.
fix #4030
2024-04-23 09:31:35 -07:00
dependabot[bot]
68a6d9b9f6
Bump github/codeql-action from 3.24.10 to 3.25.1
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.24.10 to 3.25.1.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](4355270be1...c7f9125735)

---
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>
2024-04-22 05:20:46 +00:00
Yann Collet
ff7a151f2e update test name 2024-04-21 10:44:50 -07:00
Yann Collet
eb541403c4
Merge pull request #4025 from alexlnkp/dev
Fixed all memory leaks and almost all undefined behaviour
2024-04-21 10:14:33 -07:00
Yann Collet
1232d4c45d
Merge pull request #3931 from bgilbert/pthread
meson: don't add `-pthread` to static linking flags on Windows
2024-04-20 20:25:19 -07:00
Yann Collet
da797d0a43
Merge pull request #4019 from b7f7/fix_cmake_rc_build
fix missing include folder for resource compiler
2024-04-16 16:06:17 -07:00
Yann Collet
fb5a5e46a5
Merge pull request #4020 from Ansuel/install-mt-pc
Provide variant pkg-config file for multi-threaded static lib
2024-04-16 16:04:23 -07:00
Alex Murkoff
849b2ad907 removed freeing of the ptr 2024-04-14 20:44:12 +07:00
Alex Murkoff
0b24fc0a11 init out char array with all members as 0 x2 2024-04-14 17:57:53 +07:00
Alex Murkoff
b4ecf724b1 made initialize out char array with all elements set to 0
fixed where i made it to init with just the first one being set to 0
2024-04-14 17:45:53 +07:00
Alex Murkoff
75d0f66c87 reverted the addition of free at the gz_init() 2024-04-13 12:51:20 +07:00
Alex Murkoff
01cea2e1e2 fixed ISO C incompatibility
for good this time... probably
2024-04-13 02:37:13 +07:00
Alex Murkoff
4f41631aa4 fixed ISO C incompatibility 2024-04-13 02:35:32 +07:00