From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#37892: 27.0.50; Crash when signaling a thread Date: Sat, 26 Oct 2019 15:58:58 +0300 Message-ID: <8336ffvf1p.fsf@gnu.org> References: <87zhhro0gt.fsf@gmail.com> <83sgnhw6xr.fsf@gnu.org> <87blu3lmfc.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="116628"; mail-complaints-to="usenet@blaine.gmane.org" Cc: 37892@debbugs.gnu.org To: =?UTF-8?Q?Micha=C5=82?= Krzywkowski Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Oct 26 15:00:24 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1iOLg2-000U6F-VX for geb-bug-gnu-emacs@m.gmane.org; Sat, 26 Oct 2019 15:00:19 +0200 Original-Received: from localhost ([::1]:40030 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iOLg1-0002bN-Gl for geb-bug-gnu-emacs@m.gmane.org; Sat, 26 Oct 2019 09:00:17 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:41583) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iOLfo-0002WC-Fx for bug-gnu-emacs@gnu.org; Sat, 26 Oct 2019 09:00:05 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iOLfn-0003WP-ED for bug-gnu-emacs@gnu.org; Sat, 26 Oct 2019 09:00:04 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:59198) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iOLfn-0003WJ-An for bug-gnu-emacs@gnu.org; Sat, 26 Oct 2019 09:00:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1iOLfm-0004uF-UY for bug-gnu-emacs@gnu.org; Sat, 26 Oct 2019 09:00:03 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 26 Oct 2019 13:00:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 37892 X-GNU-PR-Package: emacs Original-Received: via spool by 37892-submit@debbugs.gnu.org id=B37892.157209475618776 (code B ref 37892); Sat, 26 Oct 2019 13:00:02 +0000 Original-Received: (at 37892) by debbugs.gnu.org; 26 Oct 2019 12:59:16 +0000 Original-Received: from localhost ([127.0.0.1]:39786 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iOLf1-0004sm-R6 for submit@debbugs.gnu.org; Sat, 26 Oct 2019 08:59:16 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:60642) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iOLf0-0004sZ-Bm for 37892@debbugs.gnu.org; Sat, 26 Oct 2019 08:59:14 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:40729) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1iOLev-0002yX-5Y; Sat, 26 Oct 2019 08:59:09 -0400 Original-Received: from [176.228.60.248] (port=2523 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1iOLeu-0006lW-9p; Sat, 26 Oct 2019 08:59:08 -0400 In-reply-to: <87blu3lmfc.fsf@gmail.com> (message from =?UTF-8?Q?Micha=C5=82?= Krzywkowski on Sat, 26 Oct 2019 14:29:43 +0200) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:170196 Archived-At: > From: Michał Krzywkowski > Cc: Michał Krzywkowski , > 37892@debbugs.gnu.org > Date: Sat, 26 Oct 2019 14:29:43 +0200 > > Eli> Emacs doesn't allow signals while it waits for input. > > Eli> We could ignore thread-signal in such cases, or we could make it an > Eli> error (which will then signal an error in the thread which called > Eli> thread-signal). What do people think? Are there any other ideas for > Eli> handling this situation? > > Maybe the signal should be raised in the thread right after it returns > from sit-for? We don't have any mechanism for doing that. > Ignoring signals sounds like a bad idea. It is better than crashing. It is also not much worse than interrupting the thread at some arbitrary random point. > Eli> Michał, can you tell why you needed to call thread-signal while the > Eli> thread was in sit-for? > > I wanted to signal some background thread which was doing some work and > then Emacs crashed, because it just so happened that it was in sit-for. > The thread function was doing _more_ than just sit-for. > > I actually don't care (and can't know) what another thread is doing, I > just want to send a signal to it. But thread-signal is not for causing an error in a thread, it is for unblocking a thread that waits on a mutex or a condvar. So why would you use it when the thread is not blocked?