From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Juliusz Chroboczek Newsgroups: gmane.emacs.devel Subject: Re: Crashing the new thread code Date: Sun, 11 Dec 2016 22:22:34 +0100 Message-ID: <87d1gy2mat.fsf@irif.fr> References: <87h96a2tyi.fsf@irif.fr> <83twaacii3.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1481491374 31435 195.159.176.226 (11 Dec 2016 21:22:54 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 11 Dec 2016 21:22:54 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux) Cc: Eli Zaretskii To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Dec 11 22:22:48 2016 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cGBa1-0006bR-R3 for ged-emacs-devel@m.gmane.org; Sun, 11 Dec 2016 22:22:45 +0100 Original-Received: from localhost ([::1]:57170 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cGBa6-0006yd-30 for ged-emacs-devel@m.gmane.org; Sun, 11 Dec 2016 16:22:50 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:37221) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cGBZz-0006yJ-AG for emacs-devel@gnu.org; Sun, 11 Dec 2016 16:22:44 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cGBZw-00028z-7K for emacs-devel@gnu.org; Sun, 11 Dec 2016 16:22:43 -0500 Original-Received: from [195.159.176.226] (port=59868 helo=blaine.gmane.org) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cGBZw-00028d-0p for emacs-devel@gnu.org; Sun, 11 Dec 2016 16:22:40 -0500 Original-Received: from list by blaine.gmane.org with local (Exim 4.84_2) (envelope-from ) id 1cGBZp-00051z-FQ for emacs-devel@gnu.org; Sun, 11 Dec 2016 22:22:33 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 24 Original-X-Complaints-To: usenet@blaine.gmane.org Cancel-Lock: sha1:vxeUtw0GjnWmeGn4rA7Om7cmksA= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 195.159.176.226 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 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.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:210314 Archived-At: >> The following immediately crashes Emacs: >> >> (let ((thread (make-thread #'(lambda () (while t (thread-yield)))))) >> (thread-signal thread 'error nil)) > What is the semantics of signaling a thread that yields? I'm not sure, that's why I was experimenting. > What did you expect to happen? The thread queues the condition and continues spinning? > Of course, Emacs shouldn't exit, but what should it do in this case? The condition is queued forever? On the one hand, conditions should only be delivered in well-defined circumstances (or else unwind-protect becomes unusable), on the other hand, I expect asynchronous signal delivery to be reliable. (Is the set of functions that deliver a condition is too restrictive? I see no way to check for a queued condition without grabbing a lock.) -- Juliusz