From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Doug Evans 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 12:20:24 -0700 Message-ID: References: <831tel3o68.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: ger.gmane.org 1440876030 9543 80.91.229.3 (29 Aug 2015 19:20:30 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 29 Aug 2015 19:20:30 +0000 (UTC) Cc: guile-devel , "gdb-patches@sourceware.org" To: Eli Zaretskii Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Sat Aug 29 21:20:29 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 1ZVlfw-0001n9-FP for guile-devel@m.gmane.org; Sat, 29 Aug 2015 21:20:28 +0200 Original-Received: from localhost ([::1]:54138 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZVlfw-0000ob-3J for guile-devel@m.gmane.org; Sat, 29 Aug 2015 15:20:28 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:54741) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZVlft-0000oP-Oi for guile-devel@gnu.org; Sat, 29 Aug 2015 15:20:26 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZVlfs-00044Q-SJ for guile-devel@gnu.org; Sat, 29 Aug 2015 15:20:25 -0400 Original-Received: from mail-yk0-x236.google.com ([2607:f8b0:4002:c07::236]:32889) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZVlfs-00043p-Ny; Sat, 29 Aug 2015 15:20:24 -0400 Original-Received: by ykdz80 with SMTP id z80so44948069ykd.0; Sat, 29 Aug 2015 12:20:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=7IJp5mQ+t239o60TJlUBOvyv+/r3HPoYccE87Djnsd8=; b=uBtBb6ZEubeVsZkLO6rUNqQNI3o/BMNKcW0FXFhriqgjAI/amJiD8Gs//bDB1j9iAs 8NfbZeLxv1En0cDFmwM9ICpTVGQ8DgCr0eJ7cjz3GO23xuwgtJEOoOVUEWDF53NQrsEH VQ53lCXJLp69x6XK9cTSofK2BHz6BmdcC6Bl89TdO4b7jiFcboKkWHXE+K8z9UQzONPl JoLViutjF5fhro2hwuDE5PvpTdZAF0AWwwIxuvXWG5zSCstHac0q5Jd6ddM9D5jfBl4x uDcP84VqNUe44BvKDENmroSV9Sxy+qRo4dBBDG01twvAMcRsDMg+G1Z9q+xR6bRh5Uo9 dfiw== X-Received: by 10.129.111.11 with SMTP id k11mr14695502ywc.114.1440876024171; Sat, 29 Aug 2015 12:20:24 -0700 (PDT) Original-Received: by 10.13.254.195 with HTTP; Sat, 29 Aug 2015 12:20:24 -0700 (PDT) In-Reply-To: <831tel3o68.fsf@gnu.org> X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2607:f8b0:4002:c07::236 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:17797 gmane.comp.gdb.patches:110699 Archived-At: 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?