From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: martin rudalics Newsgroups: gmane.emacs.bugs Subject: bug#39977: 28.0.50; Unhelpful stack trace Date: Sun, 15 Mar 2020 18:49:21 +0100 Message-ID: <3ac189d0-5d05-fdf9-0922-0c464b1b17c3@gmx.at> References: <83zhcs80e5.fsf@gnu.org> <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> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------A6FDCB6C10F5BE317BA1FE59" Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="29040"; mail-complaints-to="usenet@ciao.gmane.io" Cc: enometh@meer.net, 39977@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Mar 15 18:58:50 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 1jDXXF-0007QS-HR for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 15 Mar 2020 18:58:49 +0100 Original-Received: from localhost ([::1]:56534 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jDXXD-0006sC-2W for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 15 Mar 2020 13:58:48 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:48221) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jDXOl-0003lB-Ht for bug-gnu-emacs@gnu.org; Sun, 15 Mar 2020 13:50:04 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jDXOk-0002xY-Eq for bug-gnu-emacs@gnu.org; Sun, 15 Mar 2020 13:50:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:57741) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jDXOk-0002vm-An for bug-gnu-emacs@gnu.org; Sun, 15 Mar 2020 13:50:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jDXOk-00036U-9D for bug-gnu-emacs@gnu.org; Sun, 15 Mar 2020 13:50:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: martin rudalics Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 15 Mar 2020 17:50:02 +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.158429457811864 (code B ref 39977); Sun, 15 Mar 2020 17:50:02 +0000 Original-Received: (at 39977) by debbugs.gnu.org; 15 Mar 2020 17:49:38 +0000 Original-Received: from localhost ([127.0.0.1]:35477 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jDXOM-00035H-9Q for submit@debbugs.gnu.org; Sun, 15 Mar 2020 13:49:38 -0400 Original-Received: from mout.gmx.net ([212.227.17.20]:51481) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jDXOK-000354-Hm for 39977@debbugs.gnu.org; Sun, 15 Mar 2020 13:49:37 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1584294564; bh=kEqg/R70VGxf9QAjdtH3tHljgFTq8y8TG18pAbDaSVU=; h=X-UI-Sender-Class:Subject:To:Cc:References:From:Date:In-Reply-To; b=F9WKx5f1W1XHoTrPtxqfKBuxOxpYLjn3pMT6N13gd6Kgrl+MqWTDYnucsl+xgUHXM l5MfjfiaT4IS9JpOI03UkdNgMHa81Xiulercp5J7zytxBBs6ARoNDwomfi7IwfOOm2 bNcosOJNKqiejblFeiseRiYdUFUChu+kcauUiifw= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Original-Received: from [192.168.1.103] ([212.95.7.232]) by mail.gmx.com (mrgmx104 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MAONX-1j2DeB0pxL-00BxK2; Sun, 15 Mar 2020 18:49:24 +0100 In-Reply-To: <83y2s2bswl.fsf@gnu.org> Content-Language: en-US X-Provags-ID: V03:K1:gdgA6YxMKcCW1JhmJrQvO2clSBwvm1GwXOn7EHFtEFpx6QtdFxm BW2sz1KSIZUjad8DfM463eI4mZRMSjLxLlK1DUQB/bl/vK0oCKxl3B+GkD72oKkqHGfISTY 72GE4hml3g+kFhu9xH2usuzpV2MUgvz/v4xepp3NclKR1RrK0pwyAAOTKoZdZuIDWv2QHFE YQBn/L9lsthi7laVJ/PnA== X-UI-Out-Filterresults: notjunk:1;V03:K0:vC7bmBVLPjI=:8nAFm/HRWKf82ZgcFPWqcr dTVjVOEwwfKK3LdxZqzdLo+lRyGAaSU7ShrY5AmqRsUXqRSiyHiEhqRjwrEd4zFwXlfPNbA// 2wsS+Vq0oUkdFgW+PWqli6Uomf9MysXphQR0kXJankOmAHi9pJ/+9bmciK3k5np0r8EvL1192 0+m4Y2DYXfJenAqKAyHsUMI08kJ5aLPciV74yWK7qcESiSDWHgGgAFdK7pdntznybXw6ifTwg QnbLZ9uw9rn1LLmaF8t/w/6/Y16pL3OGGcDcccuzu/BnouhxRHVrvnGcD+2pmSnqVJ8jb3OxZ Jgmy5PH/ORT26AdqdgH9rBuKSctjYrmIQBDl2GESbihLrBqquQDtZNqgv8Lw7PHoA78QXi97a VRhswcnOguG6Q5doPAm1Tc9Ea1DPpDM/Mkx31pVzk7ff2FVI5wwXpR2L5jKr99elBMfTtWrkN OKgy8hHkbp/0u4tcUH0BkZBgv3FoGc6MtRzyDL/bb6cTc+eDWucfMb4VKmJ2tzkyLH9uKxdWA kFR5ZHw3ElSW0C2VhhqFIKNuVJJf9CFUFOhui7xShpy2wc0Z2qlftQCMmAQ8pngS63Cq3YTge edttK/WwqDM7gqeNVRJHYeHgZqUEyqXwEoHFTSyHsZljYii4+rvHe7TvPuxPgGAVvABHm+a3U nHAs+FBpwq9DmFOJYtuBAyGf5F60ulgmAUcrPJusjldNC0qHHl6Rr0naglB5HrLG2VskGGauQ vEh1+eiwi0QL0LJ76kUtKZG4kP+cuyO4n99u8eSQ9Ab0eTBM06V93NSLGC2FtkIpRZl53BqN 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:177385 Archived-At: This is a multi-part message in MIME format. --------------A6FDCB6C10F5BE317BA1FE59 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit > And what do you suggest to do if the frame at RHS is not live? Sorry, what is RHS? As far as xdisp.c is concerned it simply must not set selected_frame to a dead frame. Never ever. As far as frame.c is concerned, it should do something like in the attached patch. In the worst case this might make it impossible to remove a specific frame but this can usually be fixed by C-x 5 2 followed by C-x 5 1 unless things are awfully broken. But at least this is a place from where to continue investigating. I have no better idea. >> I have no idea whether these could help in any way but since we are in >> redisplay and the selected frame has become dead all of a sudden ... > > Why do you think this is a problem for redisplay? I didn't say that this is a problem for redisplay. What I wanted to say is that your fix which is supposed to handle a (maybe only temporary) problem inside redisplay might cause more serious problems when selecting a dead frame outside of redisplay. But maybe I'm confusing things. martin --------------A6FDCB6C10F5BE317BA1FE59 Content-Type: text/x-patch; name="frame.c.diff" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="frame.c.diff" diff --git a/src/frame.c b/src/frame.c index 88d6f22fc0..ef42f230ef 100644 =2D-- a/src/frame.c +++ b/src/frame.c @@ -1466,6 +1466,11 @@ do_switch_frame (Lisp_Object frame, int track, int = for_deletion, Lisp_Object nor tty->top_frame =3D frame; } + if (!FRAME_LIVE_P (f)) + /* Return nil if for some reason FRAME has become dead now + (Bug#39977). */ + return Qnil; + selected_frame =3D frame; if (! FRAME_MINIBUF_ONLY_P (XFRAME (selected_frame))) last_nonminibuf_frame =3D XFRAME (selected_frame); @@ -2009,8 +2014,6 @@ delete_frame (Lisp_Object frame, Lisp_Object force) error ("Attempt to delete the only frame"); } - /* At this point, we are committed to deleting the frame. - There is no more chance for errors to prevent it. */ minibuffer_selected =3D EQ (minibuf_window, selected_window); sf =3D SELECTED_FRAME (); /* Don't let the frame remain selected. */ @@ -2066,10 +2069,17 @@ delete_frame (Lisp_Object frame, Lisp_Object force= ) Fraise_frame (frame1); #endif - do_switch_frame (frame1, 0, 1, Qnil); + if (!EQ (do_switch_frame (frame1, 0, 1, Qnil), frame1)) + /* Error out if for some reason FRAME1 was not live + (Bug#39977). */ + error ("No frame to switch to found"); + sf =3D SELECTED_FRAME (); } + /* At this point, we are committed to deleting the frame. + There is no more chance for errors to prevent it. */ + /* Don't allow minibuf_window to remain on a deleted frame. */ check_minibuf_window (frame, minibuffer_selected); --------------A6FDCB6C10F5BE317BA1FE59--