[perl/f16] Run safe signal handlers before returning from sigsuspend

Petr Pisar ppisar at fedoraproject.org
Tue Feb 7 16:08:51 UTC 2012


commit 36b171e0a495c338fa32a074ab3e825a11615a6f
Author: Petr Písař <ppisar at redhat.com>
Date:   Mon Feb 6 14:24:42 2012 +0100

    Run safe signal handlers before returning from sigsuspend

 ...ndlers-must-run-before-sigsuspend-returns.patch |   43 ++++++++++++++++++++
 perl.spec                                          |    8 ++++
 2 files changed, 51 insertions(+), 0 deletions(-)
---
diff --git a/perl-5.14.2-Signal-handlers-must-run-before-sigsuspend-returns.patch b/perl-5.14.2-Signal-handlers-must-run-before-sigsuspend-returns.patch
new file mode 100644
index 0000000..f0b894b
--- /dev/null
+++ b/perl-5.14.2-Signal-handlers-must-run-before-sigsuspend-returns.patch
@@ -0,0 +1,43 @@
+From 38d7c791f597c3d567a70466dc2e48b73ec318bf Mon Sep 17 00:00:00 2001
+From: Leon Timmermans <fawaka at gmail.com>
+Date: Mon, 26 Dec 2011 19:06:54 +0200
+Subject: [PATCH] Signal handlers must run before sigsuspend returns
+
+The whole point of sigsuspend and pause is to wait until a signal has
+arrived, and then return *after* it has been triggered. Currently
+delayed/"safe" signals prevent that from happening, which might cause
+race conditions.
+
+This patch prevents that (as far as possible) by running the signal
+handlers ASAP.
+
+Petr Pisar: Back-ported to 5.14.2.
+---
+ ext/POSIX/POSIX.xs |    4 ++++
+ 1 files changed, 4 insertions(+), 0 deletions(-)
+
+diff --git a/ext/POSIX/POSIX.xs b/ext/POSIX/POSIX.xs
+index 8dc1f5a..4b9779b 100644
+--- a/ext/POSIX/POSIX.xs
++++ b/ext/POSIX/POSIX.xs
+@@ -1550,6 +1550,8 @@ sigaction(sig, optaction, oldaction = 0)
+ SysRet
+ sigpending(sigset)
+ 	POSIX::SigSet		sigset
++    CLEANUP:
++    PERL_ASYNC_CHECK();
+ 
+ SysRet
+ sigprocmask(how, sigset, oldsigset = 0)
+@@ -2019,6 +2021,8 @@ pathconf(filename, name)
+ 
+ SysRet
+ pause()
++    CLEANUP:
++    PERL_ASYNC_CHECK();
+ 
+ SysRet
+ setgid(gid)
+-- 
+1.7.7.6
+
diff --git a/perl.spec b/perl.spec
index d4ef987..904f560 100644
--- a/perl.spec
+++ b/perl.spec
@@ -86,6 +86,10 @@ Patch12:        perl-5.14.2-add-a-couple-missing-LEAVEs-in-perlio_async_run.patc
 # fixed in Unicode-Collate-0.87.
 Patch13:        perl-5.14.2-locale-search-inc.patch
 
+# Run safe signal handlers before returning from sigsuspend() and pause(),
+# rhbz#771228, RT#107216, fixed after 5.15.6.
+Patch14:        perl-5.14.2-Signal-handlers-must-run-before-sigsuspend-returns.patch
+
 # Update some of the bundled modules
 # see http://fedoraproject.org/wiki/Perl/perl.spec for instructions
 
@@ -1132,6 +1136,7 @@ tarball from perl.org.
 %patch11 -p1
 %patch12 -p1
 %patch13 -p1
+%patch14 -p1
 
 #copy the example script
 cp -a %{SOURCE5} .
@@ -1326,6 +1331,7 @@ pushd %{build_archlib}/CORE/
     'Fedora Patch11: Fix leak with non-matching named captures' \
     'Fedora Patch12: Fix interrupted reading' \
     'Fedora Patch13: Fix searching for Unicode::Collate::Locale data' \
+    'Fedora Patch14: Run signal handlers before returning from sigsuspend' \
     %{nil}
 
 rm patchlevel.bak
@@ -2217,6 +2223,8 @@ sed \
 %changelog
 * Mon Feb 06 2012 Petr Pisar <ppisar at redhat.com> - 4:5.14.2-195
 - Fix searching for Unicode::Collate::Locale data (bug #756118)
+- Run safe signal handlers before returning from sigsuspend() and pause()
+  (bug #771228)
 
 * Thu Feb 02 2012 Petr Šabata <contyk at redhat.com> - 4:5.14.2-194
 - Sub-package Socket for IO::Socket::IP


More information about the scm-commits mailing list