]>
git.ipfire.org Git - thirdparty/zlib-ng.git/log
Nathan Moinvaziri [Sun, 20 Sep 2020 02:39:42 +0000 (19:39 -0700)]
Fixed unsigned integer overflow ASAN error when hash_head > s->strstart.
zlib-ng/deflate_medium.c:244:47: runtime error: unsigned integer overflow: 58442 - 58452 cannot be represented in type 'unsigned int'
Co-authored-by: Mika Lindqvist <postmaster@raasu.org>
Co-authored-by: Hans Kristian Rosbach <hk-git@circlestorm.org>
Gabriel A. Devenyi [Tue, 29 Sep 2020 01:45:28 +0000 (21:45 -0400)]
Elevate warnings to errors to trigger failure on static analyzer
Ilya Leoshkevich [Mon, 28 Sep 2020 19:54:54 +0000 (21:54 +0200)]
Fix switchlevels calling deflateParams() with a stale buffer
Fixes: #776
Ilya Leoshkevich [Mon, 28 Sep 2020 19:21:49 +0000 (21:21 +0200)]
Fix incorrect inflateSyncPoint() return value with DFLTCC
DFLTCC does not provide the necessary information to implement
inflateSyncPoint() - Incomplete-Function Status and Incomplete-Function
Length are the fields that provide the relevant information, but
unfortunately it's not enough. If DFLTCC is in use, the current code
checks software decompression state and always returns 0. This
(rightfully) confuses rsync, so fix by returning Z_STREAM_ERROR
instead.
Nathan Moinvaziri [Mon, 5 Oct 2020 01:36:25 +0000 (18:36 -0700)]
Fixed left shift ubsan warning in PULLBYTE.
infback.c:200:13: runtime error: left shift of 255 by 24 places cannot be represented in type 'int'
624: SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /Users/runner/work/zlib-ng/zlib-ng/infback.c:200:13 in
Mark Adler [Sun, 6 Sep 2015 00:45:55 +0000 (17:45 -0700)]
Avoid shifts of negative values inflateMark().
The C standard says that bit shifts of negative integers is
undefined. This casts to unsigned values to assure a known
result.
Nathan Moinvaziri [Sat, 3 Oct 2020 21:34:08 +0000 (14:34 -0700)]
Abort CI tests on sanitizer error.
Mika Lindqvist [Sat, 3 Oct 2020 23:52:56 +0000 (02:52 +0300)]
Fix memory leak in gz_compress() and add NULL check.
Mika Lindqvist [Sat, 3 Oct 2020 23:05:05 +0000 (02:05 +0300)]
Fix memory leak in gz_uncompress().
Nathan Moinvaziri [Mon, 28 Sep 2020 23:43:50 +0000 (16:43 -0700)]
Fixed dereference of possibly null head variable in test_deflate_set_header.
example.c:920:16: warning: dereference of possibly-NULL ‘head’ [CWE-690] [-Wanalyzer-possible-null-dereference]
920 | head->text = 1;
| ~~~~~~~~~~~^~~
‘test_deflate_set_header’: event 1
|
| 906 | PREFIX(gz_header) *head = calloc(1, sizeof(PREFIX(gz_header)));
| | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| | |
| | (1) this call could return NULL
Ilya Leoshkevich [Mon, 28 Sep 2020 20:33:02 +0000 (22:33 +0200)]
Fix constness in DFLTCC code
Use z_const instead of const in order to fix compiler warnings.
Mika Lindqvist [Thu, 24 Sep 2020 17:19:48 +0000 (20:19 +0300)]
Add 'diffoscope' for MacOS in pkgcheck.yml
* Disable ABI check for MacOS as the runner doesn't contain abigail
Mika Lindqvist [Thu, 24 Sep 2020 14:45:09 +0000 (17:45 +0300)]
Add missing 'diffoscope' package to pkgcheck.yml
Mika Lindqvist [Sun, 20 Sep 2020 01:25:21 +0000 (18:25 -0700)]
Fix unsigned integer overflow ASAN error for align_diff in crc_folding.c.
zlib-ng/arch/x86/crc_folding.c:252:31: runtime error: unsigned integer overflow: 0 -
108370614813184 cannot be represented in type 'unsigned long'
Nathan Moinvaziri [Sun, 20 Sep 2020 23:31:59 +0000 (16:31 -0700)]
Fixed tab indentation for inffixed_tbl.h.
Nathan Moinvaziri [Sun, 20 Sep 2020 23:02:38 +0000 (16:02 -0700)]
Remove package caching for Windows since we no longer downgrade to MinGW 7.
Nathan Moinvaziri [Sun, 20 Sep 2020 23:01:03 +0000 (16:01 -0700)]
Added option to normalize line-endings in CMake run-and-compare script.
Nathan Moinvaziri [Sun, 20 Sep 2020 20:32:13 +0000 (13:32 -0700)]
Move tests closer to add_executable in CMake to make them easier to find.
Nathan Moinvaziri [Sun, 20 Sep 2020 19:54:20 +0000 (12:54 -0700)]
Fixed cmake script directory for out of source builds.
Nathan Moinvaziri [Sun, 20 Sep 2020 17:36:19 +0000 (10:36 -0700)]
Fixed parallel test runs on macOS by always appending unique id, since with corpora repository, multiple tests can have the same output name.
Nathan Moinvaziri [Sun, 20 Sep 2020 17:13:41 +0000 (10:13 -0700)]
Ignore hidden test files with ctest on macOS.
Nathan Moinvaziri [Sun, 20 Sep 2020 02:55:46 +0000 (19:55 -0700)]
Use latest stable version of codecov rather that git repo.
Nathan Moinvaziri [Sat, 19 Sep 2020 23:15:41 +0000 (16:15 -0700)]
Checkout corpora into a separate directory to prevent overwriting.
(cherry picked from commit
b25c7202afdbd8e4270908c65598464f31063d51 )
Nathan Moinvaziri [Sat, 19 Sep 2020 23:04:58 +0000 (16:04 -0700)]
Add checks to cmake scripts to see if input files exist.
Nathan Moinvaziri [Sat, 19 Sep 2020 01:43:42 +0000 (18:43 -0700)]
Turn off compare and gzip verify in GH-536 tests due to switchlevels.
Nathan Moinvaziri [Sat, 19 Sep 2020 01:42:27 +0000 (18:42 -0700)]
Add ability to turn off compare step in test-compare script.
Nathan Moinvaziri [Sat, 19 Sep 2020 01:41:45 +0000 (18:41 -0700)]
Check if input variables are defined in cmake scripts.
Nathan Moinvaziri [Sat, 19 Sep 2020 01:39:02 +0000 (18:39 -0700)]
Check exit code from execute_process in run-and-compare cmake script.
Nathan Moinvaziri [Sat, 19 Sep 2020 01:13:28 +0000 (18:13 -0700)]
Removed extra whitespace in CMakeLists.txt.
Nathan Moinvaziri [Sat, 19 Sep 2020 01:10:03 +0000 (18:10 -0700)]
Remove exit code 1 from SUCCESS_EXIT for normal compression tests.
Nathan Moinvaziri [Sat, 19 Sep 2020 01:08:49 +0000 (18:08 -0700)]
Fixed passing fixed/filtered arguments in TEST_CONFIGS.
Nathan Moinvaziri [Sat, 19 Sep 2020 01:04:30 +0000 (18:04 -0700)]
Cleanup temporary files before fatal error in test-compress cmake script.
Nathan Moinvaziri [Sat, 19 Sep 2020 01:03:38 +0000 (18:03 -0700)]
Check exit code from execute_process in test-compare cmake script.
Nathan Moinvaziri [Sat, 19 Sep 2020 00:52:43 +0000 (17:52 -0700)]
Fixed don't run tests against temporary files.
Nathan Moinvaziri [Thu, 17 Sep 2020 02:30:59 +0000 (19:30 -0700)]
Fixed compression args for GH-361 unit test.
Nathan Moinvaziri [Sun, 20 Sep 2020 17:51:05 +0000 (10:51 -0700)]
Remove NIL preprocessor macro which isn't consistently enforced.
Nathan Moinvaziri [Mon, 21 Sep 2020 03:44:55 +0000 (20:44 -0700)]
Fixed deference null return value in gz_uncompress (CID 301524)
Nathan Moinvaziri [Sun, 20 Sep 2020 01:50:10 +0000 (18:50 -0700)]
Remove unused F_OPEN preprocessor macro.
Nathan Moinvaziri [Sat, 19 Sep 2020 23:27:54 +0000 (16:27 -0700)]
Remove gcov-7 install since warnings on gcov-8 no longer occur in Windows CI.
Mika Lindqvist [Mon, 14 Sep 2020 15:40:35 +0000 (18:40 +0300)]
Remove chunkmemset_3 and chunkmemset_6 on ARM/AArch64 as they need 3 chunks...
* Don't unroll distances smaller than chunk size.
Mika Lindqvist [Mon, 14 Sep 2020 19:13:09 +0000 (22:13 +0300)]
Add missing z_const to fuzzers.
Nathan Moinvaziri [Mon, 14 Sep 2020 05:12:40 +0000 (22:12 -0700)]
Fixed match_byte casting warning in compare256_unaligned_64_static.
compare258.c(158,36): warning C4244: 'return': conversion from 'uint64_t' to 'uint32_t', possible loss of data
Nathan Moinvaziri [Mon, 14 Sep 2020 04:58:57 +0000 (21:58 -0700)]
Move gzclose() to gzlib.c. Modern linkers should be smart enough to link it in only if it is used.
Nathan Moinvaziri [Mon, 14 Sep 2020 04:16:36 +0000 (21:16 -0700)]
Optionally include gzguts.h with WITH_GZFILEOP flag.
Nathan Moinvaziri [Sun, 13 Sep 2020 04:08:00 +0000 (21:08 -0700)]
Added ubuntu mingw cross-compile CI instances to cmake GHA.
Nathan Moinvaziri [Sun, 13 Sep 2020 04:20:36 +0000 (21:20 -0700)]
Fixed buf resource leak in gz_compress when USE_MMAP is defined. (CID 298965)
Hans Kristian Rosbach [Sat, 12 Sep 2020 21:18:13 +0000 (23:18 +0200)]
Allocate gzlib/gzread/gzwrite structs and in/out buffers using zng_alloc
instead of malloc, this also enforces data alignment.
Hans Kristian Rosbach [Sat, 12 Sep 2020 20:55:02 +0000 (22:55 +0200)]
Increase zng_alloc alignment to 64-bytes for non-MacOS platforms.
Hans Kristian Rosbach [Sat, 12 Sep 2020 18:24:42 +0000 (20:24 +0200)]
Improve malloc.h handling in zutil.h
Hans Kristian Rosbach [Sat, 12 Sep 2020 17:54:38 +0000 (19:54 +0200)]
Simplify zng_calloc and zng_cfree.
Make new static functions zng_alloc and zng_free available to other parts of the code.
Always request aligned allocations, even if UNALIGNED_OK is set.
Hans Kristian Rosbach [Fri, 11 Sep 2020 19:48:46 +0000 (21:48 +0200)]
Make it possible to disable UNALIGNED[64]_OK in cmake.
Enable testing with -O3 and unaligned reads disabled.
Hans Kristian Rosbach [Sat, 12 Sep 2020 13:28:58 +0000 (15:28 +0200)]
Remove some of the references to the unreleased zlib 1.2.12
Hans Kristian Rosbach [Sat, 12 Sep 2020 10:26:22 +0000 (12:26 +0200)]
Add CI testing of NOT_TWEAK_COMPILER
Hans Kristian Rosbach [Sat, 12 Sep 2020 12:28:25 +0000 (14:28 +0200)]
Improve coverage data accuracy
Mika Lindqvist [Sat, 12 Sep 2020 15:22:36 +0000 (18:22 +0300)]
Enable WITH_GZFILEOP by default in nmake Makefiles.
Mika Lindqvist [Fri, 11 Sep 2020 13:25:56 +0000 (16:25 +0300)]
Add support for ZLIB_COMPÅT in nmake Makefiles for ARM/AArch64.
Nathan Moinvaziri [Sat, 12 Sep 2020 21:31:40 +0000 (14:31 -0700)]
Fixed description for INSTALL_UTILS in README.md.
Hans Kristian Rosbach [Thu, 10 Sep 2020 15:19:39 +0000 (17:19 +0200)]
Various small changes to README.md
Hans Kristian Rosbach [Thu, 10 Sep 2020 15:09:24 +0000 (17:09 +0200)]
Reorder "Features" block in README.md
Nathan Moinvaziri [Mon, 29 Jun 2020 03:00:01 +0000 (20:00 -0700)]
Added AVX support to chunkset functions.
Hans Kristian Rosbach [Wed, 9 Sep 2020 09:43:31 +0000 (11:43 +0200)]
Update CI configs to account for gzfileops being on by default.
Hans Kristian Rosbach [Sun, 6 Sep 2020 14:34:01 +0000 (16:34 +0200)]
Enable gzfileops by default when compiling using Cmake or configure.
Hans Kristian Rosbach [Wed, 9 Sep 2020 09:21:49 +0000 (11:21 +0200)]
Remove FORCE_STATIC and FORCE_STORED
Hans Kristian Rosbach [Sun, 6 Sep 2020 15:10:42 +0000 (17:10 +0200)]
Rename variable to correctly indicate register usage,
YMM (256bit) instead of ZMM (512bit) register usage.
Dan Kegel [Mon, 31 Aug 2020 16:37:40 +0000 (09:37 -0700)]
test/abicheck.md: document care and feeding of abicheck.sh
Dan Kegel [Thu, 16 Jul 2020 16:59:52 +0000 (09:59 -0700)]
test/abicheck.sh: new script to verify abi compatibility with older versions
Verifies that zlib-ng's ABI has not changed since the reference commit
(indicated by variables ABI_URL and ABI_COMMIT in the script).
If --zlib-compat is given, the reference commit is zlib's 1.2.11;
otherwise, it's zlib-ng's
1d2504ddc489 (for now).
Ignores new symbols entirely, as they probably don't break backwards compatibility.
Ignores warnings listed in test/abi/ignore, currently, just those related to internal_state or z_stream*.
If --refresh is given, actually checks out the reference commit,
builds it, and stores its ABI description into an .abi file;
otherwise just uses the .abi file saved in git for that CHOST.
(--refresh_if is similar, but only does the above if the file
is not present.)
Fixes https://github.com/zlib-ng/zlib-ng/issues/699
Known issues:
- pkgcheck.yml skips -m32 abicheck failures loudly until #705 is fixed
- although abicheck.sh supports -m32 (if in both CFLAGS and LDFLAGS), it doesn't yet support -32 in CONFIGURE_ARGS.
- only includes a few abi definitions; the rest can be added in a followon commit (see --refresh).
Hans Kristian Rosbach [Sat, 29 Aug 2020 22:44:25 +0000 (00:44 +0200)]
Clean up if blocks in deflate.c
Hans Kristian Rosbach [Sat, 29 Aug 2020 16:58:23 +0000 (18:58 +0200)]
longest_match optimization
Hans Kristian Rosbach [Sat, 29 Aug 2020 15:26:18 +0000 (17:26 +0200)]
Fix numerous sign-conversion warnings in compare256/compare258 and
longest_match related code.
Hans Kristian Rosbach [Sat, 29 Aug 2020 11:48:23 +0000 (13:48 +0200)]
Minor comments/whitespace cleanup
Hans Kristian Rosbach [Sat, 29 Aug 2020 08:50:50 +0000 (10:50 +0200)]
Reorder s->block_open and s->reproducible.
Hans Kristian Rosbach [Sat, 29 Aug 2020 08:40:27 +0000 (10:40 +0200)]
Remove s->method since it is always set to the same value and never read.
Hans Kristian Rosbach [Sat, 29 Aug 2020 08:29:43 +0000 (10:29 +0200)]
Move and reduce size of s->pending_buf_size
Nathan Moinvaziri [Sun, 23 Aug 2020 01:25:24 +0000 (18:25 -0700)]
Rename ZEXPORT and ZEXTERN for consistency.
Nathan Moinvaziri [Sun, 23 Aug 2020 01:24:10 +0000 (18:24 -0700)]
Rename ZLIB_INTERNAL to Z_INTERNAL for consistency.
Nathan Moinvaziri [Sun, 23 Aug 2020 01:07:50 +0000 (18:07 -0700)]
Rename ZLIB_REGISTER to Z_REGISTER for consistency.
Hans Kristian Rosbach [Tue, 25 Aug 2020 14:36:28 +0000 (16:36 +0200)]
Fix more conversion warnings related to s->bi_valid, stored_len and misc.
Hans Kristian Rosbach [Tue, 25 Aug 2020 13:47:25 +0000 (15:47 +0200)]
Fix some of the old and new conversion warnings in deflate*
Hans Kristian Rosbach [Mon, 24 Aug 2020 13:01:37 +0000 (15:01 +0200)]
Changes to deflate's internal_state struct members:
- Change window_size from unsigned long to unsigned int
- Change block_start from long to int
- Change high_water from unsigned long to unsigned int
- Reorder to promote cache locality in hot code and decrease holes.
On x86_64 this means the struct goes from:
/* size: 6008, cachelines: 94, members: 57 */
/* sum members: 5984, holes: 6, sum holes: 24 */
/* last cacheline: 56 bytes */
To:
/* size: 5984, cachelines: 94, members: 57 */
/* sum members: 5972, holes: 3, sum holes: 8 */
/* padding: 4 */
/* last cacheline: 32 bytes */
Nathan Moinvaziri [Wed, 26 Aug 2020 02:46:15 +0000 (19:46 -0700)]
Renamed trees_p.h to trees.h.
Nathan Moinvaziri [Mon, 24 Aug 2020 00:20:20 +0000 (17:20 -0700)]
Rename table headers with tbl suffix.
Ilya Leoshkevich [Wed, 26 Aug 2020 21:46:55 +0000 (23:46 +0200)]
Revert "zng_tr_tally_lit: disable -Wtype-limits"
This makes MSVC unhappy:
https://github.com/zlib-ng/zlib-ng/pull/726#issuecomment-
681128124
D:\a\zlib-ng\zlib-ng\deflate_p.h(36,9): warning C4068: unknown pragma 'GCC' [D:\a\zlib-ng\zlib-ng\zlib.vcxproj]
This reverts commit
24c442c606d9121da64b25693c9bb1a898b3553f .
Nathan Moinvaziri [Fri, 10 Jul 2020 21:09:43 +0000 (14:09 -0700)]
Use mainline codecov repository since codecov/codecov-python#169 has been merged.
Ilya Leoshkevich [Tue, 21 Jul 2020 11:18:10 +0000 (13:18 +0200)]
send_bits_trace: placate -Wformat
value, which can be uint64_t, is printed using %llx, which, strictly
speaking, is not correct, and triggers -Wformat.
Since we don't really know what type value can have (send_bits_trace
is a macro), don't use <inttypes.h>, but rather cast it to long long.
Also cast length to int in order to prevent similar issues in the
future.
Ilya Leoshkevich [Tue, 21 Jul 2020 11:15:07 +0000 (13:15 +0200)]
zng_tr_tally_lit: disable -Wtype-limits
Some gcc versions complain that parameter c is always less than
MAX_MATCH-MIN_MATCH, and therefore the assertion that checks for this
is useless, but in reality some day MIN_MATCH and MAX_MATCH can change.
So disable the warning around the assertion.
Nathan Moinvaziri [Sun, 23 Aug 2020 07:59:38 +0000 (00:59 -0700)]
Add optional support for thread local storage. (#733)
Mika Lindqvist [Sun, 23 Aug 2020 07:58:57 +0000 (10:58 +0300)]
Reintroduce support for ZLIB_CONST in compat mode. (#704)
* Reintroduce support for ZLIB_CONST in compat mode.
Hans Kristian Rosbach [Fri, 21 Aug 2020 14:17:55 +0000 (16:17 +0200)]
Increase hash table size from 15 to 16 bits.
This gives a good performance increase, and usually also improves compression.
Make separate define HASH_SLIDE for fallback version of UPDATE_HASH.
Hans Kristian Rosbach [Fri, 21 Aug 2020 13:53:30 +0000 (15:53 +0200)]
Replace hash_bits, hash_size and hash_mask with defines.
Nathan Moinvaziri [Wed, 19 Aug 2020 21:13:04 +0000 (14:13 -0700)]
Precalculate match+offset pointer similar to fast-zlib.
Nathan Moinvaziri [Wed, 29 Jul 2020 06:34:11 +0000 (23:34 -0700)]
Check for match length exceeding lookahead each time a new best match is found. This reduces some code complexity in GOTO_NEXT_CHAIN by removing the need for RETURN_BEST_LEN.
Nathan Moinvaziri [Sun, 26 Jul 2020 01:24:48 +0000 (21:24 -0400)]
Use unaligned 32-bit and 64-bit compare based on best match length when searching for matches.
Move TRIGGER_LEVEL to match_tpl.h since it is only used in longest match.
Use early return inside match loops instead of cont variable.
Added back two variable check for platforms that don't supported unaligned access.
Ilya Leoshkevich [Thu, 20 Aug 2020 11:34:45 +0000 (13:34 +0200)]
Update SystemZ DFLTCC README
Ilya Leoshkevich [Tue, 21 Jul 2020 11:15:23 +0000 (13:15 +0200)]
Add DFLTCC to CI
QEMU does not support DFLTCC, but this would still check whether it
builds and gracefully falls back to software.
Ilya Leoshkevich [Thu, 13 Aug 2020 09:55:01 +0000 (11:55 +0200)]
Fix DFLTCC not writing header bits when avail_out == 0
Ilya Leoshkevich [Thu, 13 Aug 2020 09:50:46 +0000 (11:50 +0200)]
Fix DFLTCC ignoring flush modes when avail_in == 0
Ilya Leoshkevich [Tue, 21 Jul 2020 10:54:18 +0000 (12:54 +0200)]
Fix DFLTCC not flushing EOBS when creating raw streams
Ilya Leoshkevich [Tue, 21 Jul 2020 11:27:47 +0000 (13:27 +0200)]
Implement switching between DFLTCC and software
Ilya Leoshkevich [Tue, 21 Jul 2020 11:35:58 +0000 (13:35 +0200)]
Fix switching compression levels on older SystemZ machines
When switching to a compression level that is in general supported by
the hardware accelerator, the code doesn't check whether acceleration is
available or enabled.
Ilya Leoshkevich [Tue, 21 Jul 2020 12:05:25 +0000 (14:05 +0200)]
Use 15-bit window for quick strategy when compiling with DFLTCC
Hardware accelerator does not support 13-bit window.