all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Juri Linkov <juri@linkov.net>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 50096@debbugs.gnu.org
Subject: bug#50096: args-out-of-range in redisplay_internal
Date: Wed, 18 Aug 2021 19:32:01 +0300	[thread overview]
Message-ID: <87y28yspf2.fsf@mail.linkov.net> (raw)
In-Reply-To: <834kbn54kq.fsf@gnu.org> (Eli Zaretskii's message of "Wed, 18 Aug 2021 15:18:29 +0300")

>> I don't understand how this is supposed to work.  The buffer " *Minibuf-0*"
>> is always empty at the time of calling message3_nolog, whereas the buffer
>> " *Echo Area 0*" contains the message to display.
>
> Yes, some code switches to another buffer at the wrong moment.

There are no buffer switching involved neither in the successful case
nor in the failing case.

>> 5. redisplay_internal calls hscroll_window_tree
>>    where cursor_row already contains information
>>    that was valid when " *Echo Area 0*" was temporarily
>>    displayed in mini_window:
>
> Any idea why we call hscroll_window_tree in this case?

Here are all differences in cursor_row between success and failure:

@@ -1,8 +1,8 @@
 (gdb) p *cursor_row
 {
   x = 0,
   y = 228,
-  pixel_width = 1610,
+  pixel_width = 1910,
   ascent = 15,
   height = 19,
   phys_ascent = 12,
@@ -26,8 +26,8 @@
   },
   end = {
     pos = {
-      charpos = 1897,
-      bytepos = 1897
+      charpos = 2150,
+      bytepos = 2150
     },
     overlay_string_index = -1,
     string_pos = {
@@ -41,14 +41,14 @@
     bytepos = 1737
   },
   maxpos = {
-    charpos = 1897,
-    bytepos = 1897
+    charpos = 2150,
+    bytepos = 2150
   },
   overlay_arrow_bitmap = 0,
   left_user_fringe_bitmap = 0,
   right_user_fringe_bitmap = 0,
   left_fringe_bitmap = 0,
-  right_fringe_bitmap = 0,
+  right_fringe_bitmap = 31,
   left_user_fringe_face_id = 0,
   right_user_fringe_face_id = 0,
   left_fringe_face_id = 0,
@@ -59,7 +59,7 @@
   redraw_fringe_bitmaps_p = true,
   enabled_p = true,
   truncated_on_left_p = false,
-  truncated_on_right_p = false,
+  truncated_on_right_p = true,
   continued_p = false,
   displays_text_p = true,
   ends_at_zv_p = true,

When it fails, truncated_on_right_p is true, that causes
executing code block with init_to_row_start in hscroll_window_tree,
that fails with truncated long miniwindow lines.

In the successful case truncated_on_right_p=false allows
hscroll_window_tree to skip the block with init_to_row_start,
and other hscrolling.

> I'm guessing this is due to some customizations of yours, in which
> case I'd appreciate a reproduction recipe starting from "emacs -Q".
> It is very hard to debug such problems via email.

It's 100% reproducible for me, but I'm not sure how easy would be
to create a test case for "emacs -Q".

>> > You are saying that if you remove the ":(literal)" part without
>> > changing anything else, the problem goes away?
>>
>> Indeed, it broke after the commit 3572613550.
>> But after applying this patch it works again without errors:
>
> Does this patch work by preventing hscrolling?
>
>> I guess additional ":(literal)" string increases the length
>> of the displayed message, and longer message triggers the bug.
>
> How does it trigger it? via hscrolling or some other way?

It reduces the length of the displayed message,
so there is no wrapped line and no hscrolling.





  reply	other threads:[~2021-08-18 16:32 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-17 16:06 bug#50096: args-out-of-range in redisplay_internal Juri Linkov
2021-08-17 17:18 ` Eli Zaretskii
2021-08-17 17:30   ` Juri Linkov
2021-08-17 17:51     ` Juri Linkov
2021-08-17 18:16       ` Eli Zaretskii
2021-08-17 18:24         ` Juri Linkov
2021-08-17 18:40           ` Eli Zaretskii
2021-08-17 18:51             ` Juri Linkov
2021-08-17 19:00               ` Eli Zaretskii
2021-08-18  7:42                 ` Juri Linkov
2021-08-18 12:18                   ` Eli Zaretskii
2021-08-18 16:32                     ` Juri Linkov [this message]
2021-08-18 17:01                       ` Eli Zaretskii
2021-08-18 18:07                         ` Eli Zaretskii
2021-08-19  7:17                           ` Juri Linkov
2021-08-19  8:12                             ` Eli Zaretskii
2021-08-19 12:39                               ` Eli Zaretskii
2021-08-20  7:09                                 ` Juri Linkov
2021-08-20  7:49                                   ` Eli Zaretskii
2021-08-19  7:32                   ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87y28yspf2.fsf@mail.linkov.net \
    --to=juri@linkov.net \
    --cc=50096@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.