From c0733ffe99fffec437696fcd35807af32b96ab05 Mon Sep 17 00:00:00 2001 From: Roman Rakus Date: Apr 23 2012 14:29:42 +0000 Subject: Don't call malloc in signal handler bugzilla: #800473 Signed-off-by: Roman Rakus Conflicts: bash.spec Signed-off-by: Roman Rakus --- diff --git a/bash-4.1-defer-sigchld-trap.patch b/bash-4.1-defer-sigchld-trap.patch new file mode 100644 index 0000000..8ff26af --- /dev/null +++ b/bash-4.1-defer-sigchld-trap.patch @@ -0,0 +1,30 @@ +diff -pruN bash-4.1/jobs.c bash-4.1.patched/jobs.c +--- bash-4.1/jobs.c 2009-11-30 03:42:05.000000000 +0530 ++++ bash-4.1.patched/jobs.c 2012-03-06 16:44:15.706595703 +0530 +@@ -3037,6 +3037,7 @@ waitchld (wpid, block) + PROCESS *child; + pid_t pid; + int call_set_current, last_stopped_job, job, children_exited, waitpid_flags; ++ int called_from_sighand = sigchld; + static int wcontinued = WCONTINUED; /* run-time fix for glibc problem */ + + call_set_current = children_exited = 0; +@@ -3161,7 +3162,17 @@ waitchld (wpid, block) + longjmp (wait_intr_buf, 1); + } + +- run_sigchld_trap (children_exited); ++ /* Queue up the trap handler if we're called directly from within the ++ signal handler. */ ++ if (called_from_sighand) ++ { ++ int i = children_exited; ++ interrupt_immediately = 0; ++ while (i--) ++ trap_handler (SIGCHLD); ++ } ++ else ++ run_sigchld_trap (children_exited); + } + + /* We have successfully recorded the useful information about this process diff --git a/bash.spec b/bash.spec index 294cb0a..a0d297a 100644 --- a/bash.spec +++ b/bash.spec @@ -6,7 +6,7 @@ Version: %{baseversion}%{patchleveltag} Name: bash Summary: The GNU Bourne Again shell -Release: 1%{?dist} +Release: 2%{?dist} Group: System Environment/Shells License: GPLv3+ Url: http://www.gnu.org/software/bash @@ -79,6 +79,9 @@ Patch120: bash-4.2-rc2-logout.patch # Static analyzis shows some issues in bash-2.05a-interpreter.patch Patch121: bash-4.2-coverity.patch +# Don't call malloc in signal handler +Patch122: bash-4.1-defer-sigchld-trap.patch + BuildRequires: texinfo bison BuildRequires: ncurses-devel BuildRequires: autoconf, gettext @@ -151,6 +154,7 @@ This package contains documentation files for %{name}. %patch119 -p1 -b .broken_pipe %patch120 -p1 -b .logout %patch121 -p1 -b .coverity +%patch122 -p1 -b .defer_sigchld_trap echo %{version} > _distribution echo %{release} > _patchlevel @@ -343,6 +347,9 @@ end #%doc doc/*.ps doc/*.0 doc/*.html doc/article.txt %changelog +* Mon Apr 23 2012 Roman Rakus - 4.2.24-2 +- Don't call malloc in signal handler + * Tue Mar 13 2012 Roman Rakus - 4.2.24-1 - Patchlevel 24