From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3537 invoked by alias); 1 Sep 2015 05:06:04 -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 3526 invoked by uid 89); 1 Sep 2015 05:06:03 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.4 required=5.0 tests=AWL,BAYES_05,FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-qg0-f41.google.com Received: from mail-qg0-f41.google.com (HELO mail-qg0-f41.google.com) (209.85.192.41) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Tue, 01 Sep 2015 05:06:01 +0000 Received: by qgtt94 with SMTP id t94so29286138qgt.1 for ; Mon, 31 Aug 2015 22:05:59 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.129.71.69 with SMTP id u66mr25758014ywa.49.1441083959464; Mon, 31 Aug 2015 22:05:59 -0700 (PDT) Received: by 10.13.254.195 with HTTP; Mon, 31 Aug 2015 22:05:59 -0700 (PDT) In-Reply-To: <83si711oyo.fsf@gnu.org> References: <831tel3o68.fsf@gnu.org> <83wpwd26lt.fsf@gnu.org> <201508292104.t7TL42OS020892@glazunov.sibelius.xs4all.nl> <83si711oyo.fsf@gnu.org> Date: Tue, 01 Sep 2015 05:06:00 -0000 Message-ID: Subject: Re: [RFC] Block all async signals used by gdb when initializing Guile From: Doug Evans To: Eli Zaretskii Cc: Mark Kettenis , "gdb-patches@sourceware.org" , guile-devel Content-Type: text/plain; charset=UTF-8 X-IsSubscribed: yes X-SW-Source: 2015-09/txt/msg00001.txt.bz2 On Sat, Aug 29, 2015 at 7:37 PM, Eli Zaretskii wrote: >> Date: Sat, 29 Aug 2015 23:04:02 +0200 (CEST) >> From: Mark Kettenis >> CC: eliz@gnu.org, gdb-patches@sourceware.org, guile-devel@gnu.org >> >> I suppose blocking these in the threads that guile starts is necessary >> because that is the only way to guarantee that those signals will be >> delivered to the main gdb thread on POSIX systems. >> >> On Windows you probably need to do something completely different. > > I might be missing something, because I don't see why. The goal here is to block these signals from being sent to the threads that Guile (or more specifically libgc) creates. Posix threads inherit the current value of the process's sigmask, so as long as the threads are started during Guile initialization, we can achieve this by blocking the signals before calling Guile's init routine and then restoring them after Guile's init routine returns. Note that we don't want to prevent gdb from getting the signals, we just want them to be sent to gdb's main thread. Not sure how to do that on windows.