From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Derek Davies Newsgroups: gmane.emacs.devel Subject: Why does this thread code crash my emacs? Date: Fri, 15 Oct 2021 12:04:35 -0400 Message-ID: <87pms6jmuk.fsf@ddavies.net> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="37220"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: mu4e 1.2.0; emacs 26.3 To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Oct 15 18:11:51 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 1mbPoE-0009Tq-Cv for ged-emacs-devel@m.gmane-mx.org; Fri, 15 Oct 2021 18:11:50 +0200 Original-Received: from localhost ([::1]:35880 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mbPoD-0004vT-7m for ged-emacs-devel@m.gmane-mx.org; Fri, 15 Oct 2021 12:11:49 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:45108) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mbPhY-0006Pq-Ck for emacs-devel@gnu.org; Fri, 15 Oct 2021 12:04:58 -0400 Original-Received: from gateway36.websitewelcome.com ([192.185.184.18]:42906) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mbPhV-00065q-9F for emacs-devel@gnu.org; Fri, 15 Oct 2021 12:04:55 -0400 Original-Received: from cm13.websitewelcome.com (cm13.websitewelcome.com [100.42.49.6]) by gateway36.websitewelcome.com (Postfix) with ESMTP id 4BD11400CA045 for ; Fri, 15 Oct 2021 11:04:36 -0500 (CDT) Original-Received: from gator4032.hostgator.com ([192.185.4.43]) by cmsmtp with SMTP id bPhEmWDDxG0jLbPhEmZhhI; Fri, 15 Oct 2021 11:04:36 -0500 X-Authority-Reason: nr=8 Original-Received: from c-65-96-169-180.hsd1.ma.comcast.net ([65.96.169.180]:55250 helo=masha.ddavies.net) by gator4032.hostgator.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1mbPhD-001E46-VA for emacs-devel@gnu.org; Fri, 15 Oct 2021 11:04:36 -0500 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - gator4032.hostgator.com X-AntiAbuse: Original Domain - gnu.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - ddavies.net X-BWhitelist: no X-Source-IP: 65.96.169.180 X-Source-L: No X-Exim-ID: 1mbPhD-001E46-VA X-Source-Sender: c-65-96-169-180.hsd1.ma.comcast.net (masha.ddavies.net) [65.96.169.180]:55250 X-Source-Auth: ddavies@ddavies.net X-Email-Count: 1 X-Source-Cap: ZGRhdmllcztkZGF2aWVzO2dhdG9yNDAzMi5ob3N0Z2F0b3IuY29t X-Local-Domain: yes Received-SPF: pass client-ip=192.185.184.18; envelope-from=ddavies@ddavies.net; helo=gateway36.websitewelcome.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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:277127 Archived-At: Hi, 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? Thanks! derek GNU Emacs 26.3 (build 1, x86_64-pc-linux-gnu, X toolkit, Xaw scroll bars) of 2020-02-04 ;; 2.5 A thread could be signaled from another thread by thread-signal. (defun my-thread1 () (sleep-for 10) (thread-signal thread2 'error '(my-data))) (defun my-thread2 () (condition-case err (hanoi 11) (error (message "Thread %s signaled by `%s'" (current-thread) err)))) (setq thread1 (make-thread #'my-thread1 "my thread 1")) (message "my thread1 %S" thread1) (setq thread2 (make-thread #'my-thread2 "my thread 2"))) (message "my thread2 %S" thread2)