Filipe Calasans [Fri, 7 Feb 2020 22:52:25 +0000 (14:52 -0800)]
Implement -m option with legacy format on cli
Yann Collet [Fri, 7 Feb 2020 18:17:33 +0000 (10:17 -0800)]
Merge pull request #842 from filipecalasans/fix-list
Fix lz4cli --list option
Filipe Calasans [Fri, 7 Feb 2020 05:39:54 +0000 (21:39 -0800)]
Fix lz4cli --list option
Yann Collet [Mon, 27 Jan 2020 21:51:06 +0000 (13:51 -0800)]
updated NEWS for v1.9.3
Yann Collet [Mon, 27 Jan 2020 21:45:02 +0000 (13:45 -0800)]
Merge pull request #826 from wolfpld/dev
Force inline small functions used by LZ4_compress_generic.
Bartosz Taudul [Thu, 16 Jan 2020 23:37:47 +0000 (00:37 +0100)]
Force inline small functions used by LZ4_compress_generic.
Yann Collet [Thu, 16 Jan 2020 17:19:02 +0000 (09:19 -0800)]
Merge pull request #825 from NancyLi1013/vcpkg-instructions
Add vcpkg installation instructions
NancyLi1013 [Thu, 16 Jan 2020 08:49:23 +0000 (00:49 -0800)]
Add vcpkg installation instructions
Yann Collet [Fri, 6 Dec 2019 04:32:02 +0000 (20:32 -0800)]
Merge pull request #810 from korli/haiku
bring support for Haiku up to date.
Yann Collet [Wed, 4 Dec 2019 00:37:17 +0000 (16:37 -0800)]
Merge pull request #803 from dkondrad/gh-797
VS2017: Add lz4 project
Yann Collet [Wed, 4 Dec 2019 00:34:11 +0000 (16:34 -0800)]
Merge pull request #817 from lz4/windfast
faster decoding speed with Visual
Yann Collet [Tue, 3 Dec 2019 22:49:22 +0000 (14:49 -0800)]
fixed lz4hc assert error
when src ptr is in very low memory area (< 64K),
the virtual reference to data in dictionary
might end up in a very high memory address.
Since it's not a "real" memory address,
just a virtual one, to calculate distance,
it doesn't matter : only distance matters.
The assert was to restrictive.
Fixed.
Yann Collet [Tue, 3 Dec 2019 00:38:33 +0000 (16:38 -0800)]
faster decoding speed with Visual
by enabling the fast decoder path.
Visual requires a different set of macro constants to detect x86 / x64.
On my laptop, decoding speed on x64 went up from 3.12 to 3.45 GB/s.
32-bit is less impressive, though still favorable,
with speed increasing from 2.55 to 2.60 GB/s.
So both cases are now enabled.
Suggested by Bartosz Taudul (@wolfpld).
Yann Collet [Sat, 30 Nov 2019 16:16:58 +0000 (08:16 -0800)]
Merge pull request #815 from andrewthad/patch-1
Fix typos in streaming_api_basics.md
Andrew Martin [Sat, 30 Nov 2019 11:58:54 +0000 (06:58 -0500)]
Fix typos in streaming_api_basics.md
Jerome Duval [Sun, 8 Sep 2019 11:36:26 +0000 (13:36 +0200)]
bring support for Haiku up to date.
Yann Collet [Wed, 6 Nov 2019 17:36:56 +0000 (09:36 -0800)]
Merge pull request #808 from rkoradi/benchmarkWithDictionary
Make benchmark compatible with dictionary compression
Reto Koradi [Mon, 4 Nov 2019 19:51:41 +0000 (11:51 -0800)]
Make benchmark compatible with dictionary compression
Support the -D command line option for running benchmarks. The
benchmark code was slightly restructured to factor out the calls
that need to be different for each benchmark scenario. Since there
are now 4 scenarios (all combinations of fast/HC and with/without
dictionary), the logic was getting somewhat convoluted otherwise.
This was done by extending the compressionParameters struct that
previously contained just a single function pointer. It now
contains 4 function pointers for init/reset/compress/cleanup,
with the related state. The functions get a pointer to the
structure as their first argument (inspired by C++), so that they
can access the state values in the struct.
David A Kondrad [Fri, 25 Oct 2019 19:04:27 +0000 (15:04 -0400)]
project: VS2017: add lz4 project
Add missing lz4 project to the VS2017 solution.
The project was made from scratch rather than importing and updated to
match the VS2010 options.
Any new options not present in the old VS2010 project we pulled from
other console binaries in the solution.
Signed-off-by: David A Kondrad <dkondrad.mscs+patches@gmail.com>
David A Kondrad [Fri, 25 Oct 2019 18:51:36 +0000 (14:51 -0400)]
project: visual: fix VS2010/17 gitignore
The `lz4` project was excluded from being checked in for VS2017.
Add some fixups to explicitly allow this project directory.
Also add an exclusion for VS2017 binaries and VS `ipch` directories.
Signed-off-by: David A Kondrad <dkondrad.mscs+patches@gmail.com>
Yann Collet [Mon, 7 Oct 2019 16:51:15 +0000 (09:51 -0700)]
Merge pull request #798 from bimbashrestha/adding_cirrus_test
Adding cirrus test for FreeBSD
Bimba Shrestha [Mon, 7 Oct 2019 15:12:42 +0000 (08:12 -0700)]
Adding unamestr var
Bimba Shrestha [Fri, 4 Oct 2019 17:12:22 +0000 (10:12 -0700)]
Adding condition for FreeBSD and using gmake
Bimba Shrestha [Fri, 4 Oct 2019 16:29:58 +0000 (09:29 -0700)]
Using instead of gmake (to address the travis failure)
Bimba Shrestha [Fri, 4 Oct 2019 15:40:46 +0000 (08:40 -0700)]
Using gmake instead of make
Bimba Shrestha [Fri, 4 Oct 2019 15:36:08 +0000 (08:36 -0700)]
Adding cirrus config file for freebsd-12-0
Yann Collet [Thu, 26 Sep 2019 20:01:55 +0000 (13:01 -0700)]
Merge pull request #796 from jcaesar/dev
meson: move one layer deeper to allow easy construction of a wrap file
Julius Michaelis [Thu, 26 Sep 2019 08:23:53 +0000 (17:23 +0900)]
meson: move one layer deeper to allow easy construction of a wrap file
Yann Collet [Mon, 23 Sep 2019 19:50:05 +0000 (12:50 -0700)]
Merge pull request #794 from bimbashrestha/compress_frame_fuzzer_heap_overflow
Using size instead of LZ4_compressBound(size) <- causes heap overflow
Bimba Shrestha [Mon, 23 Sep 2019 18:54:56 +0000 (11:54 -0700)]
Using size instead of LZ4_compressBound(size) <- causes heap overflow
Yann Collet [Sat, 21 Sep 2019 16:55:59 +0000 (09:55 -0700)]
Merge pull request #793 from nigeltao/dev
Have read_variable_length use fixed size types
Nigel Tao [Sun, 15 Sep 2019 23:20:02 +0000 (09:20 +1000)]
Have read_variable_length use fixed size types
Otherwise, the output from decoding LZ4-compressed input could be
platform dependent.
Also add a compile-time check to confirm the existing code's assumptions
that, if <stdint.h> isn't used, then sizeof(int) == 4.
Updates #792
Yann Collet [Wed, 18 Sep 2019 17:21:43 +0000 (10:21 -0700)]
Merge pull request #790 from bimbashrestha/seperating_seed_generation_and_use_in_fuzzers
Separating the seed generation and use in FUZZ_dataProducer api
Bimba Shrestha [Sat, 14 Sep 2019 01:08:58 +0000 (18:08 -0700)]
Retreiving 32 bits from the end for fuzzer
Bimba Shrestha [Fri, 13 Sep 2019 23:04:48 +0000 (16:04 -0700)]
Addressing naming nits and moving size modification up in all fuzzers
Bimba Shrestha [Fri, 13 Sep 2019 21:07:52 +0000 (14:07 -0700)]
Seperating the seed generation and use
Yann Collet [Tue, 10 Sep 2019 19:56:53 +0000 (12:56 -0700)]
Merge pull request #770 from neheb/dev
util.h: Remove deprecated utime for non-Windows
Rosen Penev [Wed, 31 Jul 2019 05:13:51 +0000 (22:13 -0700)]
util.h: Remove deprecated utime for non-Windows
utime was deprecated in POSIX 2008.
Yann Collet [Mon, 9 Sep 2019 19:03:26 +0000 (12:03 -0700)]
Merge pull request #785 from bimbashrestha/transfer_remaining_fuzzers_to_consume_from_end_of_input
Making fuzzers use dataProducer api instead of random seed for decisions
Bimba Shrestha [Fri, 30 Aug 2019 17:27:42 +0000 (10:27 -0700)]
Making fuzzers use dataProducer api instead of random seed for decisions
Yann Collet [Wed, 21 Aug 2019 11:44:24 +0000 (13:44 +0200)]
fixed #778
fixed assert() when divisor == 0
Yann Collet [Tue, 20 Aug 2019 23:48:44 +0000 (16:48 -0700)]
Merge pull request #779 from bimbashrestha/dev
Adding fuzz data producer for uint32 and using in decompress_fuzzer
bimbashrestha [Sat, 17 Aug 2019 00:14:47 +0000 (17:14 -0700)]
Adding comments, fixing nit, and hiding the struct in data producer api
bimbashrestha [Fri, 16 Aug 2019 23:43:28 +0000 (16:43 -0700)]
Seperating fuzz data producer api impl and header, using data producer on the easy fuzzers
bimbashrestha [Fri, 16 Aug 2019 21:19:06 +0000 (14:19 -0700)]
Created a data producer API and used in decompress_fuzzer
bimbashrestha [Fri, 16 Aug 2019 17:50:46 +0000 (10:50 -0700)]
Adding fuzz data producer for uint32 and using in decompress_fuzzer
Summary: Consuming bytes from the end of data instead of from the front to prevent "all-in-one" decisions.
Test Plan:
Reviewers:
Subscribers:
Tasks:
Tags:
Yann Collet [Thu, 15 Aug 2019 11:59:59 +0000 (13:59 +0200)]
fixed test error
could trigger %0 on exceptional circumstances
due to wrong buffer size parameter.
Yann Collet [Sat, 10 Aug 2019 00:08:03 +0000 (02:08 +0200)]
Merge pull request #777 from terrelln/off-by-one
[LZ4_compress_destSize] Fix off-by-one error
Nick Terrell [Fri, 9 Aug 2019 17:32:26 +0000 (10:32 -0700)]
[LZ4_compress_destSize] Fix off-by-one error
PR#756 fixed the data corruption bug, but didn't clear `ip`. PR#760
fixed that off-by-one error, but missed the case where `ip == filledIp`,
which is harder for the fuzzers to find (it took 20 days not 1 day).
Verified this fixed the issue reported by OSS-Fuzz.
Credit to OSS-Fuzz.
Yann Collet [Wed, 7 Aug 2019 23:48:53 +0000 (01:48 +0200)]
Merge pull request #773 from felixhandte/attach-empty-dict-behavior-conformance
Make Attaching an Empty Dict Behave the Same as Using it Directly
W. Felix Handte [Tue, 6 Aug 2019 23:08:41 +0000 (19:08 -0400)]
Only Bump Offset When Attaching Non-Null Dictionary
We do want to bump, even if the dictionary is empty, but we **don't** want to
bump if the dictionary is null.
W. Felix Handte [Tue, 6 Aug 2019 22:54:03 +0000 (18:54 -0400)]
Add Attach Dict Debug Log
W. Felix Handte [Tue, 6 Aug 2019 19:24:51 +0000 (15:24 -0400)]
Make Attaching an Empty Dict Behave the Same as Using it Directly
When using an empty dictionary, we bail out of loading or attaching it in
ways that leave the working context in potentially slightly different states.
In particular, in some paths, we will cause the currentOffset to be non-zero,
while in others we would allow it to remain 0.
This difference in behavior is perfectly harmless, but in some situations, it
can produce slight differences in the compressed output. For sanity's sake,
we currently try to maintain a strict correspondence between the behavior of
the dict attachment and the dict loading paths. This patch restores them to
behaving identically.
This shouldn't have any negative side-effects, as far as I can tell. When
writing the dict attachment code, I tried to preserve zeroed currentOffsets
when possible, since they benchmarked as very slightly faster. However, the
case of attaching an empty dictionary is probably rare enought that it's
acceptable to minisculely degrade performance in that corner case.
Yann Collet [Tue, 6 Aug 2019 17:17:16 +0000 (19:17 +0200)]
Merge pull request #772 from lz4/offset0
silence msan warning when offset==0
Yann Collet [Tue, 6 Aug 2019 12:46:31 +0000 (14:46 +0200)]
silence msan warning when offset==0
Yann Collet [Thu, 1 Aug 2019 23:27:53 +0000 (01:27 +0200)]
Merge pull request #771 from terrelln/rep-ext-fix
[lz4hc] Further improve pattern detection and chain swapping
Nick Terrell [Wed, 31 Jul 2019 07:57:16 +0000 (00:57 -0700)]
[lz4hc] Chain swap with acceleration
Nick Terrell [Wed, 31 Jul 2019 06:40:58 +0000 (23:40 -0700)]
[lz4hc] Only allow chain swapping forwards
When the match is very long and found quickly, we can do
matchLength * nbCompares iterations through the chain
swapping, which can really slow down compression.
Nick Terrell [Wed, 31 Jul 2019 06:39:39 +0000 (23:39 -0700)]
[lz4hc] Fix pattern detection end of dictionary
The pattern detection in extDict mode could put `matchIndex`
within the last 3 bytes of the dictionary. This would cause
a read out of bounds.
Nick Terrell [Tue, 30 Jul 2019 22:21:52 +0000 (15:21 -0700)]
[lz4hc] Fix minor pessimization in extDict pattern matching
We should be comparing `matchPtr` not `ip`. This bug just means
that this branch was not taken, so we might miss some of the
forward length.
Nick Terrell [Tue, 30 Jul 2019 22:16:35 +0000 (15:16 -0700)]
[lz4hc] Improve pattern detection in ext dict
It is important to continue to look backwards if the current pattern
reaches `lowPrefixPtr`. If the pattern detection doesn't go all the
way to the beginning of the pattern, or the end of the pattern it
slows down the search instead of speeding it up.
The slow unit in `round_trip_stream_fuzzer` used to take 12 seconds
to run with -O3, now it takes 0.2 seconds.
Credit to OSS-Fuzz
Yann Collet [Wed, 24 Jul 2019 20:47:19 +0000 (13:47 -0700)]
Merge pull request #768 from terrelln/rep-ext
[LZ4HC] Speed up pattern compression with external dictionary
Nick Terrell [Wed, 24 Jul 2019 00:54:09 +0000 (17:54 -0700)]
[LZ4HC] Speed up pattern compression with external dictionary
Fixes #761.
Yann Collet [Tue, 23 Jul 2019 08:00:53 +0000 (01:00 -0700)]
Merge pull request #766 from Low-power/cli-option---best
Add option '--best' to lz4(1)
WHR [Tue, 23 Jul 2019 05:37:11 +0000 (13:37 +0800)]
lz4cli: add option '--best' as an alias of '-12'
Yann Collet [Fri, 19 Jul 2019 23:54:01 +0000 (16:54 -0700)]
Merge pull request #763 from terrelln/unused
[lz4frame] Fix unused variable warnings in fuzzing mode
Yann Collet [Fri, 19 Jul 2019 22:22:51 +0000 (15:22 -0700)]
Merge pull request #760 from terrelln/destSize
[LZ4_compress_destSize] Fix off-by-one error in fix
Nick Terrell [Fri, 19 Jul 2019 21:44:06 +0000 (14:44 -0700)]
[lz4frame] Fix unused variable warnings in fuzzing mode
Yann Collet [Fri, 19 Jul 2019 16:11:12 +0000 (09:11 -0700)]
Merge pull request #758 from dooxe/develop
Added `BUNDLE DESTINATION`
Yann Collet [Fri, 19 Jul 2019 04:53:33 +0000 (21:53 -0700)]
Merge pull request #762 from terrelln/frame-fuzz
[fuzz] Add LZ4 frame fuzzers
Nick Terrell [Fri, 19 Jul 2019 01:49:40 +0000 (18:49 -0700)]
[fuzz] Add LZ4 frame fuzzers
* Round trip fuzzer
* Compress fuzzer
* Decompress fuzzer
Nick Terrell [Fri, 19 Jul 2019 01:45:32 +0000 (18:45 -0700)]
[lz4frame] Skip magic and checksums in fuzzing mode
When `FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION` is defined we skip
magic and checksum checks. This makes it easier to fuzz decompression.
Nick Terrell [Thu, 18 Jul 2019 02:40:04 +0000 (19:40 -0700)]
Fix LZ4_attach_dictionary with empty dictionary
Nick Terrell [Thu, 18 Jul 2019 01:31:44 +0000 (18:31 -0700)]
[fuzz] Add HC fuzzers for round trip, compress, and streaming
Nick Terrell [Thu, 18 Jul 2019 00:41:41 +0000 (17:41 -0700)]
[fuzzer] Update scripts for new fuzzers
Nick Terrell [Thu, 18 Jul 2019 00:33:31 +0000 (17:33 -0700)]
[fuzz] Add a streaming round trip fuzzer
Nick Terrell [Thu, 18 Jul 2019 19:20:29 +0000 (12:20 -0700)]
[LZ4_compress_destSize] Fix off-by-one error in fix
The next match is looking at the current ip, not the next ip,
so it needs to be cleared as well.
Credit to OSS-Fuzz
W. Felix Handte [Thu, 18 Jul 2019 17:35:12 +0000 (13:35 -0400)]
Unconditionally Clear `dictCtx`
W. Felix Handte [Thu, 18 Jul 2019 16:41:12 +0000 (12:41 -0400)]
Fix Data Corruption Bug when Streaming with an Attached Dict in HC Mode
This diff fixes an issue in which we failed to clear the `dictCtx` in HC
compression. The `dictCtx` is not supposed to be used when an `extDict` is
present: matches found in the `dictCtx` do not account for the presence of an
`extDict` segment, and their offsets are therefore miscalculated when one is
present. This can lead to data corruption.
This diff clears the `dictCtx` whenever setting an `extDict`.
This issue was uncovered by @terrelln's fuzzing work.
dooxe [Thu, 18 Jul 2019 09:25:43 +0000 (11:25 +0200)]
Added BUNDLE DESTINATION in CMakeLists.txt so that it works with newer versions of cmake
Yann Collet [Wed, 17 Jul 2019 20:25:41 +0000 (13:25 -0700)]
Merge pull request #756 from terrelln/destSize
[LZ4_compress_destSize + multi-blocks streaming] Fix rare data corruption bug
Nick Terrell [Wed, 17 Jul 2019 18:50:47 +0000 (11:50 -0700)]
[LZ4_compress_destSize] Fix overflow condition
Nick Terrell [Wed, 17 Jul 2019 18:28:38 +0000 (11:28 -0700)]
[LZ4_compress_destSize] Fix rare data corruption bug
Nick Terrell [Wed, 17 Jul 2019 18:07:24 +0000 (11:07 -0700)]
[LZ4_compress_destSize] Allow 2 more bytes of match length
Yann Collet [Tue, 16 Jul 2019 18:18:09 +0000 (11:18 -0700)]
Merge pull request #752 from terrelln/fuzzers
[ossfuzz] Improve the fuzzers
Yann Collet [Mon, 15 Jul 2019 23:38:28 +0000 (16:38 -0700)]
Merge pull request #755 from lz4/custom_distance
ensure conformance with custom LZ4_DISTANCE_MAX
Nick Terrell [Sat, 13 Jul 2019 02:27:00 +0000 (19:27 -0700)]
[ossfuzz] Improve the fuzzers
* Run more decompression variants
* Round trip the compression fuzzer and do partial decompression as well
* Add a compression fuzzer that compresses into a smaller output buffer
and test the destSize variant
These fuzzers caught 2 bugs that were fixed in the previous commit.
* Input buffer over-read in partial decompress
* Partial decompress fails if output size is 0
Nick Terrell [Sat, 13 Jul 2019 01:36:28 +0000 (18:36 -0700)]
[lz4] Fix bugs in partial decoding
* Partial decoding could read a few bytes beyond the end of the input
* Partial decoding returned an error with an empty output buffer
Yann Collet [Mon, 15 Jul 2019 19:11:34 +0000 (12:11 -0700)]
ensure conformance with custom LZ4_DISTANCE_MAX
It's now possible to select a custom LZ4_DISTANCE_MAX at compile time,
provided it's <= 65535.
However, in some cases (when compressing in byU16 mode),
the new distance wasn't respected,
as it used to implied that it was necessarily within range.
Added a distance check for this case.
Also : added a new TravisCI test which ensures that
custom LZ4_DISTANCE_MAX compiles correctly
and compresses correctly (relying on `assert()` to find outsized offsets).
Yann Collet [Mon, 15 Jul 2019 16:08:11 +0000 (09:08 -0700)]
Merge pull request #753 from Hitatm/fix_LZ4_DISTANCE_MAX
bugfix: correctly control the offset < LZ4_DISTANCE_MAX,when change t…
Hitatm [Mon, 15 Jul 2019 14:53:46 +0000 (22:53 +0800)]
bugfix: correctly control the offset < LZ4_DISTANCE_MAX,when change the value of LZ4_DISTANCE_MAX,
Yann Collet [Fri, 12 Jul 2019 00:29:16 +0000 (17:29 -0700)]
keep the "lorem ipsum" topic of the example string
but make it compressible
Yann Collet [Fri, 12 Jul 2019 00:26:15 +0000 (17:26 -0700)]
Merge pull request #751 from hamidzr/simple-buffer-example-input
simple buffer example minor input update. fixes #750
Hamid Zare [Thu, 11 Jul 2019 21:39:29 +0000 (14:39 -0700)]
print the compression ratio
Hamid Zare [Thu, 11 Jul 2019 21:34:52 +0000 (14:34 -0700)]
changed the input text to something more compression friendly
Yann Collet [Thu, 4 Jul 2019 20:03:08 +0000 (13:03 -0700)]
Merge pull request #749 from sylvestre/patch-1
Remove an useless declaration
Sylvestre Ledru [Thu, 4 Jul 2019 16:13:36 +0000 (18:13 +0200)]
Remove an useless declaration
Yann Collet [Wed, 3 Jul 2019 23:16:52 +0000 (16:16 -0700)]
Merge pull request #746 from lz4/circleci
CircleCI : reduced test duration
Yann Collet [Wed, 3 Jul 2019 23:16:19 +0000 (16:16 -0700)]
Merge pull request #743 from lz4/fuzzasan_fixed
updated frametest
Yann Collet [Wed, 3 Jul 2019 23:13:44 +0000 (16:13 -0700)]
Merge pull request #748 from amchoukir/amchoukir-doublebuffer-doc
Update blockStreaming_doubleBuffer.md