Restrict package installation to 1 thread

It is possible that a package contains the same file multiple times.
This leads to possible corruption or installation failure when they are extracted on different threads.
(easy to reproduce with DeS)
This commit is contained in:
Elad Ashkenazi 2022-12-30 22:10:23 +02:00 committed by GitHub
parent 02f35383bd
commit 3250c16cdc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -968,7 +968,7 @@ bool package_reader::extract_data(atomic_t<double>& sync)
atomic_t<usz> entry_indexer = 0;
atomic_t<usz> thread_indexer = 0;
m_bufs.resize(std::min<usz>(utils::get_thread_count(), entries.size()));
m_bufs.resize(std::min<usz>(1 /*utils::get_thread_count()*/, entries.size()));
named_thread_group workers("PKG Installer "sv, std::max<usz>(m_bufs.size(), 1) - 1, [&]()
{