Skip to content
This repository was archived by the owner on Feb 5, 2025. It is now read-only.

Commit d3972cf

Browse files
authored
Merge pull request lz4#954 from lz4/dev
v1.9.3
2 parents 3d67671 + 0760724 commit d3972cf

File tree

94 files changed

+2917
-1377
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

94 files changed

+2917
-1377
lines changed

.cirrus.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
freebsd_instance:
2+
image_family: freebsd-12-1
3+
4+
task:
5+
script: pkg install -y gmake && gmake test

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
---
2+
name: Bug report
3+
about: Create a report to help us improve
4+
title: ''
5+
labels: ''
6+
assignees: ''
7+
8+
---
9+
10+
**Describe the bug**
11+
A clear and concise description of what the bug is.
12+
13+
**Expected behavior**
14+
Please describe what you expected to happen.
15+
16+
**To Reproduce**
17+
Steps to reproduce the behavior:
18+
1. Go to '...'
19+
2. Click on '....'
20+
3. Scroll down to '....'
21+
4. See error '...'
22+
If applicable, add screenshots to help explain your problem.
23+
24+
**System (please complete the following information):**
25+
- OS: [e.g. Mac]
26+
- Version [e.g. 22]
27+
- Compiler [e.g. gcc]
28+
- Build System [e.g. Makefile]
29+
- Other hardware specs [e.g Core 2 duo...]
30+
31+
**Additional context**
32+
Add any other context about the problem here.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
name: Feature request
3+
about: Suggest an idea for this project
4+
title: ''
5+
labels: ''
6+
assignees: ''
7+
8+
---
9+
10+
**Is your feature request related to a problem? Please describe.**
11+
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
12+
13+
**Describe the solution you'd like**
14+
A clear and concise description of what you want to happen.
15+
16+
**Describe alternatives you've considered**
17+
A clear and concise description of any alternative solutions or features you've considered.
18+
19+
**Additional context**
20+
Add any other context or screenshots about the feature request here.

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ _codelite_lz4/
2626
bin/
2727
*.zip
2828

29+
# analyzers
30+
infer-out
31+
2932
# Mac
3033
.DS_Store
3134
*.dSYM

.travis.yml

Lines changed: 25 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,7 @@ matrix:
1010
script:
1111
- make # test library build
1212
- make clean
13-
- make -C tests test-lz4 MOREFLAGS='-Werror -Wconversion -Wno-sign-conversion' | tee # test scenario where `stdout` is not the console
14-
- make clean
15-
- CFLAGS=-m32 make -C tests test-lz4-contentSize
13+
- make test MOREFLAGS='-Werror -Wconversion -Wno-sign-conversion' | tee # test scenario where `stdout` is not the console
1614

1715
# Container-based 12.04 LTS Server Edition 64 bit (doesn't support 32-bit includes)
1816
- name: (Precise) benchmark test
@@ -33,9 +31,15 @@ matrix:
3331
script:
3432
- CC=clang MOREFLAGS=-fsanitize=address make -C tests test-frametest test-fuzzer
3533

36-
- name: Custom LZ4_DISTANCE_MAX
34+
- name: Custom LZ4_DISTANCE_MAX ; lz4-wlib (CLI linked to dynamic library); LZ4_USER_MEMORY_FUNCTIONS
3735
script:
3836
- MOREFLAGS=-DLZ4_DISTANCE_MAX=8000 make check
37+
- make clean
38+
- make -C programs lz4-wlib
39+
- make clean
40+
- make -C tests fullbench-wmalloc # test LZ4_USER_MEMORY_FUNCTIONS
41+
- make clean
42+
- CC="c++ -Wno-deprecated" make -C tests fullbench-wmalloc # stricter function signature check
3943

4044
- name: (Precise) g++ and clang CMake test
4145
dist: precise
@@ -47,18 +51,15 @@ matrix:
4751
- make clean travis-install
4852
- make clean clangtest
4953

50-
51-
# 14.04 LTS Server Edition 64 bit
52-
- name: (Trusty) i386 gcc test
53-
dist: trusty
54+
- name: x32 compatibility test
5455
addons:
5556
apt:
5657
packages:
57-
- libc6-dev-i386
5858
- gcc-multilib
5959
script:
6060
- make -C tests test MOREFLAGS=-mx32
6161

