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#56561: 29.0.50; Infloop in try_window Date: Fri, 15 Jul 2022 18:27:15 +0300 Message-ID: <83fsj2s8fg.fsf@gnu.org> References: <874jzjwmhn.fsf@md5i.com> <83v8rzsdd1.fsf@gnu.org> <878rovxqjo.fsf@md5i.com> <83sfn2sy19.fsf@gnu.org> <83lesusl4w.fsf@gnu.org> <87lesumqgf.fsf@yahoo.com> <83ilnysbc5.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="32870"; mail-complaints-to="usenet@ciao.gmane.io" Cc: mwd@md5i.com, 56561@debbugs.gnu.org To: luangruo@yahoo.com Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Jul 15 17:28:13 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 1oCNEj-0008Nj-EF for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 15 Jul 2022 17:28:13 +0200 Original-Received: from localhost ([::1]:54132 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oCNEh-0002Gf-W7 for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 15 Jul 2022 11:28:12 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:48896) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oCNEZ-0002G0-1c for bug-gnu-emacs@gnu.org; Fri, 15 Jul 2022 11:28:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:44253) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oCNEY-0005hG-PK for bug-gnu-emacs@gnu.org; Fri, 15 Jul 2022 11:28:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oCNEY-0004jA-Dz for bug-gnu-emacs@gnu.org; Fri, 15 Jul 2022 11:28:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 15 Jul 2022 15:28:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 56561 X-GNU-PR-Package: emacs Original-Received: via spool by 56561-submit@debbugs.gnu.org id=B56561.165789884718124 (code B ref 56561); Fri, 15 Jul 2022 15:28:02 +0000 Original-Received: (at 56561) by debbugs.gnu.org; 15 Jul 2022 15:27:27 +0000 Original-Received: from localhost ([127.0.0.1]:42012 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oCNDy-0004iF-Dx for submit@debbugs.gnu.org; Fri, 15 Jul 2022 11:27:26 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:35506) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oCNDw-0004i2-JH for 56561@debbugs.gnu.org; Fri, 15 Jul 2022 11:27:25 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:34856) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oCNDr-0005NF-8X; Fri, 15 Jul 2022 11:27:19 -0400 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=Ay4VlCmhdCEMhNJUIGaxKHKL1t0VzbjnnQG84C/rK9I=; b=C9eZHk+33sIu d/MTF3WjRmRLlnN0YnnHhPJOM2bWR/VdCloi7okokttH5G2ASpxuuyDrZhp/z2ZkswnrlAFLhaoNM scCYaACAi3llbM7l2zI31CkOQ2K95bHPzgfmdkcbatqOjM7fRI7OjBN/Xr0D0MrxledynaD/z9jqz bd4qCb5v7Ag7/PuRH1zogDSebRKmA/nA5uEwsWIN+fJFcKkl8QeOGcttzYaqPVajOy2TJbv1wUVkA /B6/PgexZpPh3EHS0WkcTHVdY8wsEdVC994IRT5ordW8mRzUEWkfDmGRrKVm6q6GNdNAGLcrjgF26 ojOPRPUOpx6tSe/vY2FtRQ==; Original-Received: from [87.69.77.57] (port=3461 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 1oCNDq-0006ix-OC; Fri, 15 Jul 2022 11:27:19 -0400 In-Reply-To: <83ilnysbc5.fsf@gnu.org> (message from Eli Zaretskii on Fri, 15 Jul 2022 17:24:26 +0300) 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" Xref: news.gmane.io gmane.emacs.bugs:237114 Archived-At: > Cc: mwd@md5i.com, 56561@debbugs.gnu.org > Date: Fri, 15 Jul 2022 17:24:26 +0300 > From: Eli Zaretskii > > > From: Po Lu > > Cc: mwd@md5i.com, 56561@debbugs.gnu.org > > Date: Fri, 15 Jul 2022 21:54:24 +0800 > > > > BTW, I have a question about the fix: redisplay cannot run when a > > tooltip is displayed as popup menu help-text, so adjust_glyph_matrix and > > the subsequent try_window call that is required to generate the display > > contents will not be called in time, leading to a blank tooltip. > > > > The call could previously never fail, since the tooltip code specifies > > TRY_WINDOW_IGNORE_FONTS_CHANGE. > > > > Would it be appropriate to call adjust_frame_glyphs and try_window again > > if this call to try_window in Fx_show_tip fails? > > You mean, adjust_frame_glyphs, right? > > We probably should do that On second thought, I take this back. I don't see how we could have a blank tooltip. We call try_window just so we could compute the size of the text in it, which then allows us to know the size of the tooltip. The situation where nrows_scale_factor is increased happens when we get to the bottom of the window, which for a tooltip means we already laid out all the text and are just producing empty glyph rows beyond the end of the text. ncols_scale_factor could theoretically happen before we reach the end of the text, but I'd like to see something like that happening before I believe it; and even if it does happen in the very first line, the tooltip will not be empty, just truncated. So I cannot see how this case could produce an empty tooltip, and I have hard time imagining how it could even produce a truncated text. We could add an assertion to verify that try_window gets to ZV in this case before it returns, if we want to be able to detect those cases. > We need a recipe to trigger the reverse, to be able to test a > solution. That part is still true.