Try fix for omp crash

Signed-off-by: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
This commit is contained in:
Igor Gnatenko 2019-06-11 12:48:43 +02:00
parent c065605b86
commit 7b81210f7b
No known key found for this signature in database
GPG Key ID: 695714BD1BBC5F4C
2 changed files with 46 additions and 2 deletions

View File

@ -0,0 +1,43 @@
From 526641ceeca12fbaa878401f8e65d17f240a9ae5 Mon Sep 17 00:00:00 2001
From: Panu Matilainen <pmatilai@redhat.com>
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

View File

@ -21,7 +21,7 @@
%global rpmver 4.14.90 %global rpmver 4.14.90
%global snapver git14653 %global snapver git14653
%global rel 10 %global rel 11
%global srcver %{version}%{?snapver:-%{snapver}} %global srcver %{version}%{?snapver:-%{snapver}}
%global srcdir %{?snapver:testing}%{!?snapver:%{name}-%(echo %{version} | cut -d'.' -f1-2).x} %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 # https://github.com/rpm-software-management/rpm/pull/473
Patch6: 0001-find-debuginfo.sh-decompress-DWARF-compressed-ELF-se.patch Patch6: 0001-find-debuginfo.sh-decompress-DWARF-compressed-ELF-se.patch
# https://github.com/rpm-software-management/rpm/issues/742 # 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: # Patches already upstream: