unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Thomas Fitzsimmons <fitzsim@fitzsim.org>
Cc: 63711@debbugs.gnu.org
Subject: bug#63711: 30.0.50; Crash in xdisp.c when it->string is 0x0
Date: Thu, 25 May 2023 18:54:13 +0300	[thread overview]
Message-ID: <83353kmmoq.fsf@gnu.org> (raw)
In-Reply-To: <m34jo0302k.fsf@fitzsim.org> (message from Thomas Fitzsimmons on Thu, 25 May 2023 11:25:23 -0400)

> From: Thomas Fitzsimmons <fitzsim@fitzsim.org>
> Cc: 63711@debbugs.gnu.org
> Date: Thu, 25 May 2023 11:25:23 -0400
> 
> >   (gdb) prow
> 
> y=701 x=0 pwid=1287 a+d=18+5=23 phys=16+4=20 vis=23
> used=(LMargin=0,Text=113,RMargin=0) Hash=258184180
> start=0 end=0 ENA MODEL
> 
> >   (gdb) pgrow
> 
> TEXT: 113 glyphs
>   0    0: CHAR[ ] str=0xf188ab16[0] blev=0,btyp=L w=11 a+d=18+5 face=1
>   1   11: CHAR[U] str=0x1ccec60[1] blev=0,btyp=L w=11 a+d=18+5 face=1
>   2   22: CHAR[:] str=0x4e125d0[0] blev=0,btyp=L w=11 a+d=18+5 face=1
>   3   33: STRETCH[23+18] str=0x1ccecb8[0] w=33 a+d=18+5 face=1
>   4   66: CHAR[@] str=0x1ccecb8[0] blev=0,btyp=L w=11 a+d=18+5 face=1

This is the mode line: first sign of trouble.  We are handling a
mode-line glyph row as if it were a text row.  That cannot lead to
anything good, ever.

> >   (gdb) p first_reusable_row - start_row
> 
> $22 = 15
> 
> >   (gdb) p first_row_to_display - start_row
> 
> $23 = 30

So we think that the first glyph row to display is screen line 30
(zero-based).  Is it true that the window was supposed to have only 30
lines in its body, not 31?

> >   (gdb) p first_row_to_display->y
> 
> $24 = 701
> 
> >   (gdb) p window_text_bottom_y(w)
> 
> $25 = 701

And this also tells us that we are using the wrong glyph row, I think:
its Y coordinate is outside of the visible text area.

I think I understand the problem.  Let me think about a solution.
Please leave this GDB session running, in case I'll need some more
data from it.

> > But there weren't supposed to be any overlays at the beginning of the
> > buffer, right?
> 
> Correct, there weren't supposed to be any overlays at the beginning of
> the buffer -- as far as I know, anyway.  I didn't explicitly do anything
> with overlays.

The window doesn't display the beginning of the buffer, it displays
starting at buffer position 142803, see the glyphs of start_row.  The
zero position we get in pos->pos.charpos is because that's a position
of the string from which the mode line was generated.

> > Can you describe your experiments with font-locking JavaScript?  Which
> > display-related features did you try?
> 
> I was enabling and disabling font-lock-mode, running font-lock-ensure
> and font-lock-flush on temporary buffers (not in the js.el buffer).  I
> wasn't doing anything particularly fancy or low-level, just elisp-level
> function calls and changing font-lock variable settings, primarily the
> js keyword variables.

OK.





  reply	other threads:[~2023-05-25 15:54 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-25  6:27 bug#63711: 30.0.50; Crash in xdisp.c when it->string is 0x0 Thomas Fitzsimmons
2023-05-25  7:34 ` Eli Zaretskii
2023-05-25 13:02   ` Thomas Fitzsimmons
2023-05-25 13:35     ` Eli Zaretskii
2023-05-25 13:50       ` Thomas Fitzsimmons
2023-05-25 15:11         ` Eli Zaretskii
2023-05-25 15:25           ` Thomas Fitzsimmons
2023-05-25 15:54             ` Eli Zaretskii [this message]
2023-05-25 17:43               ` Thomas Fitzsimmons
2023-05-25 17:52               ` Eli Zaretskii
2023-05-25 18:12                 ` Thomas Fitzsimmons
2023-06-01  3:19                   ` Thomas Fitzsimmons
2023-06-01  6:29                     ` Eli Zaretskii
2023-06-01 11:52                       ` Thomas Fitzsimmons
2023-08-03 17:40                   ` Thomas Fitzsimmons
2023-08-03 18:34                     ` 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=83353kmmoq.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=63711@debbugs.gnu.org \
    --cc=fitzsim@fitzsim.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).