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.bugs Subject: bug#60096: 29.0.60; Crash in format_mode_line_unwind_data Date: Sun, 18 Dec 2022 13:40:43 +0200 Message-ID: <83h6xtey84.fsf@gnu.org> References: <86a63oen2m.fsf@mail.linkov.net> <83sfhgjqd7.fsf@gnu.org> <86cz8jls87.fsf@mail.linkov.net> <83k02rk1vk.fsf@gnu.org> <83ilibjttu.fsf@gnu.org> <83fsdfjsq9.fsf@gnu.org> <325aaa94-74fa-cf94-b66c-b87c69ebe386@gmx.at> <838rj6ic34.fsf@gnu.org> <83pmciggwn.fsf@gnu.org> <89b63947-5b2d-8bd1-4e9a-7da6cf114ffe@gmx.at> <83edsxhq9f.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="33346"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 60096@debbugs.gnu.org, juri@linkov.net To: martin rudalics Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Dec 18 12:41:22 2022 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 1p6s2j-0008Wv-Mp for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 18 Dec 2022 12:41:22 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p6s2S-0000hn-4d; Sun, 18 Dec 2022 06:41:04 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p6s2Q-0000hf-Rs for bug-gnu-emacs@gnu.org; Sun, 18 Dec 2022 06:41:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1p6s2Q-0007dS-Dj for bug-gnu-emacs@gnu.org; Sun, 18 Dec 2022 06:41:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1p6s2P-0007ud-Ua for bug-gnu-emacs@gnu.org; Sun, 18 Dec 2022 06:41:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 18 Dec 2022 11:41:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 60096 X-GNU-PR-Package: emacs Original-Received: via spool by 60096-submit@debbugs.gnu.org id=B60096.167136364630401 (code B ref 60096); Sun, 18 Dec 2022 11:41:01 +0000 Original-Received: (at 60096) by debbugs.gnu.org; 18 Dec 2022 11:40:46 +0000 Original-Received: from localhost ([127.0.0.1]:33447 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p6s29-0007uH-TH for submit@debbugs.gnu.org; Sun, 18 Dec 2022 06:40:46 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:50650) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p6s28-0007uB-VH for 60096@debbugs.gnu.org; Sun, 18 Dec 2022 06:40:45 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p6s22-0007W8-2v; Sun, 18 Dec 2022 06:40:38 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=snikGSpSPpDflM0P0GyVej/zjsQJrEFlmuwn/2fqHUY=; b=Kmm2MNnucxvI 15SbcmvJiQrp0lfBXi05mzlQTFmWm0YrVo7DpTgJ/bfOEEI/aPfujA8ZQuPP8xZKS9Aq0A8pTHv0R rhf3EzVTFWBoi+ZXMaQg1vCbVMCLut2wARRtUnonHFVD3nWV+25oCLXz4kzPIstyDuSYjo5fk0qKo +sLlKLeCaia+A1Wz4ZHpNF9eLti1xt6ZrPvlR6RN4lLyYR35xcTf1sBG3+QuH8xLj2IM7H+gP9nIQ TJYQQv0zKQF1S8oPr5+KCwkXcbbmdhUwb6Qu594R91ceNkP2BV1JccnurP4gTe3Runen/ZZG52JIV Jf+Nd+dIiedHUIsyb+fW1w==; Original-Received: from [87.69.77.57] (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 1p6s20-0006kf-0h; Sun, 18 Dec 2022 06:40:37 -0500 In-Reply-To: (message from martin rudalics on Sun, 18 Dec 2022 10:18:18 +0100) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:251356 Archived-At: > Date: Sun, 18 Dec 2022 10:18:18 +0100 > Cc: juri@linkov.net, 60096@debbugs.gnu.org > From: martin rudalics > > >> Probably so far we never tried to call 'kill-buffer' from within > >> 'set-window-configuration'. If the only "live" window shows *scratch*, > >> *scratch* gets killed and we kill a temporary buffer before we were able > >> to recreate *scratch*, window_list will return the empty list. > > > > Why the empty list? The buffer gets killed, but windows don't get > > killed. We still have the frame with at least two windows (including > > the mini-window). Right? > > Not if we exclude windows with a nil buffer as suggested above. The > delete_all_child_windows call in 'set-window-configuration' sets the > contents field of every live window on that frame to nil and as long as > we have not been able to get a live buffer for that window, it will stay > nil. Well, you forget *Messages*. But I get your point. > That's where all those windows with a nil buffer in your > investigations come from. It's simply not safe to deal with windows > before 'set-window-configuration' has done its work completely. If we > think of running Lisp in this time, we have to do it in a completely > restricted way: Any window, including the selected one, can legitimately > have a nil buffer then. With the current code, this is what happens: the window-related functions called from set-window-configuration either manage to get along with such windows, or are called via safe_call, which catches any errors. And AFAIU the code in set-window-configuration attempts to make sure that every window we reinstate from the saved window-configuration will have a valid buffer when we are done looping over all of the saved windows.