62+
# 14.04 LTS Server Edition 64 bit
6263
# presume clang >= v3.9.0
6364
- name: (Trusty) USan test
6465
dist: trusty
@@ -122,6 +123,21 @@ matrix:
122123
- make platformTest CC=arm-linux-gnueabi-gcc QEMU_SYS=qemu-arm-static
123124
- make platformTest CC=aarch64-linux-gnu-gcc QEMU_SYS=qemu-aarch64-static
124125

126+
- name: aarch64 real-hw tests
127+
arch: arm64
128+
script:
129+
- make test
130+
131+
- name: PPC64LE real-hw tests
132+
arch: ppc64le
133+
script:
134+
- make test
135+
136+
- name: IBM s390x real-hw tests
137+
arch: s390x
138+
script:
139+
- make test
140+
125141
- name: (Xenial) gcc-5 compilation
126142
dist: xenial
127143
install:

Makefile

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ travis-install:
9898
$(MAKE) -j1 install DESTDIR=~/install_test_dir
9999

100100
cmake:
101-
@cd contrib/cmake_unofficial; cmake $(CMAKE_PARAMS) CMakeLists.txt; $(MAKE)
101+
@cd build/cmake; cmake $(CMAKE_PARAMS) CMakeLists.txt; $(MAKE)
102102

103103
endif
104104

@@ -124,8 +124,8 @@ check:
124124

125125
.PHONY: test
126126
test:
127-
$(MAKE) -C $(TESTDIR) $@
128-
$(MAKE) -C $(EXDIR) $@
127+
CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" $(MAKE) -C $(TESTDIR) $@
128+
CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" $(MAKE) -C $(EXDIR) $@
129129

130130
clangtest: CFLAGS ?= -O3
131131
clangtest: CFLAGS += -Werror -Wconversion -Wno-sign-conversion
@@ -142,15 +142,20 @@ clangtest-native: clean
142142
@CFLAGS="-O3 -Werror -Wconversion -Wno-sign-conversion" $(MAKE) -C $(PRGDIR) native CC=clang
143143
@CFLAGS="-O3 -Werror -Wconversion -Wno-sign-conversion" $(MAKE) -C $(TESTDIR) native CC=clang
144144

145+
usan: CC = clang
146+
usan: CFLAGS = -O3 -g -fsanitize=undefined -fno-sanitize-recover=undefined -fsanitize-recover=pointer-overflow
147+
usan: LDFLAGS = $(CFLAGS)
145148
usan: clean
146-
CC=clang CFLAGS="-O3 -g -fsanitize=undefined" $(MAKE) test FUZZER_TIME="-T30s" NB_LOOPS=-i1
149+
CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" $(MAKE) test FUZZER_TIME="-T30s" NB_LOOPS=-i1
147150

148151
usan32: clean
149152
CFLAGS="-m32 -O3 -g -fsanitize=undefined" $(MAKE) test FUZZER_TIME="-T30s" NB_LOOPS=-i1
150153

154+
SCANBUILD ?= scan-build
155+
SCANBUILD_FLAGS += --status-bugs -v --force-analyze-debug-code
151156
.PHONY: staticAnalyze
152157
staticAnalyze: clean
153-
CFLAGS=-g scan-build --status-bugs -v $(MAKE) all
158+
CPPFLAGS=-DLZ4_DEBUG=1 CFLAGS=-g $(SCANBUILD) $(SCANBUILD_FLAGS) $(MAKE) all V=1 DEBUGLEVEL=1
154159

155160
.PHONY: cppcheck
156161
cppcheck:

