Commit Graph

7799 Commits (8f8bd2d1ac555ac7b6f6bcfd67ba0a426f5a8309)

Author SHA1 Message Date
Nick Terrell 2f31050a3f
Merge pull request #1965 from terrelln/android-fix
Fix timefn on android
2020-01-22 15:42:50 -08:00
Nick Terrell 7ec87cfb28 Update comment in timefn 2020-01-22 11:17:30 -08:00
Nick Terrell 768adc0774 Fix timefn on android 2020-01-21 18:57:16 -08:00
Felix Handte 3a9a079ed1
Merge pull request #1956 from PhoebeHui/dev
Add vcpkg installation instructions
2020-01-21 11:54:00 -05:00
PhoebeHui 7738709020 Update comments 2020-01-19 23:51:40 -08:00
Nick Terrell db9c8af600
Merge pull request #1957 from terrelln/fix-ultra
Fix lowLimit underflow in overflow correction
2020-01-17 18:01:35 -08:00
Nick Terrell 76e01f3555
Merge pull request #1958 from terrelln/docs
Add --single-thread to zstd --help
2020-01-17 14:46:00 -08:00
Nick Terrell 009f388457 Fix playTests.sh for 32-bit mode 2020-01-17 14:20:44 -08:00
Nick Terrell fa48af545f Add --single-thread to zstd --help 2020-01-17 13:54:49 -08:00
Nick Terrell a11a9271d6 Fix lowLimit underflow in overflow correction 2020-01-17 12:10:18 -08:00
PhoebeHui 3e8222be58 Add vcpkg installation instructions 2020-01-17 03:31:08 -08:00
Nick Terrell 957d59c721
Merge pull request #1950 from terrelln/ctest
[cmake] Add playTests.sh as a test
2020-01-13 16:16:25 -08:00
Nick Terrell f6d00c059f [util] Fix readLineFromFile on Cygwin 2020-01-13 14:37:22 -08:00
Nick Terrell 3ed0f65158 [cmake] Add playTests.sh as a test 2020-01-13 14:16:15 -08:00
Nick Terrell f27b4b4ec5
Merge pull request #1948 from lazka/cygwin-fix-c99-build
Fix the c99/cmake build under Cygwin/MSYS2
2020-01-13 11:35:28 -08:00
Christoph Reiter 9a5d8a6cb4 appveyor: build with CMake under Cygwin 2020-01-11 11:37:22 +01:00
Nick Terrell 036b30b555
Fix super block compression and stream raw blocks in decompression (#1947)
Super blocks must never violate the zstd block bound of input_size + ZSTD_blockHeaderSize. The individual sub-blocks may, but not the super block. If the superblock violates the block bound we are liable to violate ZSTD_compressBound(), which we must not do. Whenever the super block violates the block bound we instead emit an uncompressed block.

This means we increase the latency because of the single uncompressed block. I fix this by enabling streaming an uncompressed block, so the latency of an uncompressed block is 1 byte. This doesn't reduce the latency of the buffer-less API, but I don't think we really care.

* I added a test case that verifies that the decompression has 1 byte latency.
* I rely on existing zstreamtest / fuzzer / libfuzzer regression tests for correctness. During development I had several correctness bugs, and they easily caught them.
* The added assert that the superblock doesn't violate the block bound will help us discover any missed conditions (though I think I got them all).

Credit to OSS-Fuzz.
2020-01-10 18:02:11 -08:00
Christoph Reiter ddd4c39736 Fix the c99/cmake build under Cygwin/MSYS2
When building zst under cygwin or msys2 with std=c99 the build would fail because
of an undefined fileno()/_fileno(), which is used by the IS_CONSOLE() macro.

When building with -std=c99 (gcc otherwise defaults to gnu, which implies POSIX),
which is the default of the cmake build, then including unistd.h wont define
_POSIX_VERSION and all other headers also wont expose POSIX API.

To fix this make sure to define _POSIX_C_SOURCE with the version we want before including
unistd.h and so that _POSIX_VERSION is set to the version provided by the system.

Since Cygwin/MSYS2 just follow POSIX we can also remove their special cases for
defining IS_CONSOLE().

And, for completeness, also explicitly include stdio.h which is what actually declares fileno().

Tested with the normal make file and cmake under MSYS2 and Cygwin.
2020-01-11 01:39:10 +01:00
Bimba Shrestha f25a6e9f8f Adding new cli endpoint --patch-from= (#1940)
* Adding new cli endpoint --diff-from=

* Appveyor conversion nit

* Using bool set trick instead of direct set

* Removing --diff-from and only leaving --diff-from=#

* Throwing error when both dictFileName vars are set

* Clean up syntax

* Renaming diff-from to patch-from

* Revering comma separated syntax clean up

* Updating playtests with patch-from

* Uncommenting accidentally commented

* Updating remaining docs and var names to be patch-from instead of diff-from

* Constifying

* Using existing log2 function and removing newly created one

* Argument order (moving prefs to end)

* Using comma separated syntax

* Moving to outside #ifndef
2020-01-10 14:25:24 -08:00
Nick Terrell d1cc9d2797
[fuzz] Allow zero sized buffers for streaming fuzzers (#1945)
* Allow zero sized buffers in `stream_decompress`. Ensure that we never have two
  zero sized buffers in a row so we guarantee forwards progress.
* Make case 4 in `stream_round_trip` do a zero sized buffers call followed by
  a full call to guarantee forwards progress.
* Fix `limitCopy()` in legacy decoders.
* Fix memcpy in `zstdmt_compress.c`.

Catches the bug fixed in PR #1939
2020-01-09 11:38:50 -08:00
Igor Sugak 03ffda7b88 fix UBSAN's invalid-null-argument error in zstd_decompress.c (#1939) 2020-01-08 16:17:42 -08:00
Nick Terrell b77ad810c9
[fuzz] Fix regression_driver.c with directory input (#1944)
The `numFiles` variable wasn't updated, so the fuzzer didn't do anything.
I did two things to fix this:

1. Remove the `numFiles` variable entirely.
2. Error if we can't open a file and print the number of files tested.
2020-01-08 13:20:56 -08:00
Christoph Reiter d0dcaf56c2 Make UTIL_countPhysicalCores() work under Cygwin (#1941)
Cygwin currently uses the fallback implementation which just returns 1 every time,
which leads to bad performance when zstd is called with -T0 for example.

Instead use the POSIX implementation used for the BSDs which works just fine under Cygwin.

Tested under Cygwin and MSYS2.
2020-01-07 15:48:26 -08:00
Yann Collet 3119256267 updated CHANGELOG
one missing item in v1.4.4
2020-01-07 09:51:22 -08:00
Bimba Shrestha eb76f786bc [bench] Automated benchmarking script (#1906)
* Initial revised automated benchmarking script

* Updating nb_iterations and making loop infinite

* Allowing benchmarking params to be changed from cli

* Renaming old speed test

* Removing numpy dependency for cli

* Change filename and benchmakr on pr level

* Moving build outside loop and adding iterations param

* Moving benchmarking to seperate travis ci test

* Fixing typo and using unused variable

* Added mode labels and updated README accordingly

* Adding new mode 'current' that compraes facebook:dev against current hash

* Typo

* Reverting previous accidental diff

* Typo

* Adding frequency config variable to prevent github from blacklisting

* Added new argument for frequency of fetching new prs

* Updating documentation
2020-01-06 14:19:11 -08:00
Bimba Shrestha b1f53b1a10 [fuzz] Dividing by targetCBlockSize instead of blockSize for nbBlocks fit (#1936)
* Adding fail logging for superblock flow

* Dividing by targetCBlockSize instead of blockSize

* Adding new const and using more acurate formula for nbBlocks

* Only do dstCapacity check if using superblock

* Remvoing disabling logic

* Updating test to make it catch more extreme case of previou bug

* Also updating comment

* Only taking compressEnd shortcut on non-superblock
2020-01-03 16:53:51 -08:00
Bimba Shrestha ef1684f29a [doc] Adding -M# decompression operation modifier documentation (#1938)
* Adding -M# operation modifier documentation

* Adding long name, typo and update desc
2020-01-03 16:36:47 -08:00
Felix Handte 68160372be
Merge pull request #1920 from felixhandte/fix-mtim-again
Use statbuf->st_mtim Again
2020-01-03 16:07:16 -05:00
Felix Handte 6f4341c432 Fix playTests.sh Under QEMU (#1923) 2019-12-26 11:16:23 -08:00
W. Felix Handte e2a99db2dd Also Define _ATFILE_SOURCE 2019-12-23 13:24:28 -05:00
W. Felix Handte 5666835ea7 Add Comment 2019-12-23 13:24:28 -05:00
W. Felix Handte 5af8cb7aea Use statbuf->st_mtim Again 2019-12-23 13:24:28 -05:00
W. Felix Handte 976c055a9a Add Travis Test that Builds ARM on Trusty 2019-12-23 13:24:28 -05:00
W. Felix Handte 5f46894184 Fix playTests.sh Under QEMU 2019-12-23 13:24:28 -05:00
Yann Collet 1c9ac4ccf4
Merge pull request #1928 from bimbashrestha/bimba-oss
[fuzz] Adding bool to check if there is enough room to emit noCompress Superblocks
2019-12-19 12:58:24 -08:00
Felix Handte 07ad866754
Merge pull request #1932 from felixhandte/diagnose-corruption-dicts
Add Support for Dictionaries in Corruption Diagnosis Tool
2019-12-19 12:08:28 -05:00
W. Felix Handte fe454c0a76 Add Support for Dictionaries 2019-12-18 11:54:39 -08:00
Yann Collet 4ae0f681b6
Merge pull request #1929 from facebook/travisTest
added ppc64le tests on travis
2019-12-18 11:49:26 -08:00
W. Felix Handte 18f03516b3 Print Summary of Errors Encountered 2019-12-18 11:29:53 -08:00
Bimba Shrestha 56415efc76 Constifying, malloc check and naming nit 2019-12-17 17:16:51 -08:00
W. Felix Handte 4584c88a99 Don't Rely on Implicit Return in Main 2019-12-17 11:26:18 -08:00
Yann Collet 3746693b71 added ppc64le tests on travis
on real hardware
2019-12-15 01:30:12 -08:00
Bimba Shrestha 989ce13e19 One more type conversion 2019-12-13 16:50:21 -08:00
Bimba Shrestha 4399eed42e Adding explict cast to satisfy appveyor ci 2019-12-13 16:38:11 -08:00
Bimba Shrestha db5124ef6e More void* issues. Just replacing with BYTE* 2019-12-13 16:24:49 -08:00
Bimba Shrestha 49b2bf7106 'void* size issue' fix 2019-12-13 16:06:57 -08:00
Bimba Shrestha 5225dcfc0f Adding bool to check if enough room left for noCompress superblocks 2019-12-13 15:47:28 -08:00
Bimba Shrestha e3cd2785e2 Add test to catch too many noCompress superblocks on streaming 2019-12-13 15:31:29 -08:00
Yann Collet d73e2fb465
Merge pull request #1891 from bimbashrestha/oss
[fuzz] Superblock fuzz issues
2019-12-10 13:17:00 -08:00
Yann Collet e839b31dc4
Merge pull request #1924 from ned14/dev
Make idiomatic cmake install so third party cmake installers work right.
2019-12-10 13:16:45 -08:00