public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Zac Medico" <zmedico@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/portage:master commit in: pym/portage/util/_async/
Date: Mon, 14 May 2018 15:37:08 +0000 (UTC)	[thread overview]
Message-ID: <1526312153.b28b01a78e4cc0199111e804af5b56a33319356d.zmedico@gentoo> (raw)

commit:     b28b01a78e4cc0199111e804af5b56a33319356d
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon May 14 15:33:15 2018 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon May 14 15:35:53 2018 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=b28b01a7

ForkProcess: unregister SIGCHLD and wakeup_fd (bug 655656)

In order to prevent forked processes from invoking the parent process's
SIGCHLD handler and writing to wakeup_fd (triggering BlockingIOError),
unregister the SIGCHLD and wakeup_fd.

Bug: https://bugs.gentoo.org/655656
Reported-by: Helmut Jarausch <jarausch <AT> igpm.rwth-aachen.de>

 pym/portage/util/_async/ForkProcess.py | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/pym/portage/util/_async/ForkProcess.py b/pym/portage/util/_async/ForkProcess.py
index 25f72d308..d84e93833 100644
--- a/pym/portage/util/_async/ForkProcess.py
+++ b/pym/portage/util/_async/ForkProcess.py
@@ -37,6 +37,16 @@ class ForkProcess(SpawnProcess):
 				signal.signal(signal.SIGINT, signal.SIG_DFL)
 				signal.signal(signal.SIGTERM, signal.SIG_DFL)
 
+				# Unregister SIGCHLD handler and wakeup_fd for the parent
+				# process's event loop (bug 655656).
+				signal.signal(signal.SIGCHLD, signal.SIG_DFL)
+				try:
+					wakeup_fd = signal.set_wakeup_fd(-1)
+					if wakeup_fd > 0:
+						os.close(wakeup_fd)
+				except (ValueError, OSError):
+					pass
+
 				portage.locks._close_fds()
 				# We don't exec, so use close_fds=False
 				# (see _setup_pipes docstring).


             reply	other threads:[~2018-05-14 15:37 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-14 15:37 Zac Medico [this message]
  -- strict thread matches above, loose matches on Subject: below --
2018-04-30  6:29 [gentoo-commits] proj/portage:master commit in: pym/portage/util/_async/ Zac Medico
2018-04-29 22:24 Zac Medico
2018-04-29  6:09 Zac Medico
2018-04-29  4:12 Zac Medico
2018-04-28 23:29 Zac Medico
2018-04-28 23:20 Zac Medico
2018-04-28 23:08 Zac Medico
2018-04-26  9:37 Zac Medico
2018-04-26  8:06 Zac Medico
2018-04-26  5:49 Zac Medico
2018-04-23  1:03 Zac Medico
2018-04-22 17:50 Zac Medico
2018-04-19  6:28 Zac Medico
2017-02-08  9:39 Zac Medico
2013-07-07  2:17 Zac Medico
2013-01-05 15:20 Zac Medico
2013-01-05  3:41 Zac Medico
2012-12-29  7:45 Zac Medico
2012-10-18  1:24 Zac Medico
2012-10-16  6:51 Zac Medico
2012-10-08 13:49 Zac Medico
2012-10-06  1:54 Zac Medico
2012-10-03 18:56 Zac Medico
2012-10-03 18:39 Zac Medico
2012-10-03 17:40 Zac Medico
2012-10-03 10:19 Zac Medico

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=1526312153.b28b01a78e4cc0199111e804af5b56a33319356d.zmedico@gentoo \
    --to=zmedico@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.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