From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Daniel Clemente Newsgroups: gmane.emacs.bugs Subject: bug#71274: 30.0.50; assertion failed: w->window_end_valid, in find_first_unchanged_at_end_row Date: Fri, 31 May 2024 10:08:18 +0000 Message-ID: References: <86le3rr0lm.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="10351"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 71274@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri May 31 12:11:23 2024 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 1sCzEI-0002Zf-R8 for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 31 May 2024 12:11:22 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sCzDp-00061Q-5Q; Fri, 31 May 2024 06:10:53 -0400 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 1sCzDn-00060k-Jh for bug-gnu-emacs@gnu.org; Fri, 31 May 2024 06:10:51 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sCzDn-0007fm-Bv for bug-gnu-emacs@gnu.org; Fri, 31 May 2024 06:10:51 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sCzDy-0004ej-12 for bug-gnu-emacs@gnu.org; Fri, 31 May 2024 06:11:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Daniel Clemente Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 31 May 2024 10:11:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 71274 X-GNU-PR-Package: emacs Original-Received: via spool by 71274-submit@debbugs.gnu.org id=B71274.171715020517823 (code B ref 71274); Fri, 31 May 2024 10:11:01 +0000 Original-Received: (at 71274) by debbugs.gnu.org; 31 May 2024 10:10:05 +0000 Original-Received: from localhost ([127.0.0.1]:53265 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sCzD2-0004dP-EU for submit@debbugs.gnu.org; Fri, 31 May 2024 06:10:04 -0400 Original-Received: from mail-vk1-f177.google.com ([209.85.221.177]:57446) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sCzCz-0004cp-W5 for 71274@debbugs.gnu.org; Fri, 31 May 2024 06:10:04 -0400 Original-Received: by mail-vk1-f177.google.com with SMTP id 71dfb90a1353d-4eaee52aefbso609097e0c.2 for <71274@debbugs.gnu.org>; Fri, 31 May 2024 03:09:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1717150125; x=1717754925; darn=debbugs.gnu.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=QaalDgHCgz3V14pDr+ZMk5nbCF6CP1kaXNvq7kxTWjI=; b=heNVok0XYFcbQItwfhfC+RxYdlmdCC5z8us3paMjmGSjykJgm7xALn3Y4sS4V+1SdD g3rRHqShwfj2uLrbVhKQcrQIEd1vFHX4s0nzQcu6FfQgSaKyXcZXf2lfu2ofsB1mAvqH VPz/x8JFipF9VC425+GcPItJVpHESaaRwx2+o+ZHfqcgvv3eiuNPN3wnvpEW/BE4eDno MwdFxYpv7RX2Me28sRQhgMQdDvSyaxpw/fsxc+MvZO7cyFkqZnOO7WdRqVGKnJqv6FV/ 2EHUVE9ThOmYrqDpxt3ghyOlvuUfgeWaEZ0afco6qJJxsuZ10ev2jHuRi0W8DGW6X95Z ecDA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717150125; x=1717754925; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=QaalDgHCgz3V14pDr+ZMk5nbCF6CP1kaXNvq7kxTWjI=; b=HXKXMiIQOj4oVYMRXvLDGgB4b2NFyoglROq1et58AF3VungfXlFW3nLHoqwPtVD/My GnsYHDIreEZdnHCZSJ7wx5b6NmOWtflffzdg/SqiUVPZ0+n1jAJiMYt1ogW2xXEPnyQN GIK2DmNHbWaoQZ4ledz8nnBfb6gdvHKwsDH/xdV4SbQSRoMoB+nw+q96RfCAiv4UsRBV icr3MzRp6t4q/tKFP9gxOog3hyoLGhqrcw3a49nBrsUOcPhA71COM9X078rjDHvWOAkC H5jXY5/yhJN6fC5XSruTlnChyA1j25CRWOHMdWuWwX8Bp2xwElkCpTlO/KBD8gLAWE8V LSgw== X-Gm-Message-State: AOJu0Yx03oCrtNdLnd+0cH+xQolk7etMfRf4VZchXFq9jgH/ZBZ3IZCF mghQ/N6kspXdPdbuRyYoLPynoPhl/bd6dZSescL2ohDkwzbxXCUBTuD7f5rkCWCe4VukI2t1Z3d K2kAG8U5WE5/o6x/JFkyApveElFYCJEGk X-Google-Smtp-Source: AGHT+IF1h4GCXmDGzU8mlWnZdRA0GLov/310Ux6VAbtwozbXPm9GjbuB+tl/q2irP4rOStxxVNZQdv/N0LN0BcrVltA= X-Received: by 2002:a05:6122:3c8e:b0:4e9:7df0:dc76 with SMTP id 71dfb90a1353d-4eb02f1dbc7mr1675291e0c.14.1717150125151; Fri, 31 May 2024 03:08:45 -0700 (PDT) In-Reply-To: <86le3rr0lm.fsf@gnu.org> 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:286269 Archived-At: > However, find_first_unchanged_at_end_row is called from try_window_id: > > #3 0x00005555555de527 in try_window_id (w=0x5555622c4f68) at xdisp.c:22347 > And that function already checked that w->window_end_valid is > non-zero, several dozens of lines before that: > /* Verify that display wasn't paused. */ > if (!w->window_end_valid) > GIVE_UP (8); Between this check (the one "several dozens of lines before that"), and the call to find_first_unchanged_at_end_row, something has the side effect of changing window_end_valid to false. In particular: if (last_unchanged_at_beg_row) { /* Avoid starting to display in the middle of a character, a TAB for instance. This is easier than to set up the iterator exactly, and it's not a frequent case, so the additional effort wouldn't really pay off. */ while ((MATRIX_ROW_ENDS_IN_MIDDLE_OF_CHAR_P (last_unchanged_at_beg_row) || last_unchanged_at_beg_row->ends_in_newline_from_string_p) && last_unchanged_at_beg_row > w->current_matrix->rows) --last_unchanged_at_beg_row; if (MATRIX_ROW_ENDS_IN_MIDDLE_OF_CHAR_P (last_unchanged_at_beg_row)) GIVE_UP (17); if (! init_to_row_end (&it, w, last_unchanged_at_beg_row)) GIVE_UP (18); Before that last init_to_row_end, w->window_end_valid was true, and, after it, it was false. I saw it through fprintfs added before and after the line. It's not always like that; sometimes it just stays true all through. I still don't know the conditions to reproduce this, but I have seen this bug 4 or 5 times yesterday+today. So it must be a side effect of init_to_row_end. I didn't have to read its code yet. By the way, could this comment in try_window_id explain what is happening? Maybe this part needs to be moved earlier. /* The redisplay iterations in display_line above could have triggered font-lock, which could have done something that invalidates IT->w window's end-point information, on which we rely below. E.g., one package, which will remain unnamed, used to install a font-lock-fontify-region-function that called bury-buffer, whose side effect is to switch the buffer displayed by IT->w, and that predictably resets IT->w's window_end_valid flag, which we already tested at the entry to this function. Amply punish such packages/modes by giving up on this optimization in those cases. */ if (!w->window_end_valid) { clear_glyph_matrix (w->desired_matrix); return -1; }