2008-01-07 17:09:44 +01:00
|
|
|
|
2008-09-30 16:43:55 +02:00
|
|
|
.xz Test Files
|
2008-01-07 17:09:44 +01:00
|
|
|
----------------
|
|
|
|
|
|
|
|
0. Introduction
|
|
|
|
|
2008-09-30 16:43:55 +02:00
|
|
|
This directory contains bunch of files to test handling of .xz files
|
|
|
|
in .xz decoder implementations. Many of the files have been created
|
2008-01-07 17:09:44 +01:00
|
|
|
by hand with a hex editor, thus there is no better "source code" than
|
2008-09-30 16:43:55 +02:00
|
|
|
the files themselves. All the test files (*.xz) and this README have
|
2008-01-07 17:09:44 +01:00
|
|
|
been put into the public domain.
|
|
|
|
|
|
|
|
|
|
|
|
1. File Types
|
|
|
|
|
2008-09-30 16:43:55 +02:00
|
|
|
Good files (good-*.xz) must decode successfully without requiring
|
2008-08-28 21:53:15 +02:00
|
|
|
a lot of CPU time or RAM.
|
|
|
|
|
2008-09-30 16:43:55 +02:00
|
|
|
Unsupported files (unsupported-*.xz) are good files, but headers
|
2008-08-28 21:53:15 +02:00
|
|
|
indicate features not supported by the current file format
|
|
|
|
specification.
|
2008-01-07 17:09:44 +01:00
|
|
|
|
2008-09-30 16:43:55 +02:00
|
|
|
Bad files (bad-*.xz) must cause the decoder to give an error. Like
|
2008-01-07 17:09:44 +01:00
|
|
|
with the good files, these files must not require a lot of CPU time
|
|
|
|
or RAM before they get detected to be broken.
|
|
|
|
|
|
|
|
|
|
|
|
2. Descriptions of Individual Files
|
|
|
|
|
|
|
|
2.1. Good Files
|
|
|
|
|
2008-09-30 16:43:55 +02:00
|
|
|
good-0-empty.xz has one Stream with no Blocks.
|
2008-08-28 21:53:15 +02:00
|
|
|
|
2008-09-30 16:43:55 +02:00
|
|
|
good-0pad-empty.xz has one Stream with no Blocks followed by
|
2008-08-28 21:53:15 +02:00
|
|
|
four-byte Stream Padding.
|
2008-01-07 17:09:44 +01:00
|
|
|
|
2008-09-30 16:43:55 +02:00
|
|
|
good-0cat-empty.xz has two zero-Block Streams concatenated without
|
2008-08-28 21:53:15 +02:00
|
|
|
Stream Padding.
|
2008-01-07 17:09:44 +01:00
|
|
|
|
2008-09-30 16:43:55 +02:00
|
|
|
good-0catpad-empty.xz has two zero-Block Streams concatenated with
|
2008-08-28 21:53:15 +02:00
|
|
|
four-byte Stream Padding between the Streams.
|
2008-01-07 17:09:44 +01:00
|
|
|
|
2008-09-30 16:43:55 +02:00
|
|
|
good-1-check-none.xz has one Stream with one Block with two
|
2008-08-28 21:53:15 +02:00
|
|
|
uncompressed LZMA2 chunks and no integrity check.
|
2008-01-08 21:27:46 +01:00
|
|
|
|
2008-09-30 16:43:55 +02:00
|
|
|
good-1-check-crc32.xz has one Stream with one Block with two
|
2008-08-28 21:53:15 +02:00
|
|
|
uncompressed LZMA2 chunks and CRC32 check.
|
2008-01-07 17:09:44 +01:00
|
|
|
|
2008-09-30 16:43:55 +02:00
|
|
|
good-1-check-crc64.xz is like good-1-check-crc32.xz but with CRC64.
|
2008-01-07 17:09:44 +01:00
|
|
|
|
2008-09-30 16:43:55 +02:00
|
|
|
good-1-check-sha256.xz is like good-1-check-crc32.xz but with
|
2008-08-28 21:53:15 +02:00
|
|
|
SHA256.
|
2008-01-08 22:10:57 +01:00
|
|
|
|
2008-09-30 16:43:55 +02:00
|
|
|
good-2-lzma2.xz has one Stream with two Blocks with one uncompressed
|
2008-08-28 21:53:15 +02:00
|
|
|
LZMA2 chunk in each Block.
|
2008-01-08 22:10:57 +01:00
|
|
|
|
2008-09-30 16:43:55 +02:00
|
|
|
good-1-block_header-1.xz has both Compressed Size and Uncompressed
|
2008-08-28 21:53:15 +02:00
|
|
|
Size in the Block Header. This has also four extra bytes of Header
|
|
|
|
Padding.
|
2008-01-09 11:06:46 +01:00
|
|
|
|
2008-09-30 16:43:55 +02:00
|
|
|
good-1-block_header-2.xz has known Compressed Size.
|
2008-01-08 22:10:57 +01:00
|
|
|
|
2008-09-30 16:43:55 +02:00
|
|
|
good-1-block_header-3.xz has known Uncompressed Size.
|
2008-01-07 17:09:44 +01:00
|
|
|
|
2008-09-30 16:43:55 +02:00
|
|
|
good-1-delta-lzma2.tiff.xz is an image file that compresses
|
2008-08-28 21:53:15 +02:00
|
|
|
better with Delta+LZMA2 than with plain LZMA2.
|
2008-01-07 17:09:44 +01:00
|
|
|
|
2008-09-30 16:43:55 +02:00
|
|
|
good-1-x86-lzma2.xz uses the x86 filter (BCJ) and LZMA2. The
|
2008-01-26 10:09:17 +01:00
|
|
|
uncompressed file is compress_prepared_bcj_x86 found from the tests
|
|
|
|
directory.
|
|
|
|
|
2008-09-30 16:43:55 +02:00
|
|
|
good-1-sparc-lzma2.xz uses the SPARC filter and LZMA. The
|
2008-01-26 10:09:17 +01:00
|
|
|
uncompressed file is compress_prepared_bcj_sparc found from the tests
|
|
|
|
directory.
|
|
|
|
|
2008-09-30 16:43:55 +02:00
|
|
|
good-1-lzma2-1.xz has two LZMA2 chunks, of which the second sets
|
2008-08-28 21:53:15 +02:00
|
|
|
new properties.
|
2008-01-26 09:47:55 +01:00
|
|
|
|
2008-09-30 16:43:55 +02:00
|
|
|
good-1-lzma2-2.xz has two LZMA2 chunks, of which the second resets
|
2008-08-28 21:53:15 +02:00
|
|
|
the state without specifying new properties.
|
2008-01-07 17:09:44 +01:00
|
|
|
|
2008-09-30 16:43:55 +02:00
|
|
|
good-1-lzma2-3.xz has two LZMA2 chunks, of which the first is
|
2008-08-28 21:53:15 +02:00
|
|
|
uncompressed and the second is LZMA. The first chunk resets dictionary
|
|
|
|
and the second sets new properties.
|
2008-01-07 17:09:44 +01:00
|
|
|
|
2008-12-15 10:20:22 +01:00
|
|
|
good-1-lzma2-4.xz has three LZMA2 chunks: First is LZMA, second is
|
|
|
|
uncompressed with dictionary reset, and third is LZMA with new
|
|
|
|
properties but without dictionary reset.
|
|
|
|
|
2011-03-31 11:22:55 +02:00
|
|
|
good-1-lzma2-5.xz has an empty LZMA2 stream with only the end of
|
|
|
|
payload marker. XZ Utils 5.0.1 and older incorrectly see this file
|
|
|
|
as corrupt.
|
|
|
|
|
2008-09-30 16:43:55 +02:00
|
|
|
good-1-3delta-lzma2.xz has three Delta filters and LZMA2.
|
2008-01-08 12:35:36 +01:00
|
|
|
|
|
|
|
|
2008-08-28 21:53:15 +02:00
|
|
|
2.2. Unsupported Files
|
2008-01-08 12:35:36 +01:00
|
|
|
|
2008-09-30 16:43:55 +02:00
|
|
|
unsupported-check.xz uses Check ID 0x02 which isn't supported by
|
2008-08-28 21:53:15 +02:00
|
|
|
the current version of the file format. It is implementation-defined
|
|
|
|
how this file handled (it may reject it, or decode it possibly with
|
|
|
|
a warning).
|
2008-01-08 12:35:36 +01:00
|
|
|
|
2009-04-14 10:48:46 +02:00
|
|
|
unsupported-block_header.xz has a non-null byte in Header Padding,
|
2008-08-28 21:53:15 +02:00
|
|
|
which may indicate presence of a new unsupported field.
|
2008-01-23 19:05:01 +01:00
|
|
|
|
2008-09-30 16:43:55 +02:00
|
|
|
unsupported-filter_flags-1.xz has unsupported Filter ID 0x7F.
|
2008-01-23 19:05:01 +01:00
|
|
|
|
2008-09-30 16:43:55 +02:00
|
|
|
unsupported-filter_flags-2.xz specifies only Delta filter in the
|
2008-08-28 21:53:15 +02:00
|
|
|
List of Filter Flags, but Delta isn't allowed as the last filter in
|
|
|
|
the chain. It could be a little more correct to detect this file as
|
|
|
|
corrupt instead of unsupported, but saying it is unsupported is
|
|
|
|
simpler in case of liblzma.
|
2008-01-09 11:06:46 +01:00
|
|
|
|
2008-09-30 16:43:55 +02:00
|
|
|
unsupported-filter_flags-3.xz specifies two LZMA2 filters in the
|
2008-08-28 21:53:15 +02:00
|
|
|
List of Filter Flags. LZMA2 is allowed only as the last filter in the
|
|
|
|
chain. It could be a little more correct to detect this file as
|
|
|
|
corrupt instead of unsupported, but saying it is unsupported is
|
|
|
|
simpler in case of liblzma.
|
2008-01-07 17:09:44 +01:00
|
|
|
|
|
|
|
|
2008-08-28 21:53:15 +02:00
|
|
|
2.3. Bad Files
|
2008-01-07 17:09:44 +01:00
|
|
|
|
2008-09-30 16:43:55 +02:00
|
|
|
bad-0pad-empty.xz has one Stream with no Blocks followed by
|
2008-08-28 21:53:15 +02:00
|
|
|
five-byte Stream Padding. Stream Padding must be a multiple of four
|
|
|
|
bytes, thus this file is corrupt.
|
2008-01-07 17:09:44 +01:00
|
|
|
|
2008-09-30 16:43:55 +02:00
|
|
|
bad-0catpad-empty.xz has two zero-Block Streams concatenated with
|
2008-08-28 21:53:15 +02:00
|
|
|
five-byte Stream Padding between the Streams.
|
2008-01-07 17:09:44 +01:00
|
|
|
|
2008-09-30 16:43:55 +02:00
|
|
|
bad-0cat-alone.xz is good-0-empty.xz concatenated with an empty
|
2008-08-28 21:53:15 +02:00
|
|
|
LZMA_Alone file.
|
2008-01-18 19:13:00 +01:00
|
|
|
|
2008-09-30 16:43:55 +02:00
|
|
|
bad-0cat-header_magic.xz is good-0cat-empty.xz but with one byte
|
2008-09-30 12:56:57 +02:00
|
|
|
wrong in the Header Magic Bytes field of the second Stream. liblzma
|
|
|
|
gives LZMA_DATA_ERROR for this. (LZMA_FORMAT_ERROR is used only if
|
|
|
|
the first Stream of a file has invalid Header Magic Bytes.)
|
2008-01-18 19:13:00 +01:00
|
|
|
|
2008-09-30 16:43:55 +02:00
|
|
|
bad-0-header_magic.xz is good-0-empty.xz but with one byte wrong
|
2008-09-30 12:56:57 +02:00
|
|
|
in the Header Magic Bytes field. liblzma gives LZMA_FORMAT_ERROR for
|
|
|
|
this.
|
2008-09-30 12:27:28 +02:00
|
|
|
|
2008-09-30 16:43:55 +02:00
|
|
|
bad-0-footer_magic.xz is good-0-empty.xz but with one byte wrong
|
2008-09-30 12:56:57 +02:00
|
|
|
in the Footer Magic Bytes field. liblzma gives LZMA_DATA_ERROR for
|
|
|
|
this.
|
|
|
|
|
2008-09-30 16:43:55 +02:00
|
|
|
bad-0-empty-truncated.xz is good-0-empty.xz without the last byte
|
2008-09-30 12:56:57 +02:00
|
|
|
of the file.
|
2008-09-30 12:27:28 +02:00
|
|
|
|
2008-09-30 16:43:55 +02:00
|
|
|
bad-0-nonempty_index.xz has no Blocks but Index claims that there is
|
2008-08-28 21:53:15 +02:00
|
|
|
one Block.
|
2008-01-23 23:46:05 +01:00
|
|
|
|
2008-09-30 16:43:55 +02:00
|
|
|
bad-0-backward_size.xz has wrong Backward Size in Stream Footer.
|
2008-01-23 23:46:05 +01:00
|
|
|
|
2008-09-30 16:43:55 +02:00
|
|
|
bad-1-stream_flags-1.xz has different Stream Flags in Stream Header
|
2008-08-28 21:53:15 +02:00
|
|
|
and Stream Footer.
|
2008-01-23 23:46:05 +01:00
|
|
|
|
2008-09-30 16:43:55 +02:00
|
|
|
bad-1-stream_flags-2.xz has wrong CRC32 in Stream Header.
|
2008-01-23 23:46:05 +01:00
|
|
|
|
2008-09-30 16:43:55 +02:00
|
|
|
bad-1-stream_flags-3.xz has wrong CRC32 in Stream Footer.
|
2008-01-23 23:46:05 +01:00
|
|
|
|
2008-09-30 16:43:55 +02:00
|
|
|
bad-1-vli-1.xz has two-byte variable-length integer in the
|
2008-08-28 21:53:15 +02:00
|
|
|
Uncompressed Size field in Block Header while one-byte would be enough
|
|
|
|
for that value. It's important that the file gets rejected due to too
|
|
|
|
big integer encoding instead of due to Uncompressed Size not matching
|
|
|
|
the value stored in the Block Header. That is, the decoder must not
|
|
|
|
try to decode the Compressed Data field.
|
2008-01-23 23:46:05 +01:00
|
|
|
|
2008-09-30 16:43:55 +02:00
|
|
|
bad-1-vli-2.xz has ten-byte variable-length integer as Uncompressed
|
2008-08-28 21:53:15 +02:00
|
|
|
Size in Block Header. It's important that the file gets rejected due
|
|
|
|
to too big integer encoding instead of due to Uncompressed Size not
|
|
|
|
matching the value stored in the Block Header. That is, the decoder
|
|
|
|
must not try to decode the Compressed Data field.
|
2008-01-23 23:46:05 +01:00
|
|
|
|
2008-09-30 16:43:55 +02:00
|
|
|
bad-1-block_header-1.xz has Block Header that ends in the middle of
|
2008-08-28 21:53:15 +02:00
|
|
|
the Filter Flags field.
|
2008-01-23 23:46:05 +01:00
|
|
|
|
2008-09-30 16:43:55 +02:00
|
|
|
bad-1-block_header-2.xz has Block Header that has Compressed Size and
|
2008-08-28 21:53:15 +02:00
|
|
|
Uncompressed Size but no List of Filter Flags field.
|
2008-01-23 23:46:05 +01:00
|
|
|
|
2008-09-30 16:43:55 +02:00
|
|
|
bad-1-block_header-3.xz has wrong CRC32 in Block Header.
|
2008-01-23 23:46:05 +01:00
|
|
|
|
2008-11-19 19:46:52 +01:00
|
|
|
bad-1-block_header-4.xz has too big Compressed Size in Block Header
|
2009-04-14 10:48:46 +02:00
|
|
|
(2^63 - 1 bytes while maximum is a little less, because the whole
|
|
|
|
Block must stay smaller than 2^63). It's important that the file
|
2008-11-19 19:46:52 +01:00
|
|
|
gets rejected due to invalid Compressed Size value; the decoder
|
2008-08-28 21:53:15 +02:00
|
|
|
must not try decoding the Compressed Data field.
|
2008-01-23 23:46:05 +01:00
|
|
|
|
2008-11-19 19:46:52 +01:00
|
|
|
bad-1-block_header-5.xz has zero as Compressed Size in Block Header.
|
|
|
|
|
2011-05-28 07:46:04 +02:00
|
|
|
bad-1-block_header-6.xz has corrupt Block Header which may crash
|
|
|
|
xz -lvv in XZ Utils 5.0.3 and earlier. It was fixed in the commit
|
|
|
|
c0297445064951807803457dca1611b3c47e7f0f.
|
|
|
|
|
2009-04-14 10:48:46 +02:00
|
|
|
bad-2-index-1.xz has wrong Unpadded Sizes in Index.
|
2008-01-24 13:49:34 +01:00
|
|
|
|
2008-09-30 16:43:55 +02:00
|
|
|
bad-2-index-2.xz has wrong Uncompressed Sizes in Index.
|
2008-01-24 13:49:34 +01:00
|
|
|
|
2009-04-14 10:48:46 +02:00
|
|
|
bad-2-index-3.xz has non-null byte in Index Padding.
|
2008-01-24 13:49:34 +01:00
|
|
|
|
2008-09-30 16:43:55 +02:00
|
|
|
bad-2-index-4.xz wrong CRC32 in Index.
|
2008-01-24 13:49:34 +01:00
|
|
|
|
2009-04-14 10:48:46 +02:00
|
|
|
bad-2-index-5.xz has zero as Unpadded Size. It is important that the
|
|
|
|
file gets rejected specifically due to Unpadded Size having an invalid
|
|
|
|
value.
|
2008-11-19 19:46:52 +01:00
|
|
|
|
2009-04-14 10:48:46 +02:00
|
|
|
bad-2-compressed_data_padding.xz has non-null byte in the padding of
|
2008-08-28 21:53:15 +02:00
|
|
|
the Compressed Data field of the first Block.
|
2008-01-25 22:50:35 +01:00
|
|
|
|
2008-09-30 16:43:55 +02:00
|
|
|
bad-1-check-crc32.xz has wrong Check (CRC32).
|
2008-01-26 10:09:17 +01:00
|
|
|
|
2021-01-24 16:02:00 +01:00
|
|
|
bad-1-check-crc32-2.xz has Compressed Size and Uncompressed Size in
|
|
|
|
Block Header but wrong Check (CRC32) in the actual data. This file
|
|
|
|
differs by one byte from good-1-block_header-1.xz: the last byte of
|
|
|
|
the Check field is wrong. This file is useful for testing error
|
|
|
|
detection in the threaded decoder when a worker thread is configured
|
|
|
|
to pass input one byte at a time to the Block decoder.
|
|
|
|
|
2008-09-30 16:43:55 +02:00
|
|
|
bad-1-check-crc64.xz has wrong Check (CRC64).
|
2008-01-25 22:50:35 +01:00
|
|
|
|
2008-09-30 16:43:55 +02:00
|
|
|
bad-1-check-sha256.xz has wrong Check (SHA-256).
|
2008-01-24 13:49:34 +01:00
|
|
|
|
2008-09-30 16:43:55 +02:00
|
|
|
bad-1-lzma2-1.xz has LZMA2 stream whose first chunk (uncompressed)
|
2008-08-28 21:53:15 +02:00
|
|
|
doesn't reset the dictionary.
|
2008-01-26 09:47:55 +01:00
|
|
|
|
2008-09-30 16:43:55 +02:00
|
|
|
bad-1-lzma2-2.xz has two LZMA2 chunks, of which the second chunk
|
2008-08-28 21:53:15 +02:00
|
|
|
indicates dictionary reset, but the LZMA compressed data tries to
|
|
|
|
repeat data from the previous chunk.
|
2008-01-07 17:09:44 +01:00
|
|
|
|
2008-09-30 16:43:55 +02:00
|
|
|
bad-1-lzma2-3.xz sets new invalid properties (lc=8, lp=0, pb=0) in
|
2008-08-28 21:53:15 +02:00
|
|
|
the middle of Block.
|
2008-01-07 17:09:44 +01:00
|
|
|
|
2008-09-30 16:43:55 +02:00
|
|
|
bad-1-lzma2-4.xz has two LZMA2 chunks, of which the first is
|
2008-08-28 21:53:15 +02:00
|
|
|
uncompressed and the second is LZMA. The first chunk resets dictionary
|
|
|
|
as it should, but the second chunk tries to reset state without
|
|
|
|
specifying properties for LZMA.
|
2008-01-07 17:09:44 +01:00
|
|
|
|
2008-09-30 16:43:55 +02:00
|
|
|
bad-1-lzma2-5.xz is like bad-1-lzma2-4.xz but doesn't try to reset
|
2008-08-28 21:53:15 +02:00
|
|
|
anything in the header of the second chunk.
|
2008-01-07 17:09:44 +01:00
|
|
|
|
2008-09-30 16:43:55 +02:00
|
|
|
bad-1-lzma2-6.xz has reserved LZMA2 control byte value (0x03).
|
2008-01-07 17:09:44 +01:00
|
|
|
|
2008-09-30 16:43:55 +02:00
|
|
|
bad-1-lzma2-7.xz has EOPM at LZMA level.
|
2008-01-07 17:09:44 +01:00
|
|
|
|
2008-12-15 10:20:22 +01:00
|
|
|
bad-1-lzma2-8.xz is like good-1-lzma2-4.xz but doesn't set new
|
|
|
|
properties in the third LZMA2 chunk.
|
|
|
|
|