From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5640 invoked by alias); 29 Aug 2015 19:20:30 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 5628 invoked by uid 89); 29 Aug 2015 19:20:29 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.0 required=5.0 tests=AWL,BAYES_00,FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-yk0-f170.google.com Received: from mail-yk0-f170.google.com (HELO mail-yk0-f170.google.com) (209.85.160.170) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Sat, 29 Aug 2015 19:20:26 +0000 Received: by ykbu129 with SMTP id u129so12946074ykb.2 for ; Sat, 29 Aug 2015 12:20:24 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.129.111.11 with SMTP id k11mr14695502ywc.114.1440876024171; Sat, 29 Aug 2015 12:20:24 -0700 (PDT) Received: by 10.13.254.195 with HTTP; Sat, 29 Aug 2015 12:20:24 -0700 (PDT) In-Reply-To: <831tel3o68.fsf@gnu.org> References: <831tel3o68.fsf@gnu.org> Date: Sat, 29 Aug 2015 19:20:00 -0000 Message-ID: Subject: Re: [RFC] Block all async signals used by gdb when initializing Guile From: Doug Evans To: Eli Zaretskii Cc: "gdb-patches@sourceware.org" , guile-devel Content-Type: text/plain; charset=UTF-8 X-IsSubscribed: yes X-SW-Source: 2015-08/txt/msg00837.txt.bz2 On Sat, Aug 29, 2015 at 12:11 PM, Eli Zaretskii wrote: >> From: Doug Evans >> 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?