This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFC] Block all async signals used by gdb when initializing Guile
- From: Doug Evans <xdje42 at gmail dot com>
- To: Eli Zaretskii <eliz at gnu dot org>
- Cc: "gdb-patches at sourceware dot org" <gdb-patches at sourceware dot org>, guile-devel <guile-devel at gnu dot org>
- Date: Sat, 29 Aug 2015 12:20:24 -0700
- Subject: Re: [RFC] Block all async signals used by gdb when initializing Guile
- Authentication-results: sourceware.org; auth=none
- References: <m3r3mmdn7g dot fsf at sspiff dot org> <831tel3o68 dot fsf at gnu dot org>
On Sat, Aug 29, 2015 at 12:11 PM, Eli Zaretskii <eliz@gnu.org> wrote:
>> From: Doug Evans <xdje42@gmail.com>
>> cc: guile-devel@gnu.org
>> Date: Sat, 29 Aug 2015 10:22:11 -0700
>>
>> --- a/gdb/guile/guile.c
>> +++ b/gdb/guile/guile.c
>> @@ -847,7 +847,7 @@ _initialize_guile (void)
>> #if HAVE_GUILE
>> {
>> #ifdef HAVE_SIGPROCMASK
>> - sigset_t sigchld_mask, prev_mask;
>> + sigset_t guile_init_mask, prev_mask;
>> #endif
>>
>> /* The Python support puts the C side in module "_gdb", leaving the Python
>> @@ -867,9 +867,23 @@ _initialize_guile (void)
>> have SIGCHLD blocked. PR 17247.
>> Really libgc and Guile should do this, but we need to work with
>> libgc 7.4.x. */
>> - sigemptyset (&sigchld_mask);
>> - sigaddset (&sigchld_mask, SIGCHLD);
>> - sigprocmask (SIG_BLOCK, &sigchld_mask, &prev_mask);
>> + sigemptyset (&guile_init_mask);
>> + sigaddset (&guile_init_mask, SIGCHLD);
>> + /* Also block other asynchronous signals used by GDB. See event-top.c.
>> + Really we want to block every signal here except for those specifically
>> + used by Guile (e.g., GC threads), but this is safer for now. */
>> + sigaddset (&guile_init_mask, SIGINT);
>> + sigaddset (&guile_init_mask, SIGTERM);
>> +#ifdef SIGQUIT
>> + sigaddset (&guile_init_mask, SIGQUIT);
>> +#endif
>> +#ifdef SIGHUP
>> + sigaddset (&guile_init_mask, SIGHUP);
>> +#endif
>> +#ifdef SIGWINCH
>> + sigaddset (&guile_init_mask, SIGWINCH);
>> +#endif
>> + sigprocmask (SIG_BLOCK, &guile_init_mask, &prev_mask);
>> #endif
>
> What about platforms that don't have sigprocmask, but do have SIGINT?
> Don't we want to block SIGINT on those platforms?
Do they have threads, and how does one block SIGINT on those platforms?