1
0
mirror of https://github.com/facebook/zstd.git synced 2025-07-17 04:32:26 +02:00
Commit Graph

10235 Commits

Author SHA1 Message Date
bd86e24637 Merge pull request #3513 from DimitriPapadopoulos/codespell
Fix typos found by codespell
2023-02-27 11:44:31 -08:00
e1ab6913ad Merge pull request #3514 from facebook/spec_huffman
Clarify zstd specification for Huffman blocks
2023-02-23 15:35:00 -08:00
395a2c5462 [bug-fix] Fix rare corruption bug affecting the block splitter
The block splitter confuses sequences with literal length == 65536 that use a
repeat offset code. It interprets this as literal length == 0 when deciding the
meaning of the repeat offset, and corrupts the repeat offset history. This is
benign, merely causing suboptimal compression performance, if the confused
history is flushed before the end of the block, e.g. if there are 3 consecutive
non-repeat code sequences after the mistake. It also is only triggered if the
block splitter decided to split the block.

All that to say: This is a rare bug, and requires quite a few conditions to
trigger. However, the good news is that if you have a way to validate that the
decompressed data is correct, e.g. you've enabled zstd's checksum or have a
checksum elsewhere, the original data is very likely recoverable. So if you were
affected by this bug please reach out.

The fix is to remind the block splitter that the literal length is actually 64K.
The test case is a bit tricky to set up, but I've managed to reproduce the issue.

Thanks to @danlark1 for alerting us to the issue and providing us a reproducer!
2023-02-23 10:54:31 -08:00
4b9e3d11a6 When benchmarking two files with fullbench, the second file will not be benchmarked because the benchNb has not been reset to zero. 2023-02-20 16:36:26 +01:00
832f559b0b clarify zstd specification for Huffman blocks
Following detailed comments from @dweiller in #3508.
2023-02-18 18:18:16 -08:00
547794ef40 Fix typos found by codespell 2023-02-18 10:31:48 +01:00
4ebaf36582 Merge pull request #3490 from eli-schwartz/meson-tests-noprograms
meson: always build the zstd binary when tests are enabled
2023-02-16 11:27:27 -08:00
8420502ef9 Don't require CMake 3.18 or later
fix #3500

CMake 3.18 or later was required by #3392. Because it uses
`CheckLinkerFlag`. But requiring CMake 3.18 or later is a bit
aggressive. Because Ubuntu 20.04 LTS still uses CMake 3.16.3:
https://packages.ubuntu.com/search?keywords=cmake

