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: Sun, 27 Oct 2019 15:25:50 +0200 Message-ID: <83r22ys4kh.fsf@gnu.org> References: <87zhhro0gt.fsf@gmail.com> <83sgnhw6xr.fsf@gnu.org> <87blu3lmfc.fsf@gmail.com> <8336ffvf1p.fsf@gnu.org> <878sp6wl24.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="236490"; 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 Sun Oct 27 14:27:21 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 1iOiZl-000zNq-Er for geb-bug-gnu-emacs@m.gmane.org; Sun, 27 Oct 2019 14:27:21 +0100 Original-Received: from localhost ([::1]:45302 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iOiZk-0004g4-8t for geb-bug-gnu-emacs@m.gmane.org; Sun, 27 Oct 2019 09:27:20 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:58367) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iOiZS-0004V8-Sl for bug-gnu-emacs@gnu.org; Sun, 27 Oct 2019 09:27:04 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iOiZR-0005BN-S7 for bug-gnu-emacs@gnu.org; Sun, 27 Oct 2019 09:27:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:32972) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iOiZR-0005BI-Ov for bug-gnu-emacs@gnu.org; Sun, 27 Oct 2019 09:27:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1iOiZR-0007fX-In for bug-gnu-emacs@gnu.org; Sun, 27 Oct 2019 09:27:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 27 Oct 2019 13:27:01 +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.157218276529413 (code B ref 37892); Sun, 27 Oct 2019 13:27:01 +0000 Original-Received: (at 37892) by debbugs.gnu.org; 27 Oct 2019 13:26:05 +0000 Original-Received: from localhost ([127.0.0.1]:41793 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iOiYX-0007eL-1x for submit@debbugs.gnu.org; Sun, 27 Oct 2019 09:26:05 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:49228) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iOiYV-0007e2-Il for 37892@debbugs.gnu.org; Sun, 27 Oct 2019 09:26:03 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:56540) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1iOiYQ-0004qN-CM; Sun, 27 Oct 2019 09:25:58 -0400 Original-Received: from [176.228.60.248] (port=4919 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1iOiYP-0004Sv-QS; Sun, 27 Oct 2019 09:25:58 -0400 In-reply-to: <878sp6wl24.fsf@gmail.com> (message from =?UTF-8?Q?Micha=C5=82?= Krzywkowski on Sun, 27 Oct 2019 11:16:03 +0100) 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:170246 Archived-At: > From: Michał Krzywkowski > Cc: Michał Krzywkowski , > 37892@debbugs.gnu.org > Date: Sun, 27 Oct 2019 11:16:03 +0100 > > >> I actually don't care (and can't know) what another thread is doing, I > >> just want to send a signal to it. > > Eli> But thread-signal is not for causing an error in a thread, it is for > Eli> unblocking a thread that waits on a mutex or a condvar. So why would > Eli> you use it when the thread is not blocked? > > Then I think documentation for that function should be changed to > explicitly say that the signal will *only* be delivered if the target > thread is in a "blocked call to ‘mutex-lock’, ‘condition-wait’, or > ‘thread-join’". > > Currently, the docstring of thread-signal just says that the function > will interrupt threads which are blocked, but does not actually say that > the signal will be delivered only in those cases. In fact, it says that > it works like signal, so I don't think it's unreasonable to assume that > it will just interrupt a thread whatever it's doing. The function does work like a signal, but Emacs cannot be interrupted while it waits for input. In all other cases your signal will be delivered, and if unhandled, it will terminate the thread. If we decide that thread-signal will have no effect while a thread waits for input, then we will document that, of course. My question was meant to understand your intent for signaling a thread at arbitrary time, because the effect of that is unpredictable, even if the crash didn't happen. I wanted to understand your thinking and rationale, so as to have a better basis for the decision of how to fix this problem. So could you please elaborate on your rationale? Thanks.