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: Fri, 25 Oct 2019 11:44:16 +0300 Message-ID: <83sgnhw6xr.fsf@gnu.org> References: <87zhhro0gt.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="129016"; 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 Fri Oct 25 11:10:08 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 1iNvbj-000XTx-Rq for geb-bug-gnu-emacs@m.gmane.org; Fri, 25 Oct 2019 11:10:07 +0200 Original-Received: from localhost ([::1]:57938 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNvbi-0005VU-Kl for geb-bug-gnu-emacs@m.gmane.org; Fri, 25 Oct 2019 05:10:06 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:52076) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNvDa-0006kF-Nl for bug-gnu-emacs@gnu.org; Fri, 25 Oct 2019 04:45:12 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iNvDU-00039z-EL for bug-gnu-emacs@gnu.org; Fri, 25 Oct 2019 04:45:10 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:56672) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iNvDT-00039Y-0w for bug-gnu-emacs@gnu.org; Fri, 25 Oct 2019 04:45:04 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1iNvDS-0008RV-DI for bug-gnu-emacs@gnu.org; Fri, 25 Oct 2019 04:45:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 25 Oct 2019 08:45: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.157199307932411 (code B ref 37892); Fri, 25 Oct 2019 08:45:02 +0000 Original-Received: (at 37892) by debbugs.gnu.org; 25 Oct 2019 08:44:39 +0000 Original-Received: from localhost ([127.0.0.1]:37260 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iNvD4-0008Qg-O0 for submit@debbugs.gnu.org; Fri, 25 Oct 2019 04:44:38 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:42933) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iNvD1-0008QQ-BI for 37892@debbugs.gnu.org; Fri, 25 Oct 2019 04:44:37 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:34255) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1iNvCw-0002xY-5V; Fri, 25 Oct 2019 04:44:30 -0400 Original-Received: from [176.228.60.248] (port=1420 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1iNvCv-00067v-Dq; Fri, 25 Oct 2019 04:44:29 -0400 In-reply-to: <87zhhro0gt.fsf@gmail.com> (message from =?UTF-8?Q?Micha=C5=82?= Krzywkowski on Wed, 23 Oct 2019 19:06:42 +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:170153 Archived-At: > From: Michał Krzywkowski > Date: Wed, 23 Oct 2019 19:06:42 +0200 > > When I evaluate this sexp, Emacs aborts: > > (let ((thread (make-thread (lambda () (sit-for 1.0))))) > (sit-for 0.5) > (thread-signal thread 'error nil)) > > Backtrace: > > Thread 5 "emacs" hit Breakpoint 1, terminate_due_to_signal (sig=sig@entry=6, backtrace_limit=backtrace_limit@entry=40) at emacs.c:371 > 371 signal (sig, SIG_DFL); > #0 0x000000000041f40b in terminate_due_to_signal (sig=sig@entry=6, backtrace_limit=backtrace_limit@entry=40) at emacs.c:371 > #1 0x000000000041f866 in emacs_abort () at sysdep.c:2450 > #2 0x000000000042154b in signal_or_quit (error_symbol=XIL(0x90), data=XIL(0), keyboard_quit=) at eval.c:1598 > #3 0x0000000000421564 in Fsignal (error_symbol=, data=) at eval.c:1568 > #4 0x0000000000423929 in post_acquire_global_lock (self=) at thread.c:115 > #5 0x00000000005c5e62 in acquire_global_lock (self=0x1465e50) at thread.c:123 Emacs doesn't allow signals while it waits for input. We could ignore thread-signal in such cases, or we could make it an error (which will then signal an error in the thread which called thread-signal). What do people think? Are there any other ideas for handling this situation? Michał, can you tell why you needed to call thread-signal while the thread was in sit-for? Thanks.