Fix a crash with invalid PCOMPRESS_CHUNK_HASH_GLOBAL.

Update testcase to correctly detect core files.
This commit is contained in:
Moinak Ghosh 2013-05-26 23:38:10 +05:30
parent ddaa3b6b6d
commit e9ce7a5ed2
2 changed files with 8 additions and 1 deletions

View file

@ -228,7 +228,7 @@ create_dedupe_context(uint64_t chunksize, uint64_t real_chunksize, int rab_blk_s
if (get_checksum_props(ck, &chunk_cksum, &cksum_bytes, &mac_bytes, 1) != 0 ||
strcmp(ck, "CRC64") == 0) {
fprintf(stderr, "Invalid PCOMPRESS_CHUNK_HASH_GLOBAL. Reverting to default.\n");
chunk_cksum = -1;
chunk_cksum = 0;
}
}
if (chunk_cksum == 0) {

View file

@ -31,6 +31,12 @@ then
rm -f ${tstf}.pz
fi
unset PCOMPRESS_CHUNK_HASH_GLOBAL
if [ -f core* ]
then
echo "FATAL: Compression crashed"
rm -f ${tstf}.pz
rm -f core*
fi
for feat in "-L" "-L -D" "-L -D -E -M -C" "-L -B5" "-L -D -E -B2" "-F" "-F -L"
do
@ -47,6 +53,7 @@ do
then
echo "FATAL: Compression crashed"
rm -f ${tstf}.pz
rm -f core*
break
fi
rm -f ${tstf}.pz