aboutsummaryrefslogtreecommitdiffstats
path: root/src/ChangeLog
diff options
context:
space:
mode:
authorPaul Eggert2012-10-01 15:12:44 -0700
committerPaul Eggert2012-10-01 15:12:44 -0700
commitaa1ba90e4a95542c83cf636de3bc67e8fb23bad3 (patch)
tree1407a999bbc11bf54aaeba40764d6a75565db182 /src/ChangeLog
parentace917bddb2ed2448a97ddf279445bb581c5cd32 (diff)
downloademacs-aa1ba90e4a95542c83cf636de3bc67e8fb23bad3.tar.gz
emacs-aa1ba90e4a95542c83cf636de3bc67e8fb23bad3.zip
Fix a malloc race condition involving strsignal.
A signal can arrive in the middle of a malloc, and Emacs's signal handler can invoke strsignal, which can invoke malloc, which is not portable. This race condition bug makes Emacs hang on GNU/Linux. Fix it by altering the signal handler so that it does not invoke strsignal. * emacs.c (shut_down_emacs): Use safe_strsignal, not strsignal. * process.c (status_message): Use const pointer, in case strsignal is #defined to safe_strsignal. * sysdep.c (sys_siglist, init_signals): Always define and initialize a substitute sys_siglist if the system does not define one, even if HAVE_STRSIGNAL. (safe_strsignal): Rename from strsignal. Always define, using sys_siglist. Return a const pointer. * syssignal.h (safe_strsignal): New decl. (strsignal) [!HAVE_STRSIGNAL]: Define in terms of safe_strsignal.
Diffstat (limited to 'src/ChangeLog')
-rw-r--r--src/ChangeLog19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 7061038fdec..3a94af80c30 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,22 @@
12012-10-01 Paul Eggert <eggert@cs.ucla.edu>
2
3 Fix a malloc race condition involving strsignal.
4 A signal can arrive in the middle of a malloc, and Emacs's signal
5 handler can invoke strsignal, which can invoke malloc, which is
6 not portable. This race condition bug makes Emacs hang on GNU/Linux.
7 Fix it by altering the signal handler so that it does not invoke
8 strsignal.
9 * emacs.c (shut_down_emacs): Use safe_strsignal, not strsignal.
10 * process.c (status_message): Use const pointer, in case strsignal
11 is #defined to safe_strsignal.
12 * sysdep.c (sys_siglist, init_signals): Always define and
13 initialize a substitute sys_siglist if the system does not define
14 one, even if HAVE_STRSIGNAL.
15 (safe_strsignal): Rename from strsignal. Always define,
16 using sys_siglist. Return a const pointer.
17 * syssignal.h (safe_strsignal): New decl.
18 (strsignal) [!HAVE_STRSIGNAL]: Define in terms of safe_strsignal.
19
12012-10-01 Eli Zaretskii <eliz@gnu.org> 202012-10-01 Eli Zaretskii <eliz@gnu.org>
2 21
3 * w32proc.c (timer_loop): Fix code that waits for timer 22 * w32proc.c (timer_loop): Fix code that waits for timer