unofficial mirror of bug-gnu-emacs@gnu.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 10:42:23 +0300	[thread overview]
Message-ID: <87im03tc6g.fsf@mail.linkov.net> (raw)
In-Reply-To: <83k0kj6gmq.fsf@gnu.org> (Eli Zaretskii's message of "Tue, 17 Aug 2021 22:00:29 +0300")

>> (gdb) xstring
>> $8 = (struct Lisp_String *) 0x7f015341fb80
>> " *Minibuf-0*"
>
> Hm... something else is at work here.

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.  The steps are following:

1. message3_nolog calls echo_area_display
2. echo_area_display calls redisplay_internal
3. redisplay_internal clears all matrices with clear_desired_matrices
4. redisplay_internal calls echo_area_display
   that temporarily changes mini_window's buffer
   from " *Minibuf-0*" to " *Echo Area 0*".
   This updates w->desired_matrix to contain information
   about " *Echo Area 0*" displayed in the mini_window.
   But unwind_with_echo_area_buffer immediately
   changes mini_window's buffer back to empty " *Minibuf-0*".
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:

(gdb) l
14896		    cursor_row = MATRIX_ROW (w->desired_matrix, w->cursor.vpos);
(gdb) p *cursor_row
...
  start = {
    pos = {
      charpos = 1737,
      bytepos = 1737
    },
...
  end = {
    pos = {
      charpos = 2150,
      bytepos = 2150

These numbers are valid positions in " *Echo Area 0*"
that was temporarily displayed in mini_window,
but now mini_window's buffer is empty " *Minibuf-0*".

>> PS: Some commit between e2eb58c487 and 31ab12e261 broke that,
>> but maybe this is not important because these commits
>> just changed the length of the git command by adding ":(literal)",
>> and length change maybe exposed some other problem.
>
> 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:

diff --git a/lisp/vc/vc-git.el b/lisp/vc/vc-git.el
index ffe1e6832c..0bea987a06 100644
--- a/lisp/vc/vc-git.el
+++ b/lisp/vc/vc-git.el
@@ -950,7 +950,7 @@ vc-git-checkin
                (lambda (value) (when (equal value "yes") (list argument)))))
       ;; When operating on the whole tree, better pass "-a" than ".", since "."
       ;; fails when we're committing a merge.
-      (apply #'vc-git-command nil 0 (if only (vc-git--literal-pathspecs files))
+      (apply #'vc-git-command nil 0 (if only files)
              (nconc (if msg-file (list "commit" "-F"
                                        (file-local-name msg-file))
                       (list "commit" "-m"))

I guess additional ":(literal)" string increases the length
of the displayed message, and longer message triggers the bug.





  reply	other threads:[~2021-08-18  7:42 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 [this message]
2021-08-18 12:18                   ` Eli Zaretskii
2021-08-18 16:32                     ` Juri Linkov
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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=87im03tc6g.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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).