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#50096: args-out-of-range in redisplay_internal Date: Wed, 18 Aug 2021 15:18:29 +0300 Message-ID: <834kbn54kq.fsf@gnu.org> References: <87r1esys1a.fsf@mail.linkov.net> <83v94456sn.fsf@gnu.org> <87h7foyo67.fsf@mail.linkov.net> <87im04x8mm.fsf@mail.linkov.net> <83sfz8543o.fsf@gnu.org> <874kbox736.fsf@mail.linkov.net> <83mtpf6hjb.fsf@gnu.org> <87eearx5tz.fsf@mail.linkov.net> <83k0kj6gmq.fsf@gnu.org> <87im03tc6g.fsf@mail.linkov.net> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="7294"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 50096@debbugs.gnu.org To: Juri Linkov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Aug 18 14:19:15 2021 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 1mGKXK-0001Xw-P2 for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 18 Aug 2021 14:19:14 +0200 Original-Received: from localhost ([::1]:49448 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mGKXE-0006ty-I7 for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 18 Aug 2021 08:19:08 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:43700) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mGKX9-0006tp-64 for bug-gnu-emacs@gnu.org; Wed, 18 Aug 2021 08:19:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:43517) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mGKX8-0007ni-1R for bug-gnu-emacs@gnu.org; Wed, 18 Aug 2021 08:19:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mGKX7-0004hO-Lz for bug-gnu-emacs@gnu.org; Wed, 18 Aug 2021 08:19:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 18 Aug 2021 12:19:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 50096 X-GNU-PR-Package: emacs Original-Received: via spool by 50096-submit@debbugs.gnu.org id=B50096.162928912018030 (code B ref 50096); Wed, 18 Aug 2021 12:19:01 +0000 Original-Received: (at 50096) by debbugs.gnu.org; 18 Aug 2021 12:18:40 +0000 Original-Received: from localhost ([127.0.0.1]:55063 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mGKWl-0004gk-Uu for submit@debbugs.gnu.org; Wed, 18 Aug 2021 08:18:40 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:55320) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mGKWg-0004gS-IU for 50096@debbugs.gnu.org; Wed, 18 Aug 2021 08:18:38 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:44700) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mGKWa-0007Vh-TE; Wed, 18 Aug 2021 08:18:28 -0400 Original-Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:1208 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 1mGKWZ-0000Lb-Oe; Wed, 18 Aug 2021 08:18:28 -0400 In-Reply-To: <87im03tc6g.fsf@mail.linkov.net> (message from Juri Linkov on Wed, 18 Aug 2021 10:42:23 +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:212130 Archived-At: > From: Juri Linkov > Cc: 50096@debbugs.gnu.org > Date: Wed, 18 Aug 2021 10:42:23 +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. Yes, some code switches to another buffer at the wrong moment. > 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: Any idea why we call hscroll_window_tree in this case? 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. > > 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?