Subject: bug#45737: 27.1.50; Assertion failure in window_box_height

From: Eli Zaretskii <[email-masked]>
Date: Sat, 09 Jan 2021 12:00:50 +0200

> From: martin rudalics <[email-masked]>
> Date: Sat, 9 Jan 2021 10:33:02 +0100
> 
> (progn
>    (tab-line-mode)
>    (split-window (split-window) nil t)
>    (split-window)
>    (split-window (split-window nil nil t) nil t))
> 
> and resizing the frame by dragging its lower right corner with the mouse
> to very small rectangles I can trigger the following assertion failure:
> 
> ../../src/xdisp.c:1170: Emacs fatal error: assertion failed: height >= 0
> [...]
> Lisp Backtrace:
> "redisplay_internal (C function)" (0x0)
> (gdb) frame 2
> #2  0x0000000000458382 in window_box_height (w=0x149d100) at ../../src/xdisp.c:1170
> 1170	  eassert (height >= 0);
> (gdb) p height
> $2 = -54
> (gdb)
> 
> indicates that the total height of one of the windows dropped to -54
> pixels.  The problematic code is in 'window-sizable' which is not
> prepared for the case that window sizes can drop below their minimum
> size, something which can happen when a frame with many windows is made
> very small.  I propose the attached patch to fix this.  OK to install?

What happens in the above scenario with your patch installed?