mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-04-30 03:40:34 +02:00
Fix possible deadlock in 'scm_sigaction_for_thread'.
Fixes <https://bugs.gnu.org/64666>. * libguile/scmsigs.c (scm_sigaction_for_thread): Swap the 'scm_dynwind_block_asyncs' and 'scm_i_dynwind_pthread_mutex_lock' calls. * NEWS: Update.
This commit is contained in:
parent
896960dade
commit
85520354a8
2 changed files with 8 additions and 2 deletions
2
NEWS
2
NEWS
|
@ -31,6 +31,8 @@ the compiler reports it as "possibly unused".
|
||||||
(<https://bugs.gnu.org/62501>)
|
(<https://bugs.gnu.org/62501>)
|
||||||
** Fix 'system*' with non-file input/output/error port
|
** Fix 'system*' with non-file input/output/error port
|
||||||
(<https://bugs.gnu.org/63024>)
|
(<https://bugs.gnu.org/63024>)
|
||||||
|
** Fix possible deadlock in 'sigaction' (aka. 'scm_sigaction_for_thread')
|
||||||
|
(<https://bugs.gnu.org/64666>)
|
||||||
** Hashing of UTF-8 symbols with non-ASCII characters avoids corruption
|
** Hashing of UTF-8 symbols with non-ASCII characters avoids corruption
|
||||||
(<https://bugs.gnu.org/56413>)
|
(<https://bugs.gnu.org/56413>)
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* Copyright 1995-2002,2004,2006-2009,2011,2013-2014,2017-2018
|
/* Copyright 1995-2002,2004,2006-2009,2011,2013-2014,2017-2018,2023
|
||||||
Free Software Foundation, Inc.
|
Free Software Foundation, Inc.
|
||||||
|
|
||||||
This file is part of Guile.
|
This file is part of Guile.
|
||||||
|
@ -336,8 +336,12 @@ SCM_DEFINE (scm_sigaction_for_thread, "sigaction", 1, 3, 0,
|
||||||
scm_i_ensure_signal_delivery_thread ();
|
scm_i_ensure_signal_delivery_thread ();
|
||||||
|
|
||||||
scm_dynwind_begin (0);
|
scm_dynwind_begin (0);
|
||||||
scm_i_dynwind_pthread_mutex_lock (&signal_handler_lock);
|
|
||||||
|
/* Among the pending asyncs, there might be signal handlers that will
|
||||||
|
call this very function. Thus, to avoid deadlocks, block asyncs
|
||||||
|
before grabbing SIGNAL_HANDLER_LOCK. */
|
||||||
scm_dynwind_block_asyncs ();
|
scm_dynwind_block_asyncs ();
|
||||||
|
scm_i_dynwind_pthread_mutex_lock (&signal_handler_lock);
|
||||||
|
|
||||||
old_handler = SCM_SIMPLE_VECTOR_REF (*signal_handlers, csig);
|
old_handler = SCM_SIMPLE_VECTOR_REF (*signal_handlers, csig);
|
||||||
if (SCM_UNBNDP (handler))
|
if (SCM_UNBNDP (handler))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue