From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#39977: 28.0.50; Unhelpful stack trace Date: Mon, 23 Mar 2020 16:48:27 +0200 Message-ID: <83mu87b004.fsf@gnu.org> References: <83imj88tpt.fsf@gnu.org> <550fbc22-09db-d30b-c194-8f26b5dca05f@gmx.at> <83wo7o6nxs.fsf@gnu.org> <60dd4ced-a2e5-ed17-0570-b7bdd2a557af@gmx.at> <83blozckn2.fsf@gnu.org> <01305dbc-c69b-baf9-f0bf-1e5b8c04d970@gmx.at> <83y2s2bswl.fsf@gnu.org> <3ac189d0-5d05-fdf9-0922-0c464b1b17c3@gmx.at> <83k13lbgux.fsf@gnu.org> <83d09cb9gz.fsf@gnu.org> <69a74f9e-079b-a771-0213-f60ed0bf5720@gmx.at> <83y2rzf08m.fsf@gnu.org> <7a0b9999-6778-6235-fbc9-2a24b4e3bc53@gmx.at> <83tv2mg9j0.fsf@gnu.org> <9684641c-a59a-4ed6-a6b4-d3238f789050@gmx.at> <83sgi6g461.fsf@gnu.org> <90ac4084-4fbb-b5d7-6a7c-597d8f08e88a@gmx.at> <83imj1g1eu.fsf@gnu.org> <835zf1fobf.fsf@gnu.org> <4472dbf8-eec0-72eb-a4ad-c6b382d27f1f@gmx.at> <83zhcce7n2.fsf@gnu.org> <9a3df43d-4a83-bed0-9ad1-b59cf11b4c9c@gmx.at> <838sjtetmp.fsf@gnu.org> <88e06868-cfc2-7109-b5ea-71fea3aa897e@gmx.at> Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="43099"; mail-complaints-to="usenet@ciao.gmane.io" Cc: enometh@meer.net, 39977@debbugs.gnu.org To: martin rudalics Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Mar 23 15:49:22 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1jGOOH-000B74-V4 for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 23 Mar 2020 15:49:21 +0100 Original-Received: from localhost ([::1]:34900 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jGOOF-0001uW-Qe for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 23 Mar 2020 10:49:19 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:43887) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jGOO1-0001pv-W1 for bug-gnu-emacs@gnu.org; Mon, 23 Mar 2020 10:49:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jGOO0-00022r-O2 for bug-gnu-emacs@gnu.org; Mon, 23 Mar 2020 10:49:05 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:47415) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jGONx-00021s-TD for bug-gnu-emacs@gnu.org; Mon, 23 Mar 2020 10:49:04 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jGONx-0003k2-SX for bug-gnu-emacs@gnu.org; Mon, 23 Mar 2020 10:49: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: Mon, 23 Mar 2020 14:49:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 39977 X-GNU-PR-Package: emacs Original-Received: via spool by 39977-submit@debbugs.gnu.org id=B39977.158497491214326 (code B ref 39977); Mon, 23 Mar 2020 14:49:01 +0000 Original-Received: (at 39977) by debbugs.gnu.org; 23 Mar 2020 14:48:32 +0000 Original-Received: from localhost ([127.0.0.1]:53388 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jGONT-0003iz-OB for submit@debbugs.gnu.org; Mon, 23 Mar 2020 10:48:32 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:56892) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jGONS-0003ij-HD for 39977@debbugs.gnu.org; Mon, 23 Mar 2020 10:48:30 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:54364) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1jGONM-0001wm-Lo; Mon, 23 Mar 2020 10:48:24 -0400 Original-Received: from [176.228.60.248] (port=1614 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1jGONM-0005K9-09; Mon, 23 Mar 2020 10:48:24 -0400 In-Reply-To: <88e06868-cfc2-7109-b5ea-71fea3aa897e@gmx.at> (message from martin rudalics on Sun, 22 Mar 2020 19:20:33 +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-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:177651 Archived-At: > Cc: enometh@meer.net, 39977@debbugs.gnu.org > From: martin rudalics > Date: Sun, 22 Mar 2020 19:20:33 +0100 > > Once an initial frame has been created, Lisp code should be always able > to rely on the truth of > > (and (frame-live-p (selected-frame)) > (window-live-p (selected-window)) > (eq (frame-selected-window (selected-frame)) > (selected-window))) I agree. But note that selected-frame could switch frames internally, if the last selected frame is dead; as long as selected-frame also adjusts the selected window, the above will still hold. > (1) Let the redisplay code handle it. > > (2) Let the frame and window management handle it by disallowing such > operations while they are issued by the mode line or frame title > processing code. > > (3) Ignore it and let the frame/window management routines catch up with > it later. > > Using (1) way my initial idea. The patch I proposed handles simple > cases like Madhu's bug. It will certainly not handle more sophisticated > cases where, for example, an application kills two frames in a row. > > (2) is by far the most simple and reliable approach but it will restrict > applications in what they are allowed to do when processing a mode line > or frame title. > > (3) means that frame/window management proceeds in a non-deterministic > fashion as long as it has not detected that its basic invariant has been > violated. I'm okay with having non-deterministic behavior triggered by code that violates that invariant. We will tell people who write such Lisp code "if it hurts, don't do that". > > This isn't about trust. This is about letting users' Lisp do anything > > they want as long as the results allow redisplay to continue after > > that Lisp returns. I don't think it's right to disallow certain > > actions just because they _might_ cause problems. > > You again care about redisplay only. Only because the crashes we are discussing were in redisplay. Not in general. > >> If that's the reason, then SELECTED_FRAME can easily set selected_frame > >> to some live frame and continue. > > > > Something like that, yes. > > I attach a patch that does that. If you try it with a recipe like > loading > > > (defvar foo > '(:eval > (when (> (length (frame-list)) 1) > (delete-frame (next-frame))))) > > (setq-default mode-line-format foo) > > (make-frame) > > > with emacs -Q you will see that while it works around the crash it still > produces a > > Wrong type argument: window-live-p, # > > error in redisplay. That might not be the best solution, but it's "good enough" in my book. The programmer who writes such code deserves punishment, and an error in redisplay that doesn't lock up Emacs (or does it?) is ample punishment, IMO. Thanks.