Notification time stamped 2019-11-30 22:18:53 UTC
From 5b99ebb2314b6b19323be489c4a49c40585b034d Mon Sep 17 00:00:00 2001 From: Jerry James loganjerry@gmail.com Date: Nov 30 2019 22:18:37 +0000 Subject: Add a patch to eliminate a race condition in thread_pool.
---
diff --git a/0002-Eliminate-race-condition-in-thread-pool.patch b/0002-Eliminate-race-condition-in-thread-pool.patch new file mode 100644 index 0000000..1d6cfc5 --- /dev/null +++ b/0002-Eliminate-race-condition-in-thread-pool.patch @@ -0,0 +1,21 @@ +diff --git a/fplll/io/thread_pool.hpp b/fplll/io/thread_pool.hpp +index c7a4714..350a4e9 100644 +--- a/fplll/io/thread_pool.hpp ++++ b/fplll/io/thread_pool.hpp +@@ -204,13 +204,15 @@ namespace thread_pool { + if (nrthreads < _threads.size()) + { + // decreasing number of active threads ++ std::unique_lockstd::mutex lock(_mutex); + for (std::size_t i = nrthreads; i < _threads.size(); ++i) + *(_threads_stop[i]) = true; + _condition.notify_all(); ++ lock.unlock(); + for (std::size_t i = nrthreads; i < _threads.size(); ++i) + _threads[i]->join(); + +- std::unique_lockstd::mutex lock(_mutex); ++ lock.lock(); + _threads_stop.resize(nrthreads); + _threads.resize(nrthreads); + } diff --git a/libfplll.spec b/libfplll.spec index d0bf7e2..d0ed510 100644 --- a/libfplll.spec +++ b/libfplll.spec @@ -7,6 +7,8 @@ URL: https://github.com/fplll/fplll Source0: https://github.com/fplll/fplll/releases/download/%%7Bversion%7D/fplll-%%7Bve... # https://github.com/fplll/fplll/pull/398 Patch0: 0001-Fix-out-of-bounds-vector-accesses-in-Pruner-enforce.patch +# https://github.com/cr-marcstevens/snippets/pull/1 +Patch1: 0002-Eliminate-race-condition-in-thread-pool.patch
BuildRequires: gcc-c++ BuildRequires: help2man
https://src.fedoraproject.org/rpms/libfplll/c/5b99ebb2314b6b19323be489c4a49c...