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 +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 65d74a5..aa636cd 100644 --- a/perl.spec +++ b/perl.spec @@ -88,6 +88,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 @@ -1253,6 +1257,7 @@ tarball from perl.org. %patch11 -p1 %patch12 -p1 %patch13 -p1 +%patch14 -p1 #copy the example script cp -a %{SOURCE5} . @@ -1456,6 +1461,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 @@ -2415,6 +2421,8 @@ sed \ %changelog * Mon Feb 06 2012 Petr Pisar - 4:5.14.2-211 - Fix searching for Unicode::Collate::Locale data (bug #756118) +- Run safe signal handlers before returning from sigsuspend() and pause() + (bug #771228) * Tue Jan 10 2012 Paul Howarth - 4:5.14.2-210 - Rebuild again now that perl dependency generator is fixed (#772632, #772699)