From: Eli Zaretskii <eliz@gnu.org>
To: martin rudalics <rudalics@gmx.at>
Cc: n142857@gmail.com, 73022@debbugs.gnu.org
Subject: bug#73022: 31.0.50; Crash in build_frame_matrix_from_leaf_window after C-x 2 and reducing terminal size
Date: Thu, 05 Sep 2024 18:10:20 +0300 [thread overview]
Message-ID: <86seue2l2b.fsf@gnu.org> (raw)
In-Reply-To: <e8b03cd0-9964-49e7-a08e-1f3a8bd92828@gmx.at> (message from martin rudalics on Thu, 5 Sep 2024 16:45:52 +0200)
> Date: Thu, 5 Sep 2024 16:45:52 +0200
> Cc: n142857@gmail.com, 73022@debbugs.gnu.org
> From: martin rudalics <rudalics@gmx.at>
>
> >> If so, then this violation might be caused by the fact that we
> >> (1) did resize windows according to the new sizes but (2) did not update
> >> the frame sizes accordingly.
> >
> > Can you elaborate on how this could be possible? I always thought we
> > first allocate the frame matrices, and then the window matrices (by
> > suballocating them from the frame matrices). Am I mistaken?
>
> But if glyph_row_slice_p (window_row, frame_row) fails, something else
> must have invalidated that. I made that change here more than three
> years ago and I can neither remember whether an assertion violation made
> me do it or a crash nor why I did chose a term like "congruent" in the
> comment.
I agree with the theory that the frame matrices were reallocated
whereas the window matrices weren't, or the other way around. I just
don't understand how it could have happened, given the code we have.
I noticed that causing this assertion to fail is not very easy. For
example, if I drag the terminal emulator window one line at a time, I
can never cause it, even if I get to frame sizes that are much smaller
than the minimum we need for 2 windows. Somehow, I need to drag the
frame so it resizes by several lines and/or columns. Not sure why.
> One possibility I cannot exclude is that adjust_frame_size tries to
> resize windows, that step (silently) fails in window_resize_check, the
> old values stay in place but the new frame sizes are applied by
> adjust_frame_size. But precisely this scenario cannot be healed by my
> patch so it's unlikely that it was the cause for the problem I
> experienced back then.
What is supposed to happen, with the current code, when the frame is
resized to less than the minimum dimensions we allow? Shouldn't we
disallow/refuse such resizes? And if we don't refuse, what will
happen to the windows? E.g., if the frame is not tall enough to show
the menu bar, the two mode lines, the mini-window, and at least one
line for each of the two windows, what should I expect to see on
display?
> > Moving code in adjust_frame_glyphs could affect the assertion if the
> > assertion was being hit while adjust_frame_glyphs is still being
> > executed. But that is not the case, so I don't understand how moving
> > some code in adjust_frame_glyphs without changing it could affect the
> > assertion violation. I'm probably missing something.
>
> I'm still too dense to understand what "Moving code" and "moving some
> code" could mean in this context. If you have enough patience left,
> please elaborate.
Taking some code and moving it to another place in the same function
can only affect what's going on in that function and the functions it
calls. For example, if you had
foo ();
bar ();
baz ();
and then you move the call to baz to be before the call to bar, like
this:
foo ();
baz ();
bar ();
then I can understand why bar and its subroutines are affected. But
once we are done with this code, all the 3 calls have been made, and
the order in which they were made can hardly matter for the code which
runs after that, right?
So if the crash was inside the call to bar, then I could understand
how moving the call to baz before it could affect the crash. But the
backtrace from the assertion violation didn't show adjust_frame_glyphs
anywhere on the call-stack, so I don't understand how simply
rearranging code inside adjust_frame_glyphs could change something
_outside_ it.
next prev parent reply other threads:[~2024-09-05 15:10 UTC|newest]
Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-04 6:09 bug#73022: 31.0.50; Crash in build_frame_matrix_from_leaf_window after C-x 2 and reducing terminal size Daniel Clemente
[not found] ` <handler.73022.B.172543028723315.ack@debbugs.gnu.org>
2024-09-04 6:25 ` bug#73022: Acknowledgement (31.0.50; Crash in build_frame_matrix_from_leaf_window after C-x 2 and reducing terminal size) Daniel Clemente
2024-09-04 7:28 ` bug#73022: 31.0.50; Crash in build_frame_matrix_from_leaf_window after C-x 2 and reducing terminal size martin rudalics via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-09-04 12:21 ` Eli Zaretskii
2024-09-04 13:23 ` Eli Zaretskii
2024-09-05 8:18 ` martin rudalics via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-09-05 9:19 ` Eli Zaretskii
2024-09-05 14:46 ` martin rudalics via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-09-05 14:58 ` Eli Zaretskii
2024-09-05 15:48 ` martin rudalics via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-09-05 16:05 ` Eli Zaretskii
2024-09-05 16:30 ` martin rudalics via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-09-05 16:58 ` martin rudalics via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-09-05 18:41 ` Eli Zaretskii
2024-09-05 18:15 ` Eli Zaretskii
2024-09-08 11:07 ` Daniel Clemente
2024-09-08 14:36 ` martin rudalics via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-09-05 8:18 ` martin rudalics via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-09-05 9:18 ` Eli Zaretskii
2024-09-05 14:45 ` martin rudalics via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-09-05 15:10 ` Eli Zaretskii [this message]
2024-09-05 16:27 ` martin rudalics via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-09-08 11:08 ` Daniel Clemente
2024-09-08 11:31 ` Eli Zaretskii
2024-09-08 14:58 ` martin rudalics via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-09-10 17:43 ` Daniel Clemente
2024-09-11 8:07 ` martin rudalics via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-09-11 12:22 ` Eli Zaretskii
2024-09-11 14:37 ` martin rudalics via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-09-11 15:06 ` Eli Zaretskii
2024-09-12 9:49 ` martin rudalics via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-09-08 11:09 ` Daniel Clemente
2024-09-08 14:43 ` martin rudalics via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-09-08 15:32 ` Eli Zaretskii
2024-09-08 17:01 ` martin rudalics via Bug reports for GNU Emacs, the Swiss army knife of text editors
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=86seue2l2b.fsf@gnu.org \
--to=eliz@gnu.org \
--cc=73022@debbugs.gnu.org \
--cc=n142857@gmail.com \
--cc=rudalics@gmx.at \
/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.