mirror of
https://github.com/facebook/zstd.git
synced 2025-10-06 00:04:13 -04:00
Merge pull request #1748 from terrelln/cover-deadlock
[dictBuilder] Fix deadlock in *COVER error case
This commit is contained in:
commit
e9c0fc12d2
@ -919,13 +919,12 @@ void COVER_best_finish(COVER_best_t *best, ZDICT_cover_params_t parameters,
|
||||
}
|
||||
}
|
||||
/* Save the dictionary, parameters, and size */
|
||||
if (!dict) {
|
||||
return;
|
||||
if (dict) {
|
||||
memcpy(best->dict, dict, dictSize);
|
||||
best->dictSize = dictSize;
|
||||
best->parameters = parameters;
|
||||
best->compressedSize = compressedSize;
|
||||
}
|
||||
memcpy(best->dict, dict, dictSize);
|
||||
best->dictSize = dictSize;
|
||||
best->parameters = parameters;
|
||||
best->compressedSize = compressedSize;
|
||||
}
|
||||
if (liveJobs == 0) {
|
||||
ZSTD_pthread_cond_broadcast(&best->cond);
|
||||
|
@ -526,6 +526,15 @@ $ZSTD -o tmpDict --train "$TESTDIR"/*.c "$PRGDIR"/*.c
|
||||
test -f tmpDict
|
||||
$ZSTD --train "$TESTDIR"/*.c "$PRGDIR"/*.c
|
||||
test -f dictionary
|
||||
println "- Test dictionary training fails"
|
||||
echo "000000000000000000000000000000000" > tmpz
|
||||
$ZSTD --train tmpz tmpz tmpz tmpz tmpz tmpz tmpz tmpz tmpz && die "Dictionary training should fail : source is all zeros"
|
||||
if [ -n "$hasMT" ]
|
||||
then
|
||||
$ZSTD --train -T0 tmpz tmpz tmpz tmpz tmpz tmpz tmpz tmpz tmpz && die "Dictionary training should fail : source is all zeros"
|
||||
println "- Create dictionary with multithreading enabled"
|
||||
$ZSTD --train -T0 "$TESTDIR"/*.c "$PRGDIR"/*.c -o tmpDict
|
||||
fi
|
||||
rm tmp* dictionary
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user