From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.lisp.guile.devel,gmane.comp.gdb.patches Subject: Re: [RFC] Block all async signals used by gdb when initializing Guile Date: Sat, 29 Aug 2015 22:11:27 +0300 Message-ID: <831tel3o68.fsf@gnu.org> References: Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1440875498 1800 80.91.229.3 (29 Aug 2015 19:11:38 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 29 Aug 2015 19:11:38 +0000 (UTC) Cc: guile-devel@gnu.org, gdb-patches@sourceware.org To: Doug Evans Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Sat Aug 29 21:11:32 2015 Return-path: Envelope-to: guile-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1ZVlXF-0000BS-G8 for guile-devel@m.gmane.org; Sat, 29 Aug 2015 21:11:29 +0200 Original-Received: from localhost ([::1]:54097 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZVlXF-0007sE-7v for guile-devel@m.gmane.org; Sat, 29 Aug 2015 15:11:29 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:52878) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZVlXC-0007s5-25 for guile-devel@gnu.org; Sat, 29 Aug 2015 15:11:26 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZVlX8-0000QW-SR for guile-devel@gnu.org; Sat, 29 Aug 2015 15:11:25 -0400 Original-Received: from mtaout24.012.net.il ([80.179.55.180]:41242) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZVlX8-0000QS-KZ for guile-devel@gnu.org; Sat, 29 Aug 2015 15:11:22 -0400 Original-Received: from conversion-daemon.mtaout24.012.net.il by mtaout24.012.net.il (HyperSendmail v2007.08) id <0NTU00O00Y4HG300@mtaout24.012.net.il> for guile-devel@gnu.org; Sat, 29 Aug 2015 22:03:30 +0300 (IDT) Original-Received: from HOME-C4E4A596F7 ([84.94.185.246]) by mtaout24.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0NTU00OIVY9UP500@mtaout24.012.net.il>; Sat, 29 Aug 2015 22:03:30 +0300 (IDT) In-reply-to: X-012-Sender: halo1@inter.net.il X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 80.179.55.180 X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Original-Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.devel:17796 gmane.comp.gdb.patches:110698 Archived-At: > 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?