From 0052ff9134ca1323210d6917b61e6501e2b5cf54 Mon Sep 17 00:00:00 2001 From: Panu Matilainen Date: Thu, 27 Jun 2019 11:08:03 +0300 Subject: [PATCH] Rebase to 4.15.0 beta --- .gitignore | 1 + ...-trying-to-kill-a-non-existent-proce.patch | 33 ------------- ...-local-storage-it-s-a-scarce-resourc.patch | 46 ----------------- ...e-of-thread-local-storage-RhBug-1722.patch | 49 ------------------- ...one-thread-at-a-time-in-addFileToTag.patch | 43 ---------------- ...imit-copying-changelog-one-at-a-time.patch | 28 ----------- rpm.spec | 17 +++---- sources | 2 +- 8 files changed, 8 insertions(+), 211 deletions(-) delete mode 100644 0001-Don-t-fail-build-trying-to-kill-a-non-existent-proce.patch delete mode 100644 0001-Don-t-hog-thread-local-storage-it-s-a-scarce-resourc.patch delete mode 100644 0001-Fix-excessive-use-of-thread-local-storage-RhBug-1722.patch delete mode 100644 0001-Only-permit-one-thread-at-a-time-in-addFileToTag.patch delete mode 100644 0001-build-Limit-copying-changelog-one-at-a-time.patch diff --git a/.gitignore b/.gitignore index 0d98ec5..2e8421e 100644 --- a/.gitignore +++ b/.gitignore @@ -33,3 +33,4 @@ /rpm-4.14.2.tar.bz2 /rpm-4.14.2.1.tar.bz2 /rpm-4.14.90-git14653.tar.bz2 +/rpm-4.15.0-beta.tar.bz2 diff --git a/0001-Don-t-fail-build-trying-to-kill-a-non-existent-proce.patch b/0001-Don-t-fail-build-trying-to-kill-a-non-existent-proce.patch deleted file mode 100644 index a025973..0000000 --- a/0001-Don-t-fail-build-trying-to-kill-a-non-existent-proce.patch +++ /dev/null @@ -1,33 +0,0 @@ -From c96c622483589256fd4a6925a68eb7a7d67867e5 Mon Sep 17 00:00:00 2001 -Message-Id: -From: Panu Matilainen -Date: Thu, 13 Jun 2019 12:41:02 +0300 -Subject: [PATCH] Don't fail build trying to kill a non-existent process - (RhBug:1720143) - -The job killer introduced at 06953879d3e0b1e9a434979056d1225ab4646142 -failed to take into account the fact that the processes *can* die between -us grabbing the pids and actually killing them, and that trying to kill -a non-existent process will cause a script running with -e to actually -terminate an error. So we end up failing a successful build by trying -to kill process that exited on its own, ugh :) ---- - macros.in | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/macros.in b/macros.in -index 724e53a19..50fe044c1 100644 ---- a/macros.in -+++ b/macros.in -@@ -816,7 +816,7 @@ package or when debugging this package.\ - #%___build_body %{nil} - %___build_post \ - RPM_EC=$?\ -- for pid in $(jobs -p); do kill -9 ${pid}; done\ -+ for pid in $(jobs -p); do kill -9 ${pid} || continue; done\ - exit ${RPM_EC}\ - %{nil} - --- -2.21.0 - diff --git a/0001-Don-t-hog-thread-local-storage-it-s-a-scarce-resourc.patch b/0001-Don-t-hog-thread-local-storage-it-s-a-scarce-resourc.patch deleted file mode 100644 index fdf0ad5..0000000 --- a/0001-Don-t-hog-thread-local-storage-it-s-a-scarce-resourc.patch +++ /dev/null @@ -1,46 +0,0 @@ -From bc79f3533882dfcffb4dd018e2d1a56691c99248 Mon Sep 17 00:00:00 2001 -Message-Id: -From: Panu Matilainen -Date: Thu, 20 Jun 2019 13:50:23 +0300 -Subject: [PATCH] Don't hog thread local storage, it's a scarce resource - (RhBug:1722181) - -Commit 6487e873f3169c2bffbd52808b6c749e6c104ff5 introduced a thread local -BUFSIZ static buffer for header format error reporting but thread local -storage is apparently a rather scarce resource (on some architectures -more so than others) and this is highly excessive use of that resource. -Use a thread local pointer to dynamically (re)allocated buffer instead. ---- - lib/headerfmt.c | 8 ++++---- - 1 file changed, 4 insertions(+), 4 deletions(-) - -diff --git a/lib/headerfmt.c b/lib/headerfmt.c -index 1f6390b5e..7c0da1bd9 100644 ---- a/lib/headerfmt.c -+++ b/lib/headerfmt.c -@@ -221,18 +221,18 @@ static char * hsaReserve(headerSprintfArgs hsa, size_t need) - RPM_GNUC_PRINTF(2, 3) - static void hsaError(headerSprintfArgs hsa, const char *fmt, ...) - { -- /* Use thread local static buffer as headerFormat() errmsg arg is const */ -- static __thread char errbuf[BUFSIZ]; -+ /* Use thread local buffer as headerFormat() errmsg arg is const */ -+ static __thread char *errbuf = NULL; - - if (fmt == NULL) { - hsa->errmsg = NULL; - } else { - va_list ap; - -+ free(errbuf); - va_start(ap, fmt); -- vsnprintf(errbuf, sizeof(errbuf), fmt, ap); -+ rvasprintf(&errbuf, fmt, ap); - va_end(ap); -- - hsa->errmsg = errbuf; - } - } --- -2.21.0 - diff --git a/0001-Fix-excessive-use-of-thread-local-storage-RhBug-1722.patch b/0001-Fix-excessive-use-of-thread-local-storage-RhBug-1722.patch deleted file mode 100644 index ba74528..0000000 --- a/0001-Fix-excessive-use-of-thread-local-storage-RhBug-1722.patch +++ /dev/null @@ -1,49 +0,0 @@ -From b39bd1965ed2fdeadb427648ec7e911613c8398f Mon Sep 17 00:00:00 2001 -Message-Id: -From: Panu Matilainen -Date: Thu, 20 Jun 2019 15:07:12 +0300 -Subject: [PATCH] Fix excessive use of thread local storage (RhBug:1722181), - part II - -This essentially reverts commit ff43d03d1f9686c9ffa9232a64e253783309feb5 -which made these all thread local. It might not be quite right, but then -using TLS is not sensible either - threads have their own signal *mask*, -but disposition is global, and most of what we do here is global anyway. -In addition, the signal queue is only enabled in places where threads -are not used (or would not be safe anyhow) so reverting for now seems -the lesser evil. ---- - rpmio/rpmsq.c | 10 +++++----- - 1 file changed, 5 insertions(+), 5 deletions(-) - -diff --git a/rpmio/rpmsq.c b/rpmio/rpmsq.c -index d157514e9..249a204b3 100644 ---- a/rpmio/rpmsq.c -+++ b/rpmio/rpmsq.c -@@ -16,9 +16,9 @@ - - #include "debug.h" - --static __thread int disableInterruptSafety; --static __thread sigset_t rpmsqCaught; --static __thread sigset_t rpmsqActive; -+static int disableInterruptSafety; -+static sigset_t rpmsqCaught; -+static sigset_t rpmsqActive; - - typedef struct rpmsig_s * rpmsig; - -@@ -171,8 +171,8 @@ int rpmsqPoll(void) - - int rpmsqBlock(int op) - { -- static __thread sigset_t oldMask; -- static __thread int blocked = 0; -+ static sigset_t oldMask; -+ static int blocked = 0; - sigset_t newMask; - int ret = 0; - --- -2.21.0 - 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 deleted file mode 100644 index 540d440..0000000 --- a/0001-Only-permit-one-thread-at-a-time-in-addFileToTag.patch +++ /dev/null @@ -1,43 +0,0 @@ -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/0001-build-Limit-copying-changelog-one-at-a-time.patch b/0001-build-Limit-copying-changelog-one-at-a-time.patch deleted file mode 100644 index 5d21694..0000000 --- a/0001-build-Limit-copying-changelog-one-at-a-time.patch +++ /dev/null @@ -1,28 +0,0 @@ -From 8aab33f69c9d78b6d4d4e79ba661ae01cd970f2b Mon Sep 17 00:00:00 2001 -From: Igor Gnatenko -Date: Tue, 11 Jun 2019 14:22:07 +0200 -Subject: [PATCH] build: Limit copying changelog one at a time - -Getting header content in multiple threads is causing problems since it -can (and apparently does) change internal state. - -Signed-off-by: Igor Gnatenko ---- - build/pack.c | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/build/pack.c b/build/pack.c -index ab72750be..e6cec1816 100644 ---- a/build/pack.c -+++ b/build/pack.c -@@ -713,6 +713,7 @@ static rpmRC packageBinary(rpmSpec spec, Package pkg, const char *cookie, int ch - } - - /* Copy changelog from src rpm */ -+ #pragma omp critical - headerCopyTags(spec->sourcePackage->header, pkg->header, copyTags); - - headerPutString(pkg->header, RPMTAG_RPMVERSION, VERSION); --- -2.22.0 - diff --git a/rpm.spec b/rpm.spec index 64b0e84..2764e38 100644 --- a/rpm.spec +++ b/rpm.spec @@ -19,9 +19,9 @@ %define rpmhome /usr/lib/rpm -%global rpmver 4.14.90 -%global snapver git14653 -%global rel 18 +%global rpmver 4.15.0 +%global snapver beta +%global rel 1 %global srcver %{version}%{?snapver:-%{snapver}} %global srcdir %{?snapver:testing}%{!?snapver:%{name}-%(echo %{version} | cut -d'.' -f1-2).x} @@ -51,14 +51,6 @@ Patch5: rpm-4.12.0-rpm2cpio-hack.patch Patch6: 0001-find-debuginfo.sh-decompress-DWARF-compressed-ELF-se.patch # Patches already upstream: -# https://github.com/rpm-software-management/rpm/commit/526641ceeca12fbaa878401f8e65d17f240a9ae5 -Patch100: 0001-Only-permit-one-thread-at-a-time-in-addFileToTag.patch -# https://github.com/rpm-software-management/rpm/pull/745 -Patch101: 0001-build-Limit-copying-changelog-one-at-a-time.patch -Patch102: 0001-Don-t-fail-build-trying-to-kill-a-non-existent-proce.patch -# https://github.com/rpm-software-management/rpm/pull/759 -Patch103: 0001-Don-t-hog-thread-local-storage-it-s-a-scarce-resourc.patch -Patch104: 0001-Fix-excessive-use-of-thread-local-storage-RhBug-1722.patch # These are not yet upstream Patch906: rpm-4.7.1-geode-i686.patch @@ -545,6 +537,9 @@ make check || (cat tests/rpmtests.log; exit 0) %doc doc/librpm/html/* %changelog +* Thu Jun 27 2019 Panu Matilainen - 4.15.0-0.beta.1 +- Rebase to 4.15.0 beta + * Thu Jun 20 2019 Panu Matilainen - 4.14.90-0.git14653.18 - Fix excessive TLS use, part II (#1722181) diff --git a/sources b/sources index 6ab2eae..1346f44 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (rpm-4.14.90-git14653.tar.bz2) = 4c4051c405378ace00704991ab4204e59a7ca05a5b24d6f630244d8a27cb02aa5b51b7d029ca1f65e6795ca0f8a0da919ac07b103f0ec0dec23771b11c9d1c2a +SHA512 (rpm-4.15.0-beta.tar.bz2) = 4aaa4cc43297ed1b75f36b500cf45b0e92cb7a61788a05f20306ecf035b5dca612a6afb46676dcd148458fb3538905ada276dd4c6f1cff5a5de75c7a642262b4