unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
From: Doug Evans <xdje42@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: guile-devel <guile-devel@gnu.org>,
	"gdb-patches@sourceware.org" <gdb-patches@sourceware.org>
Subject: Re: [RFC] Block all async signals used by gdb when initializing Guile
Date: Sat, 29 Aug 2015 12:20:24 -0700	[thread overview]
Message-ID: <CAP9bCMQmWmbLg9qZ3ZyVyTF=fBOB-sJtFAr1=OCC_g53aGYRUw@mail.gmail.com> (raw)
In-Reply-To: <831tel3o68.fsf@gnu.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?



  reply	other threads:[~2015-08-29 19:20 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-29 17:22 [RFC] Block all async signals used by gdb when initializing Guile Doug Evans
2015-08-29 19:11 ` Eli Zaretskii
2015-08-29 19:20   ` Doug Evans [this message]
2015-08-29 20:16     ` Eli Zaretskii
2015-08-29 20:39       ` Doug Evans
2015-08-29 21:04         ` Mark Kettenis
2015-08-30  2:37           ` Eli Zaretskii
2015-09-01  5:05             ` Doug Evans
2015-09-01 14:35               ` Eli Zaretskii
2015-09-01 15:22                 ` Doug Evans
2015-09-01 15:50                   ` Eli Zaretskii
2015-08-30  2:35         ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAP9bCMQmWmbLg9qZ3ZyVyTF=fBOB-sJtFAr1=OCC_g53aGYRUw@mail.gmail.com' \
    --to=xdje42@gmail.com \
    --cc=eliz@gnu.org \
    --cc=gdb-patches@sourceware.org \
    --cc=guile-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).