Re: [PATCH v3 3/4] btrfs: Add zstd support

From: kbuild test robot
Date: Mon Jul 24 2017 - 13:29:17 EST


Hi Nick,

[auto build test WARNING on linus/master]
[also build test WARNING on v4.13-rc2 next-20170724]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url: https://github.com/0day-ci/linux/commits/Nick-Terrell/Add-xxhash-and-zstd-modules/20170723-092845
config: x86_64-randconfig-a0-07242221 (attached as .config)
compiler: gcc-4.4 (Debian 4.4.7-8) 4.4.7
reproduce:
# save the attached .config to linux build tree
make ARCH=x86_64

All warnings (new ones prefixed by >>):

lib/zstd/decompress.c: In function 'ZSTD_decodeSequence':
>> lib/zstd/decompress.c:1001: warning: 'seq.match' is used uninitialized in this function

vim +1001 lib/zstd/decompress.c

dc22844b Nick Terrell 2017-07-20 930
dc22844b Nick Terrell 2017-07-20 931 static seq_t ZSTD_decodeSequence(seqState_t *seqState)
dc22844b Nick Terrell 2017-07-20 932 {
dc22844b Nick Terrell 2017-07-20 933 seq_t seq;
dc22844b Nick Terrell 2017-07-20 934
dc22844b Nick Terrell 2017-07-20 935 U32 const llCode = FSE_peekSymbol(&seqState->stateLL);
dc22844b Nick Terrell 2017-07-20 936 U32 const mlCode = FSE_peekSymbol(&seqState->stateML);
dc22844b Nick Terrell 2017-07-20 937 U32 const ofCode = FSE_peekSymbol(&seqState->stateOffb); /* <= maxOff, by table construction */
dc22844b Nick Terrell 2017-07-20 938
dc22844b Nick Terrell 2017-07-20 939 U32 const llBits = LL_bits[llCode];
dc22844b Nick Terrell 2017-07-20 940 U32 const mlBits = ML_bits[mlCode];
dc22844b Nick Terrell 2017-07-20 941 U32 const ofBits = ofCode;
dc22844b Nick Terrell 2017-07-20 942 U32 const totalBits = llBits + mlBits + ofBits;
dc22844b Nick Terrell 2017-07-20 943
dc22844b Nick Terrell 2017-07-20 944 static const U32 LL_base[MaxLL + 1] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 18,
dc22844b Nick Terrell 2017-07-20 945 20, 22, 24, 28, 32, 40, 48, 64, 0x80, 0x100, 0x200, 0x400, 0x800, 0x1000, 0x2000, 0x4000, 0x8000, 0x10000};
dc22844b Nick Terrell 2017-07-20 946
dc22844b Nick Terrell 2017-07-20 947 static const U32 ML_base[MaxML + 1] = {3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,
dc22844b Nick Terrell 2017-07-20 948 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 37, 39, 41,
dc22844b Nick Terrell 2017-07-20 949 43, 47, 51, 59, 67, 83, 99, 0x83, 0x103, 0x203, 0x403, 0x803, 0x1003, 0x2003, 0x4003, 0x8003, 0x10003};
dc22844b Nick Terrell 2017-07-20 950
dc22844b Nick Terrell 2017-07-20 951 static const U32 OF_base[MaxOff + 1] = {0, 1, 1, 5, 0xD, 0x1D, 0x3D, 0x7D, 0xFD, 0x1FD,
dc22844b Nick Terrell 2017-07-20 952 0x3FD, 0x7FD, 0xFFD, 0x1FFD, 0x3FFD, 0x7FFD, 0xFFFD, 0x1FFFD, 0x3FFFD, 0x7FFFD,
dc22844b Nick Terrell 2017-07-20 953 0xFFFFD, 0x1FFFFD, 0x3FFFFD, 0x7FFFFD, 0xFFFFFD, 0x1FFFFFD, 0x3FFFFFD, 0x7FFFFFD, 0xFFFFFFD};
dc22844b Nick Terrell 2017-07-20 954
dc22844b Nick Terrell 2017-07-20 955 /* sequence */
dc22844b Nick Terrell 2017-07-20 956 {
dc22844b Nick Terrell 2017-07-20 957 size_t offset;
dc22844b Nick Terrell 2017-07-20 958 if (!ofCode)
dc22844b Nick Terrell 2017-07-20 959 offset = 0;
dc22844b Nick Terrell 2017-07-20 960 else {
dc22844b Nick Terrell 2017-07-20 961 offset = OF_base[ofCode] + BIT_readBitsFast(&seqState->DStream, ofBits); /* <= (ZSTD_WINDOWLOG_MAX-1) bits */
dc22844b Nick Terrell 2017-07-20 962 if (ZSTD_32bits())
dc22844b Nick Terrell 2017-07-20 963 BIT_reloadDStream(&seqState->DStream);
dc22844b Nick Terrell 2017-07-20 964 }
dc22844b Nick Terrell 2017-07-20 965
dc22844b Nick Terrell 2017-07-20 966 if (ofCode <= 1) {
dc22844b Nick Terrell 2017-07-20 967 offset += (llCode == 0);
dc22844b Nick Terrell 2017-07-20 968 if (offset) {
dc22844b Nick Terrell 2017-07-20 969 size_t temp = (offset == 3) ? seqState->prevOffset[0] - 1 : seqState->prevOffset[offset];
dc22844b Nick Terrell 2017-07-20 970 temp += !temp; /* 0 is not valid; input is corrupted; force offset to 1 */
dc22844b Nick Terrell 2017-07-20 971 if (offset != 1)
dc22844b Nick Terrell 2017-07-20 972 seqState->prevOffset[2] = seqState->prevOffset[1];
dc22844b Nick Terrell 2017-07-20 973 seqState->prevOffset[1] = seqState->prevOffset[0];
dc22844b Nick Terrell 2017-07-20 974 seqState->prevOffset[0] = offset = temp;
dc22844b Nick Terrell 2017-07-20 975 } else {
dc22844b Nick Terrell 2017-07-20 976 offset = seqState->prevOffset[0];
dc22844b Nick Terrell 2017-07-20 977 }
dc22844b Nick Terrell 2017-07-20 978 } else {
dc22844b Nick Terrell 2017-07-20 979 seqState->prevOffset[2] = seqState->prevOffset[1];
dc22844b Nick Terrell 2017-07-20 980 seqState->prevOffset[1] = seqState->prevOffset[0];
dc22844b Nick Terrell 2017-07-20 981 seqState->prevOffset[0] = offset;
dc22844b Nick Terrell 2017-07-20 982 }
dc22844b Nick Terrell 2017-07-20 983 seq.offset = offset;
dc22844b Nick Terrell 2017-07-20 984 }
dc22844b Nick Terrell 2017-07-20 985
dc22844b Nick Terrell 2017-07-20 986 seq.matchLength = ML_base[mlCode] + ((mlCode > 31) ? BIT_readBitsFast(&seqState->DStream, mlBits) : 0); /* <= 16 bits */
dc22844b Nick Terrell 2017-07-20 987 if (ZSTD_32bits() && (mlBits + llBits > 24))
dc22844b Nick Terrell 2017-07-20 988 BIT_reloadDStream(&seqState->DStream);
dc22844b Nick Terrell 2017-07-20 989
dc22844b Nick Terrell 2017-07-20 990 seq.litLength = LL_base[llCode] + ((llCode > 15) ? BIT_readBitsFast(&seqState->DStream, llBits) : 0); /* <= 16 bits */
dc22844b Nick Terrell 2017-07-20 991 if (ZSTD_32bits() || (totalBits > 64 - 7 - (LLFSELog + MLFSELog + OffFSELog)))
dc22844b Nick Terrell 2017-07-20 992 BIT_reloadDStream(&seqState->DStream);
dc22844b Nick Terrell 2017-07-20 993
dc22844b Nick Terrell 2017-07-20 994 /* ANS state update */
dc22844b Nick Terrell 2017-07-20 995 FSE_updateState(&seqState->stateLL, &seqState->DStream); /* <= 9 bits */
dc22844b Nick Terrell 2017-07-20 996 FSE_updateState(&seqState->stateML, &seqState->DStream); /* <= 9 bits */
dc22844b Nick Terrell 2017-07-20 997 if (ZSTD_32bits())
dc22844b Nick Terrell 2017-07-20 998 BIT_reloadDStream(&seqState->DStream); /* <= 18 bits */
dc22844b Nick Terrell 2017-07-20 999 FSE_updateState(&seqState->stateOffb, &seqState->DStream); /* <= 8 bits */
dc22844b Nick Terrell 2017-07-20 1000
dc22844b Nick Terrell 2017-07-20 @1001 return seq;
dc22844b Nick Terrell 2017-07-20 1002 }
dc22844b Nick Terrell 2017-07-20 1003

:::::: The code at line 1001 was first introduced by commit
:::::: dc22844bd66de07e2ff858aaebfe678b94df529c lib: Add zstd modules

:::::: TO: Nick Terrell <terrelln@xxxxxx>
:::::: CC: 0day robot <fengguang.wu@xxxxxxxxx>

---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation

Attachment: .config.gz
Description: application/gzip