NEWS

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,39 @@
1+
v1.9.3
2+
perf: highly improved speed in kernel space, by @terrelln
3+
perf: faster speed with Visual Studio, thanks to @wolfpld and @remittor
4+
perf: improved dictionary compression speed, by @felixhandte
5+
perf: fixed LZ4_compress_HC_destSize() ratio, detected by @hsiangkao
6+
perf: reduced stack usage in high compression mode, by @Yanpas
7+
api : LZ4_decompress_safe_partial() supports unknown compressed size, requested by @jfkthame
8+
api : improved LZ4F_compressBound() with automatic flushing, by Christopher Harvie
9+
api : can (de)compress to/from NULL without UBs
10+
api : fix alignment test on 32-bit systems (state initialization)
11+
api : fix LZ4_saveDictHC() in corner case scenario, detected by @IgorKorkin
12+
cli : --list command, compressed file content statistics, by Filipe Calasans
13+
cli : benchmark mode supports dictionary, by @rkoradi
14+
cli : fix --fast with large argument, detected by @picoHz
15+
build: link to user-defined memory functions with LZ4_USER_MEMORY_FUNCTIONS, suggested by Yuriy Levchenko
16+
build: contrib/cmake_unofficial/ moved to build/cmake/
17+
build: visual/* moved to build/
18+
build: updated meson script, by @neheb
19+
build: tinycc support, by Anton Kochkov
20+
install: Haiku support, by Jerome Duval
21+
doc : updated LZ4 frame format, clarify EndMark
22+
23+
v1.9.2
24+
fix : out-of-bound read in exceptional circumstances when using decompress_partial(), by @terrelln
25+
fix : slim opportunity for out-of-bound write with compress_fast() with a large enough input and when providing an output smaller than recommended (< LZ4_compressBound(inputSize)), by @terrelln
26+
fix : rare data corruption bug with LZ4_compress_destSize(), by @terrelln
27+
fix : data corruption bug when Streaming with an Attached Dict in HC Mode, by @felixhandte
28+
perf: enable LZ4_FAST_DEC_LOOP on aarch64/GCC by default, by @prekageo
29+
perf: improved lz4frame streaming API speed, by @dreambottle
30+
perf: speed up lz4hc on slow patterns when using external dictionary, by @terrelln
31+
api: better in-place decompression and compression support
32+
cli : --list supports multi-frames files, by @gstedman
33+
cli: --version outputs to stdout
34+
cli : add option --best as an alias of -12 , by @Low-power
35+
misc: Integration into oss-fuzz by @cmeister2, expanded list of scenarios by @terrelln
36+
137
v1.9.1
238
fix : decompression functions were reading a few bytes beyond input size (introduced in v1.9.0, reported by @ppodolsky and @danlark1)
339
api : fix : lz4frame initializers compatibility with c++, reported by @degski

README.md

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -26,25 +26,13 @@ LZ4 library is provided as open-source software using BSD 2-Clause license.
2626

2727
|Branch |Status |
2828
|------------|---------|
29-
|master | [![Build Status][travisMasterBadge]][travisLink] [![Build status][AppveyorMasterBadge]][AppveyorLink] [![coverity][coverBadge]][coverlink] |
3029
|dev | [![Build Status][travisDevBadge]][travisLink] [![Build status][AppveyorDevBadge]][AppveyorLink] |
3130

32-
[travisMasterBadge]: https://travis-ci.org/lz4/lz4.svg?branch=master "Continuous Integration test suite"
3331
[travisDevBadge]: https://travis-ci.org/lz4/lz4.svg?branch=dev "Continuous Integration test suite"
3432
[travisLink]: https://travis-ci.org/lz4/lz4
35-
[AppveyorMasterBadge]: https://ci.appveyor.com/api/projects/status/github/lz4/lz4?branch=master&svg=true "Windows test suite"
3633
[AppveyorDevBadge]: https://ci.appveyor.com/api/projects/status/github/lz4/lz4?branch=dev&svg=true "Windows test suite"
3734
[AppveyorLink]: https://ci.appveyor.com/project/YannCollet/lz4-1lndh
38-
[coverBadge]: https://scan.coverity.com/projects/4735/badge.svg "Static code analysis of Master branch"
39-
[coverlink]: https://scan.coverity.com/projects/4735
4035

41-
> **Branch Policy:**
42-
> - The "master" branch is considered stable, at all times.
43-
> - The "dev" branch is the one where all contributions must be merged
44-
before being promoted to master.
45-
> + If you plan to propose a patch, please commit into the "dev" branch,
46-
or its own feature branch.
47-
Direct commit to "master" are not permitted.
4836

4937
Benchmarks
5038
-------------------------
@@ -95,6 +83,17 @@ It is compatible with parallel builds (`-j#`).
9583
[redirection]: https://www.gnu.org/prep/standards/html_node/Directory-Variables.html
9684
[command redefinition]: https://www.gnu.org/prep/standards/html_node/Utilities-in-Makefiles.html
9785

86+
Building LZ4 - Using vcpkg
87+
88+
You can download and install LZ4 using the [vcpkg](https://github.com/Microsoft/vcpkg) dependency manager:
89+
90+
git clone https://github.com/Microsoft/vcpkg.git
91+
cd vcpkg
92+
./bootstrap-vcpkg.sh
93+
./vcpkg integrate install
94+
vcpkg install lz4
95+
96+
The LZ4 port in vcpkg is kept up to date by Microsoft team members and community contributors. If the version is out of date, please [create an issue or pull request](https://github.com/Microsoft/vcpkg) on the vcpkg repository.
9897

9998
Documentation
10099
-------------------------

appveyor.yml

Lines changed: 21 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
version: 1.0.{build}
22
environment:
33
matrix:
4+
- COMPILER: "gcc"
5+
PLATFORM: "mingw64"
6+
- COMPILER: "gcc"
7+
PLATFORM: "mingw32"
48
- COMPILER: "visual"
59
CONFIGURATION: "Debug"
610
PLATFORM: "x64"
@@ -13,10 +17,6 @@ environment:
1317
- COMPILER: "visual"
1418
CONFIGURATION: "Release"
1519
PLATFORM: "Win32"
16-
- COMPILER: "gcc"
17-
PLATFORM: "mingw64"
18-
- COMPILER: "gcc"
19-
PLATFORM: "mingw32"
2020
- COMPILER: "gcc"
2121
PLATFORM: "clang"
2222

@@ -47,10 +47,14 @@ build_script:
4747
make -v &&
4848
echo ----- &&
4949
if not [%PLATFORM%]==[clang] (
50-
make -C programs lz4 && make -C tests fullbench && make -C lib lib
50+
make -C programs lz4 &&
51+
make -C tests fullbench &&
52+
make -C tests fuzzer &&
53+
make -C lib lib V=1
5154
) ELSE (
5255
make -C programs lz4 CC=clang MOREFLAGS="--target=x86_64-w64-mingw32 -Werror -Wconversion -Wno-sign-conversion" &&
5356
make -C tests fullbench CC=clang MOREFLAGS="--target=x86_64-w64-mingw32 -Werror -Wconversion -Wno-sign-conversion" &&
57+
make -C tests fuzzer CC=clang MOREFLAGS="--target=x86_64-w64-mingw32 -Werror -Wconversion -Wno-sign-conversion" &&
5458
make -C lib lib CC=clang MOREFLAGS="--target=x86_64-w64-mingw32 -Werror -Wconversion -Wno-sign-conversion"
5559
)
5660
)
@@ -63,39 +67,39 @@ build_script:
6367
COPY lib\lz4hc.h bin\include\ &&
6468
COPY lib\lz4frame.h bin\include\ &&
6569
COPY lib\liblz4.a bin\static\liblz4_static.lib &&
66-
COPY lib\dll\liblz4.* bin\dll\ &&
70+
COPY lib\dll\* bin\dll\ &&
6771
COPY lib\dll\example\Makefile bin\example\ &&
6872
COPY lib\dll\example\fullbench-dll.* bin\example\ &&
6973
COPY lib\dll\example\README.md bin\ &&
7074
COPY programs\lz4.exe bin\lz4.exe
7175
)
7276
- if [%COMPILER%]==[gcc] if [%PLATFORM%]==[mingw64] (
73-
7z.exe a bin\lz4_x64.zip NEWS .\bin\lz4.exe .\bin\README.md .\bin\example .\bin\dll .\bin\static .\bin\include &&
77+
7z.exe a -bb1 bin\lz4_x64.zip NEWS .\bin\lz4.exe .\bin\README.md .\bin\example .\bin\dll .\bin\static .\bin\include &&
7478
appveyor PushArtifact bin\lz4_x64.zip
7579
)
7680
- if [%COMPILER%]==[gcc] if [%PLATFORM%]==[mingw32] (
77-
7z.exe a bin\lz4_x86.zip NEWS .\bin\lz4.exe .\bin\README.md .\bin\example .\bin\dll .\bin\static .\bin\include &&
81+
7z.exe a -bb1 bin\lz4_x86.zip NEWS .\bin\lz4.exe .\bin\README.md .\bin\example .\bin\dll .\bin\static .\bin\include &&
7882
appveyor PushArtifact bin\lz4_x86.zip
7983
)
80-
- if [%COMPILER%]==[gcc] (COPY tests\fullbench.exe programs\)
84+
- if [%COMPILER%]==[gcc] (COPY tests\*.exe programs\)
8185
- if [%COMPILER%]==[visual] (
8286
ECHO *** &&
8387
ECHO *** Building Visual Studio 2010 %PLATFORM%\%CONFIGURATION% &&
8488
ECHO *** &&
85-
msbuild "visual\VS2010\lz4.sln" %ADDITIONALPARAM% /m /verbosity:minimal /property:PlatformToolset=v100 /t:Clean,Build /p:Platform=%PLATFORM% /p:Configuration=%CONFIGURATION% /p:EnableWholeProgramOptimization=true /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll" &&
89+
msbuild "build\VS2010\lz4.sln" %ADDITIONALPARAM% /m /verbosity:minimal /property:PlatformToolset=v100 /t:Clean,Build /p:Platform=%PLATFORM% /p:Configuration=%CONFIGURATION% /p:EnableWholeProgramOptimization=true /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll" &&
8690
ECHO *** &&
8791
ECHO *** Building Visual Studio 2012 %PLATFORM%\%CONFIGURATION% &&
8892
ECHO *** &&
89-
msbuild "visual\VS2010\lz4.sln" /m /verbosity:minimal /property:PlatformToolset=v110 /t:Clean,Build /p:Platform=%PLATFORM% /p:Configuration=%CONFIGURATION% /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll" &&
93+
msbuild "build\VS2010\lz4.sln" /m /verbosity:minimal /property:PlatformToolset=v110 /t:Clean,Build /p:Platform=%PLATFORM% /p:Configuration=%CONFIGURATION% /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll" &&
9094
ECHO *** &&
9195
ECHO *** Building Visual Studio 2013 %PLATFORM%\%CONFIGURATION% &&
9296
ECHO *** &&
93-
msbuild "visual\VS2010\lz4.sln" /m /verbosity:minimal /property:PlatformToolset=v120 /t:Clean,Build /p:Platform=%PLATFORM% /p:Configuration=%CONFIGURATION% /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll" &&
97+
msbuild "build\VS2010\lz4.sln" /m /verbosity:minimal /property:PlatformToolset=v120 /t:Clean,Build /p:Platform=%PLATFORM% /p:Configuration=%CONFIGURATION% /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll" &&
9498
ECHO *** &&
9599
ECHO *** Building Visual Studio 2015 %PLATFORM%\%CONFIGURATION% &&
96100
ECHO *** &&
97-
msbuild "visual\VS2010\lz4.sln" /m /verbosity:minimal /property:PlatformToolset=v140 /t:Clean,Build /p:Platform=%PLATFORM% /p:Configuration=%CONFIGURATION% /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll" &&
98-
COPY visual\VS2010\bin\%PLATFORM%_%CONFIGURATION%\*.exe programs\
101+
msbuild "build\VS2010\lz4.sln" /m /verbosity:minimal /property:PlatformToolset=v140 /t:Clean,Build /p:Platform=%PLATFORM% /p:Configuration=%CONFIGURATION% /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll" &&
102+
COPY build\VS2010\bin\%PLATFORM%_%CONFIGURATION%\*.exe programs\
99103
)
100104

101105
test_script:
@@ -110,7 +114,9 @@ test_script:
110114
lz4 -i1b10 lz4.exe &&
111115
lz4 -i1b15 lz4.exe &&
112116
echo ------- lz4 tested ------- &&
113-
fullbench.exe -i1 fullbench.exe
117+
fullbench.exe -i1 fullbench.exe &&
118+
echo trying to launch fuzzer.exe &&
119+
fuzzer.exe -v -T30s
114120
)
115121

116122
artifacts:

build/.gitignore

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Visual C++
2+
.vs/
3+
*Copy
4+
*.db
5+
*.opensdf
6+
*.sdf
7+
*.suo
8+
*.user
9+
ver*/
10+
VS2010/bin/
11+
VS2017/bin/
12+
ipch
13+
14+
# Fixup for lz4 project directories
15+
!VS2010/lz4
16+
!VS2017/lz4

0 commit comments

Comments
 (0)