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: Sat, 17 Dec 2022 12:53:26 +0200 Message-ID: <834jtui9nd.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> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="31383"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 60096@debbugs.gnu.org, juri@linkov.net To: rudalics@gmx.at Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Dec 17 11:54:12 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 1p6UpX-00080a-LF for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 17 Dec 2022 11:54:12 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p6UpQ-0000ys-AS; Sat, 17 Dec 2022 05:54: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 1p6UpO-0000yQ-Fa for bug-gnu-emacs@gnu.org; Sat, 17 Dec 2022 05:54: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 1p6UpO-0007yh-7X for bug-gnu-emacs@gnu.org; Sat, 17 Dec 2022 05:54:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1p6UpO-0006TT-3V for bug-gnu-emacs@gnu.org; Sat, 17 Dec 2022 05:54:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 17 Dec 2022 10:54:02 +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.167127441224874 (code B ref 60096); Sat, 17 Dec 2022 10:54:02 +0000 Original-Received: (at 60096) by debbugs.gnu.org; 17 Dec 2022 10:53:32 +0000 Original-Received: from localhost ([127.0.0.1]:55182 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p6Uot-0006T8-HA for submit@debbugs.gnu.org; Sat, 17 Dec 2022 05:53:31 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:48358) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p6Uos-0006T2-En for 60096@debbugs.gnu.org; Sat, 17 Dec 2022 05:53:31 -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 1p6Uol-0007t6-Du; Sat, 17 Dec 2022 05:53:24 -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=Wx+wxoGNpos/h41gDKls/7Ql55vuSzCBGFTwMGwuca8=; b=GvQXZUnLqgiK 73a9peC8p3KVZjVZ9V6LG4ZPUk5tJUrEwXZbK3dzAAHRz6HrIytDmC/Rb3+gJd3oFopicHqI4TT8k 6DnulwRtgMAKqPDFh4xRoUKLJS1erDnxIwfQyrig69xUk7P6ocwSNfGwXv4QUR0XH3KHAzuOqbEPc fi59qq+uEIRfHz1KLFoAk7LT/Pp+Dt7+sAbGeZxiruczbMBxezPBamRTUnCHTuBVvxY0MmdVb3Ujm OjgBNRSUxHd1pi8SDtNnftToeATxNjF2Tkiytl29pAZgkZ+768xf9xbXyRAxkKOSaLLcX9aJ51hTr /tpf6LjfrOpzjI0IGk96yQ==; 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 1p6Uoj-0006v4-T7; Sat, 17 Dec 2022 05:53:22 -0500 In-Reply-To: <838rj6ic34.fsf@gnu.org> (message from Eli Zaretskii on Sat, 17 Dec 2022 12:00:47 +0200) 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:251270 Archived-At: > Cc: 60096@debbugs.gnu.org, juri@linkov.net > Date: Sat, 17 Dec 2022 12:00:47 +0200 > From: Eli Zaretskii > > > The earlier call > > > > delete_all_child_windows (FRAME_ROOT_WINDOW (f)); > > > > should have reliably reset Vwindow_list to nil. > > AFAIR, the code which runs after that call recalculated Vwindow_list, > adding to it those windows with no buffer. Specifically, here's what happens: . We call wset_buffer (w, other_buffer_safely (Fcurrent_buffer ())); . other_buffer_safely cannot find a single buffer that satisfies the candidate_buffer condition, so it ends up recreating *scratch* (whose deletion caused this mess to begin with) by calling get-scratch-buffer-create in Lisp . get-scratch-buffer-create calls substitute-command-keys to produce the blurb we put in the comment at the beginning of *scratch* . substitute-command-keys uses a temporary buffer to format the message, and calls kill-buffer to delete that buffer when it's done . kill-buffer calls replace_buffer_in_windows, which calls replace-buffer-in-windows in Lisp . replace-buffer-in-windows calls window-list-1, which calls window_list, which fills Vwindow_list with windows that have no buffer: (gdb) pp Vwindow_list (# #) . one of these windows gets assigned a buffer, eventually, since it's a selected-window, but the other window stays without a buffer, and causes a crash in the following redisplay