diff --git a/0001-Only-permit-one-thread-at-a-time-in-addFileToTag.patch b/0001-Only-permit-one-thread-at-a-time-in-addFileToTag.patch new file mode 100644 index 0000000..540d440 --- /dev/null +++ b/0001-Only-permit-one-thread-at-a-time-in-addFileToTag.patch @@ -0,0 +1,43 @@ +From 526641ceeca12fbaa878401f8e65d17f240a9ae5 Mon Sep 17 00:00:00 2001 +From: Panu Matilainen +Date: Tue, 11 Jun 2019 10:50:01 +0300 +Subject: [PATCH] Only permit one thread at a time in addFileToTag() + +When creating packages in parallel, more than one thread can call +this at once. As it's modifying global macro state to update file +name and line number, things will get garbled if we permit more than +one thread. + +While this is necessary for the above reason, and should fix #742, +it shouldn't crash even without this so there's probably something +else wrong too. + +Closes: #742 +--- + build/pack.c | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/build/pack.c b/build/pack.c +index 447e3ec94..ab72750be 100644 +--- a/build/pack.c ++++ b/build/pack.c +@@ -113,6 +113,8 @@ static rpmRC addFileToTag(rpmSpec spec, const char * file, + if (file == NULL) + return RPMRC_OK; + ++ #pragma omp critical ++ { + fn = rpmGetPath("%{_builddir}/%{?buildsubdir:%{buildsubdir}/}", file, NULL); + + f = fopen(fn, "r"); +@@ -151,6 +153,7 @@ exit: + } + free(fn); + freeStringBuf(sb); ++ } /* omp critical */ + + return rc; + } +-- +2.22.0 + diff --git a/rpm.spec b/rpm.spec index 519cbee..bb7a4a5 100644 --- a/rpm.spec +++ b/rpm.spec @@ -21,7 +21,7 @@ %global rpmver 4.14.90 %global snapver git14653 -%global rel 10 +%global rel 11 %global srcver %{version}%{?snapver:-%{snapver}} %global srcdir %{?snapver:testing}%{!?snapver:%{name}-%(echo %{version} | cut -d'.' -f1-2).x} @@ -50,7 +50,8 @@ Patch5: rpm-4.12.0-rpm2cpio-hack.patch # https://github.com/rpm-software-management/rpm/pull/473 Patch6: 0001-find-debuginfo.sh-decompress-DWARF-compressed-ELF-se.patch # https://github.com/rpm-software-management/rpm/issues/742 -Patch7: 0001-Revert-Run-binary-package-generation-in-parallel-thr.patch +#Patch7: 0001-Revert-Run-binary-package-generation-in-parallel-thr.patch +Patch7: 0001-Only-permit-one-thread-at-a-time-in-addFileToTag.patch # Patches already upstream: