public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
From: Panu Matilainen <pmatilai@redhat.com>
To: git-commits@fedoraproject.org
Subject: [rpms/rpm] pmatilai-v6: - fix broken logic in depgen collector, hopefully curing #675002
Date: Mon, 23 Nov 2026 09:26:59 GMT [thread overview]
Message-ID: <179542601962.1.8265510099274907210.rpms-rpm-e50e6cafd177@fedoraproject.org> (raw)
A new commit has been pushed.
Repo : rpms/rpm
Branch : pmatilai-v6
Commit : e50e6cafd177406022089edd860fbb6840e25149
Author : Panu Matilainen <pmatilai@redhat.com>
Date : 2011-02-21T08:58:59+02:00
Stats : +58/-1 in 2 file(s)
URL : https://src.fedoraproject.org/rpms/rpm/c/e50e6cafd177406022089edd860fbb6840e25149?branch=pmatilai-v6
Log:
- fix broken logic in depgen collector, hopefully curing #675002
---
diff --git a/rpm-4.9.0-rc1-getoutput.patch b/rpm-4.9.0-rc1-getoutput.patch
new file mode 100644
index 0000000..6ded3cc
--- /dev/null
+++ b/rpm-4.9.0-rc1-getoutput.patch
@@ -0,0 +1,51 @@
+commit 771993d1fc6db95ae92ebe0200f7003554ea32da
+Author: Panu Matilainen <pmatilai@redhat.com>
+Date: Mon Feb 21 08:47:52 2011 +0200
+
+ Fix braindamage in the depgen helper collector loop (RhBug:675002)
+ - Read any remaining data before exiting on SIGCHLD
+ - Only perform one read() per loop, otherwise it could block
+ - Handle EINTR while read()'ing
+
+diff --git a/build/rpmfc.c b/build/rpmfc.c
+index 56bcb12..29334e2 100644
+--- a/build/rpmfc.c
++++ b/build/rpmfc.c
+@@ -272,12 +272,6 @@ static StringBuf getOutputFrom(ARGV_t argv,
+ break;
+ }
+
+- /* Child exited, we're done */
+- if (FD_ISSET(sigpipe, &ibits)) {
+- while (read(sigpipe, buf, sizeof(buf)) > 0) {};
+- break;
+- }
+-
+ /* Write data to child */
+ if (writeBytesLeft > 0 && FD_ISSET(toProg[1], &obits)) {
+ size_t nb = (1024 < writeBytesLeft) ? 1024 : writeBytesLeft;
+@@ -293,11 +287,20 @@ static StringBuf getOutputFrom(ARGV_t argv,
+
+ /* Read when we get data back from the child */
+ if (FD_ISSET(fromProg[0], &ibits)) {
+- int nbr;
+- while ((nbr = read(fromProg[0], buf, sizeof(buf)-1)) > 0) {
+- buf[nbr] = '\0';
+- appendStringBuf(readBuff, buf);
++ int nbr = read(fromProg[0], buf, sizeof(buf)-1);
++ if (nbr < 0 && errno == EINTR) continue;
++ if (nbr < 0) {
++ myerrno = errno;
++ break;
+ }
++ buf[nbr] = '\0';
++ appendStringBuf(readBuff, buf);
++ }
++
++ /* Child exited, we're done */
++ if (FD_ISSET(sigpipe, &ibits)) {
++ while (read(sigpipe, buf, sizeof(buf)) > 0) {};
++ break;
+ }
+ }
+
diff --git a/rpm.spec b/rpm.spec
index 42a174d..1753d53 100644
--- a/rpm.spec
+++ b/rpm.spec
@@ -22,7 +22,7 @@
Summary: The RPM package management system
Name: rpm
Version: %{rpmver}
-Release: %{?snapver:0.%{snapver}.}1%{?dist}
+Release: %{?snapver:0.%{snapver}.}2%{?dist}
Group: System Environment/Base
Url: http://www.rpm.org/
Source0: http://rpm.org/releases/rpm-4.8.x/%{name}-%{srcver}.tar.bz2
@@ -41,6 +41,7 @@ Patch3: rpm-4.8.0-no-man-dirs.patch
Patch4: rpm-4.8.1-use-gpg2.patch
# Patches already in upstream
+Patch100: rpm-4.9.0-rc1-getoutput.patch
# These are not yet upstream
Patch301: rpm-4.6.0-niagara.patch
@@ -206,6 +207,8 @@ packages on a system.
%patch3 -p1 -b .no-man-dirs
%patch4 -p1 -b .use-gpg2
+%patch100 -p1 -b .getoutput
+
%patch301 -p1 -b .niagara
%patch302 -p1 -b .geode
@@ -415,6 +418,9 @@ exit 0
%doc COPYING doc/librpm/html/*
%changelog
+* Mon Feb 21 2011 Panu Matilainen <pmatilai@redhat.com> - 4.9.0-0.rc1.2
+- fix broken logic in depgen collector, hopefully curing #675002
+
* Tue Feb 15 2011 Panu Matilainen <pmatilai@redhat.com> - 4.9.0-0.rc1.1
- update to 4.9.0-rc1
- drop upstream patches
reply other threads:[~2026-11-23 9:26 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=179542601962.1.8265510099274907210.rpms-rpm-e50e6cafd177@fedoraproject.org \
--to=pmatilai@redhat.com \
--cc=git-commits@fedoraproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox