[Rpm-maint] [rpm-software-management/rpm] Fix data race in packageBinaries() function (#1264)
Tom Stellard
notifications at github.com
Tue Jun 9 22:29:21 UTC 2020
The pkg variable used in the parallel loop was declared outside
of the omp parallel construct, so it was shared among tasks. This
had the potential to cause a data race. The gcc openmp implementation
did not hit this problem, but I uncovered it while trying to compile with
clang. My best guess as to what was happening is that after the last
task was launched, all tasks had the same value of pkg and were operating
on the same data at the same time.
This patch marks the variable as firstprivate, so each tasks gets its
own copy of the variable.
You can view, comment on, or merge this pull request online at:
https://github.com/rpm-software-management/rpm/pull/1264
-- Commit Summary --
* Fix data race in packageBinaries() function
-- File Changes --
M build/pack.c (2)
-- Patch Links --
https://github.com/rpm-software-management/rpm/pull/1264.patch
https://github.com/rpm-software-management/rpm/pull/1264.diff
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/1264
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rpm.org/pipermail/rpm-maint/attachments/20200609/af1b6237/attachment.html>
More information about the Rpm-maint
mailing list