From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Why does this thread code crash my emacs? Date: Fri, 15 Oct 2021 22:01:04 +0300 Message-ID: <83r1cmi03z.fsf@gnu.org> References: <87pms6jmuk.fsf@ddavies.net> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="19345"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Derek Davies Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Oct 15 21:01:54 2021 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mbSSn-0004uh-VX for ged-emacs-devel@m.gmane-mx.org; Fri, 15 Oct 2021 21:01:53 +0200 Original-Received: from localhost ([::1]:56568 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mbSSm-00035R-3W for ged-emacs-devel@m.gmane-mx.org; Fri, 15 Oct 2021 15:01:52 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:47964) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mbSS4-0002PM-JN for emacs-devel@gnu.org; Fri, 15 Oct 2021 15:01:08 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:42442) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mbSS3-0004BB-QT; Fri, 15 Oct 2021 15:01:07 -0400 Original-Received: from [87.69.77.57] (port=3822 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mbSS2-0005kK-HH; Fri, 15 Oct 2021 15:01:07 -0400 In-Reply-To: <87pms6jmuk.fsf@ddavies.net> (message from Derek Davies on Fri, 15 Oct 2021 12:04:35 -0400) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:277137 Archived-At: > From: Derek Davies > Date: Fri, 15 Oct 2021 12:04:35 -0400 > > Working with the thread-signal example from: https://emacs-berlin.org/thread-safe-tramp-2018-09.html > > it works for me as given, but when I run hanoi instead of sleeping in > thread2 my emacs consistently crashes (back to command line from which > it was invoked). > > I've been poking at it, but without much insight -- does anyone know > what I or hanoi or threading is doing wrong? You currently cannot signal a thread that is waiting for input (hanoi waits for input inside sit-for), because Emacs doesn't (yet) know how to recover from signals in that state. IOW, this is a limitation of the current implementation that is more visible when signaling threads than when there's only one (main) thread.