This change disables `-z noexecstack` check with old CMake. This will
not break any existing users. Because users who need `-z noexecstack`
must already use CMake 3.18 or later.
2023-02-16 10:08:45 -08:00
1c42844668 Merge pull request #3479 from felixhandte/faster-file-ops
Use `f`-variants of `chmod()` and `chown()`
2023-02-16 13:07:34 -05:00
3c50854c05 Merge pull request #3511 from felixhandte/fix-release-artifact-upload-permission
Fix Permissions on Publish Release Artifacts Job
2023-02-15 13:35:04 -05:00
345ed63976 Merge pull request #3509 from daniellerozenblit/fix-window-resize-test
Fix cli-tests issues
2023-02-15 13:32:07 -05:00
d54ad3c234 Fix Permissions on Publish Release Artifacts Job
Publishing release artifacts requires the `contents` permission, as documented
by: https://docs.github.com/en/rest/overview/permissions-required-for-github-apps.
2023-02-15 11:05:54 -05:00
d3d0b92e5e add make test for 32bit 2023-02-15 06:03:02 -08:00
7da1c6ddbf fix cli-tests issues 2023-02-14 11:33:26 -08:00
2d8afd9ce1 add manual flag to mmap dictionary 2023-02-14 09:42:23 -08:00
6a86db11a4 CI workflow to test external compressors dependencies
Implemented CI workflow for testing compilation with external compressors and without them. This serves as a sanity check to avoid any code dependencies on libraries that may not always be present. (Reference: #3497 for a bug fix related to this issue.)
2023-02-13 18:00:13 -08:00
727d03161f Make Github workflows permissions read-only by default (#3488)
* Make Github workflows permissions read-only by default

* Pins `skx/github-action-publish-binaries` action to specific hash
2023-02-13 16:57:05 -08:00
886de7bc04 Use correct types in LZMA comp/decomp (#3497)
Bytef and uInt are zlib types, not available when zlib is disabled

Fixes: 1598e6c634 ("Async write for decompression")
Fixes: cc0657f27d ("AsyncIO compression part 2 - added async read and asyncio to compression code (#3022)")
2023-02-13 16:30:56 -08:00
8a189b1b29 refactor dictionary file stat 2023-02-13 15:23:06 -08:00
30cb0a4f25 Merge pull request #3491 from facebook/win_artifacts
Github Action to generate Win64 artifacts
2023-02-13 11:30:47 -08:00
4373c5ab88 mmap dicitonaries for large dictionaries in patch-from 2023-02-13 07:26:22 -08:00
6894746eb1 Bump github/codeql-action from 2.2.1 to 2.2.4 (#3503)
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 2.2.1 to 2.2.4.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](3ebbd71c74...17573ee1cc)

---
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>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-02-13 06:35:31 -05:00
c78f434aa4 Fix zstd-dll build missing dependencies (#3496)
* Fixes zstd-dll build (https://github.com/facebook/zstd/issues/3492):
- Adds pool.o and threading.o dependency to the zstd-dll target
- Moves custom allocation functions into header to avoid needing to add dependency on common.o
- Adds test target for zstd-dll
- Adds github workflow that buildis zstd-dll
2023-02-12 12:32:31 -08:00
a7de1d9f49 Fix all MSVC warnings (#3495)
* fix and test MSVC AVX2 build

* treat msbuild warnings as errors

* fix incorrect MSVC 2019 compiler warning

* fix MSVC error D9035: option 'Gm' has been deprecated and will be removed in a future release
2023-02-11 10:56:59 -05:00
f8ae21680f try a different compiler 2023-02-10 20:49:21 -08:00
5be3f19e1d simplify win64 artifact generation 2023-02-10 16:58:54 -08:00
43bc470fe0 move shell to mingw 2023-02-10 14:27:47 -08:00
f37b291bf5 Github Action to generate Win64 artifacts 2023-02-09 22:48:30 -08:00
97ab0e2ab6 meson: always build the zstd binary when tests are enabled
We need to run it for the tests, even if programs are disabled. So if
they are disabled, create a build rule for the program, but don't
install it. Just make it available for the test itself.
2023-02-10 00:33:07 -05:00
183a18a45c meson: correctly specify the dependency relationship for playtests
It depends on the zstd program being built, and passes it as an env
variable. Just like datagen. But for datagen, we explicitly depend on
it, while for zstd, we assume it's built as part of "all".

This can be wrong in two cases:
- when running individual tests, meson can (re)build just what is needed
  for that one test
- a later patch will handle building zstd but not by default
2023-02-10 00:33:07 -05:00
515266e31b minor nit updates to README.md 2023-02-09 15:51:18 -08:00
95ffc767f6 updated man pages 2023-02-09 14:40:39 -08:00
ff42ed1582 Rename "External Matchfinder" to "Block-Level Sequence Producer" (#3484)
* change "external matchfinder" to "external sequence producer"

* migrate contrib/ to new naming convention

* fix contrib build

* fix error message

* update debug strings

* fix def of invalid sequences in zstd.h

* nit

* update CHANGELOG

* fix .gitignore
2023-02-09 17:01:17 -05:00
db3e1de729 initial commit 2023-02-09 07:47:21 -08:00
cc4e941745 initial commit 2023-02-09 07:40:25 -08:00
610c8b9e33 initial commit 2023-02-09 07:37:37 -08:00
4aa3bc49da updated CHANGELOG in preparation for v1.5.4 release 2023-02-08 16:35:55 -08:00
67fb9d9c77 Merge branch 'dev' of github.com:facebook/zstd into dev 2023-02-08 15:57:12 -08:00
4de9d637e8 minor: fix missing newline character in help page 2023-02-08 15:56:49 -08:00
83f8a05f87 Fix empty-block.zst golden decompression file
This frame is invalid because the `Window_Size = 0`, and the
`Block_Maximum_Size = min(128 KB, Window_Size) = 0`. But the empty
compressed block has a `Block_Content` size of 2, which is invalid.

The fix is to switch to using a `Window_Descriptor` instead of the
`Single_Segment_Flag`. This sets the `Window_Size = 1024`.

Hexdump before this PR: `28b5 2ffd 2000 1500 0000 00`

Hexdump after this PR: `28b5 2ffd 0000 1500 0000 00`

For issue #3482.
2023-02-08 14:11:22 -08:00
488f7c0ff1 Merge pull request #3476 from facebook/fix55714
fix oss-fuzz case 55714
2023-02-07 18:06:22 -08:00
c689310b25 rewrite legacy v0.7 bound checks to be independent of address space overflow 2023-02-07 17:11:07 -08:00
c5bf6b8b88 add requested check for legacy decoder v0.1
which uses a different technique to store literals,
and therefore must check for potential overwrites.
2023-02-07 14:47:16 -08:00
9419747171 fix legacy decoders v0.4, v0.5 and v0.6 2023-02-07 14:02:12 -08:00
67d7a659f8 port fix for v0.3 to v0.6
in case it would applicable for this version
2023-02-07 13:55:30 -08:00
7a1a171658 port fix for v0.3 to v0.5
in case it would be applicable for this version too
2023-02-07 13:55:30 -08:00
b20e4e95f2 copy fix for v0.3 to v0.4
in case it would be applicable for this legacy version too.
2023-02-07 13:55:30 -08:00
7eb4471fec adapt v0.3 fix to v0.1
slightly different constraints on end of buffer conditions
2023-02-07 13:55:30 -08:00
cfec005efd fix for v0.3 blindly ported to v0.2
in case it would be applicable here too.
2023-02-07 13:55:30 -08:00
e04706c58c fix oss-fuzz case 55714
impacts legacy decoder v0.3 in 32-bit mode
2023-02-07 13:55:30 -08:00