]> git.ipfire.org Git - thirdparty/zstd.git/commit
[contrib/pzstd] Prevent hangs when there are errors
authorSean Bartell <yotann@yotann.org>
Thu, 20 Jun 2024 20:52:43 +0000 (15:52 -0500)
committerNick Terrell <nickrterrell@gmail.com>
Mon, 13 Jan 2025 22:24:41 +0000 (17:24 -0500)
commit80af41e08a630946a75a5cda9e4cdf192247f20a
tree25cb815717d1294022e2b2a16da92f94a084af9c
parenta610550e2c05cd08842e173bbeb830f596fdfaeb
[contrib/pzstd] Prevent hangs when there are errors

When two threads are using a WorkQueue and the reader thread exits due
to an error, it must call WorkQueue::finish() to wake up the writer
thread. Otherwise, if the queue is full and the writer thread is waiting
for a free slot, it could hang forever.

This can happen in pratice when decompressing a large, corrupted file
that does not contain pzstd skippable frames.
contrib/pzstd/Pzstd.cpp
contrib/pzstd/utils/WorkQueue.h