From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: martin rudalics Newsgroups: gmane.emacs.bugs Subject: bug#45737: 27.1.50; Assertion failure in window_box_height Date: Sat, 9 Jan 2021 10:33:02 +0100 Message-ID: <2fcf7ec9-8b85-e81f-6ae3-9d08abda8b3f@gmx.at> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------3F442C920321F473A41BAECB" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="31985"; mail-complaints-to="usenet@ciao.gmane.io" To: 45737@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Jan 09 10:34:32 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 1kyAdk-0008CZ-Ir for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 09 Jan 2021 10:34:32 +0100 Original-Received: from localhost ([::1]:48736 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kyAdj-0004JO-L7 for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 09 Jan 2021 04:34:31 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:52160) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kyAdG-0003zY-Mm for bug-gnu-emacs@gnu.org; Sat, 09 Jan 2021 04:34:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:39674) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kyAdG-0000R1-EE for bug-gnu-emacs@gnu.org; Sat, 09 Jan 2021 04:34:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kyAdG-0005fp-A5 for bug-gnu-emacs@gnu.org; Sat, 09 Jan 2021 04:34:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: martin rudalics Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 09 Jan 2021 09:34:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 45737 X-GNU-PR-Package: emacs X-Debbugs-Original-To: Bug-Gnu-Emacs Original-Received: via spool by submit@debbugs.gnu.org id=B.161018479121744 (code B ref -1); Sat, 09 Jan 2021 09:34:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 9 Jan 2021 09:33:11 +0000 Original-Received: from localhost ([127.0.0.1]:51220 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kyAcR-0005ee-8d for submit@debbugs.gnu.org; Sat, 09 Jan 2021 04:33:11 -0500 Original-Received: from lists.gnu.org ([209.51.188.17]:41772) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kyAcQ-0005eX-35 for submit@debbugs.gnu.org; Sat, 09 Jan 2021 04:33:10 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:52108) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kyAcP-0003mT-SL for bug-gnu-emacs@gnu.org; Sat, 09 Jan 2021 04:33:09 -0500 Original-Received: from mout.gmx.net ([212.227.17.21]:37723) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kyAcM-0008QT-Mf for bug-gnu-emacs@gnu.org; Sat, 09 Jan 2021 04:33:09 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1610184783; bh=5wpzzzwJBuexeylK0ubNWImoAu1rYVAESnruPi1obrU=; h=X-UI-Sender-Class:To:From:Subject:Date; b=b7KfDPWagG/rwLsAMdRQJb/+rn07BqWv6ZbSl1Y15xl8tAfEHNaftosyZHi7Unwwb 4IUoGnGjK0/gyGVBjKTHrdzvF0nQaVAJEHuPUVlw7WKiCRPin7fFz7Pfgw63CyHtJW Hx/SrOiponXq5pGMToonUT1e320s4cHLuoeK3wMQ= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Original-Received: from [192.168.1.100] ([212.95.5.231]) by mail.gmx.com (mrgmx104 [212.227.17.168]) with ESMTPSA (Nemesis) id 1Mlw7f-1kGYTU0OLj-00izkI for ; Sat, 09 Jan 2021 10:33:03 +0100 Content-Language: en-US X-Provags-ID: V03:K1:g02EY9G9Cx9QAtuasC5ZQRDkjKkSlB4ucTKPQPQgAl6VQV/D5mC NuNYRe9vSXYlmSpvr1Ctjg7DysUbzXnyqZP6IHxSDOiA45jSfEhiARR65DYv3ku/4NPSiqk RxBPrJu2jHjiF3Va3wiYGxamOnw8/Xh6TTLrPKCYIJ7sJvl5Rp0eqvLJ8auNH2S49L7q5k5 7KRLRs+Agcw3m0oRDTOjw== X-UI-Out-Filterresults: notjunk:1;V03:K0:mTstSmlJtiU=:7Y5zm//MUMNZ+hUy7GLe6R vV9S5N5kV9y4+5ENM5lDHSUziBNwHBIPRjzGlHyB7cWLVIaO32pO4Nx8Iz9mMXkm+fDtiwUyg /eut8VpMAcZVEjIrcct/2LMwxo9OeEqEfs/EpWGnloGDrn2zMu+dKk4yzNqPP2e/RIE1B11Ux 2CVfzTiQ/3l+uDz5AjGI5IY+3aO30Oh+pelBlar6Tf1mJ6kN0+Ty6IBAkNMIiDK4UcxY/sPf9 DPW/2Jdzh8GObXzSfz4vXiy3f0N5TKUKagkqExIkroQ1uI1jm/b8Ko3Avp94d61KlNJ05rxR5 VGR6GYVR04r/T4mS9mGHFLYhRMCHxrUTRJ0gvw1K1EJQ+XDJBhlPZb2h/MYdEclcOj3dESEP0 uHr502Jw01QBXEtViusq+mJ1N5J9ysaJP3K8Lb4OwMQfZfn7/WxkJJ7HzPq7t21UGEacBUExj MFJ8GI+68omNjUnqYi2Y1vEhkRPOf16m787kYgEkSdk2cDl1jyPoQ3uQ2mlBPx9hUnA0qVqPB GrjzrolWgVbLOKRkz2cC+IODeCRb+3AXmL8nc/vnkDAHBDtcnpSQ9ZDjaReJdeQ9egaiTHFdh ntmmFR8nghE3EzsLwFcgF/Jzhom1Vkxc5trTuxqa2zgY3/Up9XTHf4nlmRpaEIINy0JCoNF6Q pI3DuIdkRMFjQbrJ3X7hHwRv2afR1JQBX0B4+ziTMpISTmgTv5qH/bn6kRR7wBXPlZ7+SpseV rPnpoS+3UCcDgg+9VCa+7VrypnTlnaTkeJvK4bhnDifHU9gpXwewQMpLLUIXZza3NnNeKpjS Received-SPF: pass client-ip=212.227.17.21; envelope-from=rudalics@gmx.at; helo=mout.gmx.net X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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:197540 Archived-At: This is a multi-part message in MIME format. --------------3F442C920321F473A41BAECB Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit With the current release version running emacs -Q, evaluating (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 The backtrace (gdb) bt #0 0x000000000063e1b3 in terminate_due_to_signal (sig=6, backtrace_limit=2147483647) at ../../src/emacs.c:379 #1 0x000000000075894d in die (msg=0x96109c "height >= 0", file=0x961032 "../../src/xdisp.c", line=1170) at ../../src/alloc.c:7240 #2 0x0000000000458382 in window_box_height (w=0x149d100) at ../../src/xdisp.c:1170 #3 0x00000000004212da in required_matrix_height (w=0x149d100) at ../../src/dispnew.c:1740 #4 0x000000000042147d in allocate_matrices_for_window_redisplay (w=0x149d100) at ../../src/dispnew.c:1806 #5 0x00000000004220ed in adjust_frame_glyphs_for_window_redisplay (f=0x1422c60) at ../../src/dispnew.c:2123 #6 0x0000000000421547 in adjust_frame_glyphs (f=0x1422c60) at ../../src/dispnew.c:1827 #7 0x00000000004fd9f9 in resize_mini_window_apply (w=0x149d100, delta=-72) at ../../src/window.c:5216 #8 0x00000000004fdb98 in grow_mini_window (w=0x149d100, delta=18) at ../../src/window.c:5251 #9 0x0000000000481952 in resize_mini_window (w=0x149d100, exact_p=false) at ../../src/xdisp.c:11715 #10 0x0000000000480969 in display_echo_area_1 (a1=21614848, a2=XIL(0)) at ../../src/xdisp.c:11557 #11 0x000000000047fc66 in with_echo_area_buffer (w=0x149d100, which=1, fn=0x480933 , a1=21614848, a2=XIL(0)) at ../../src/xdisp.c:11327 #12 0x00000000004808de in display_echo_area (w=0x149d100) at ../../src/xdisp.c:11523 #13 0x0000000000483022 in echo_area_display (update_frame_p=false) at ../../src/xdisp.c:12038 #14 0x00000000004898c5 in redisplay_internal () at ../../src/xdisp.c:15456 #15 0x000000000048b5e3 in redisplay_preserve_echo_area (from_where=11) at ../../src/xdisp.c:16125 #16 0x000000000084ed6c in wait_reading_process_output (time_limit=30, nsecs=0, read_kbd=-1, do_display=true, wait_for_cell=XIL(0), wait_proc=0x0, just_wait_proc=0) at ../../src/process.c:5482 #17 0x000000000042cbb2 in sit_for (timeout=make_fixnum(30), reading=true, display_option=1) at ../../src/dispnew.c:6064 #18 0x000000000064fe21 in read_char (commandflag=1, map=XIL(0x10878b3), prev_event=XIL(0), used_mouse_menu=0x7fffffffe10f, end_time=0x0) at ../../src/keyboard.c:2738 #19 0x00000000006621ef in read_key_sequence (keybuf=0x7fffffffe2a0, prompt=XIL(0), dont_downcase_last=false, can_return_switch_frame=true, fix_current_buffer=true, prevent_redisplay=false) at ../../src/keyboard.c:9554 #20 0x000000000064b774 in command_loop_1 () at ../../src/keyboard.c:1350 #21 0x00000000007afe18 in internal_condition_case (bfun=0x64b2f8 , handlers=XIL(0x90), hfun=0x64a907 ) at ../../src/eval.c:1356 #22 0x000000000064aedd in command_loop_2 (ignore=XIL(0)) at ../../src/keyboard.c:1091 #23 0x00000000007af2cc in internal_catch (tag=XIL(0xd110), func=0x64aeb0 , arg=XIL(0)) at ../../src/eval.c:1117 #24 0x000000000064ae7b in command_loop () at ../../src/keyboard.c:1070 #25 0x000000000064a3ee in recursive_edit_1 () at ../../src/keyboard.c:714 #26 0x000000000064a5e6 in Frecursive_edit () at ../../src/keyboard.c:786 #27 0x00000000006409ef in main (argc=4, argv=0x7fffffffe798) at ../../src/emacs.c:2066 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? martin In GNU Emacs 27.1.90 (build 2, x86_64-pc-linux-gnu, GTK+ Version 3.24.5) of 2021-01-09 built on restno Repository revision: 74d18957b898e687dcc07ba86559367c8d8ba482 Repository branch: emacs-27 Windowing system distributor 'The X.Org Foundation', version 11.0.12004000 System Description: Debian GNU/Linux 10 (buster) Recent messages: For information about GNU Emacs and the GNU system, type C-h C-a. Configured using: 'configure --with-gif=ifavailable --with-tiff=ifavailable --with-gnutls=no --without-pop --enable-gcc-warnings=warn-only --enable-checking=yes --enable-check-lisp-object-type=yes 'CFLAGS=-O0 -g3 -no-pie'' Configured features: XPM JPEG GIF PNG SOUND DBUS GSETTINGS GLIB NOTIFY INOTIFY LIBSELINUX FREETYPE HARFBUZZ XFT ZLIB TOOLKIT_SCROLL_BARS GTK3 X11 XDBE XIM MODULES THREADS PDUMPER Important settings: value of $LANG: de_AT.UTF-8 value of $XMODIFIERS: @im=ibus locale-coding-system: utf-8-unix Major mode: Lisp Interaction Minor modes in effect: tooltip-mode: t global-eldoc-mode: t eldoc-mode: t electric-indent-mode: t mouse-wheel-mode: t tool-bar-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t line-number-mode: t transient-mark-mode: t Load-path shadows: None found. Features: (shadow sort mail-extr emacsbug message rmc puny dired dired-loaddefs format-spec rfc822 mml easymenu mml-sec password-cache epa derived epg epg-config gnus-util rmail rmail-loaddefs text-property-search time-date subr-x seq byte-opt gv bytecomp byte-compile cconv mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader cl-loaddefs cl-lib sendmail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils tooltip eldoc electric uniquify ediff-hook vc-hooks lisp-float-type mwheel term/x-win x-win term/common-win x-dnd tool-bar dnd fontset image regexp-opt fringe tabulated-list replace newcomment text-mode elisp-mode lisp-mode prog-mode register page tab-bar menu-bar rfn-eshadow isearch timer select scroll-bar mouse jit-lock font-lock syntax facemenu font-core term/tty-colors frame minibuffer cl-generic cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese composite charscript charprop case-table epa-hook jka-cmpr-hook help simple abbrev obarray cl-preloaded nadvice loaddefs button faces cus-face macroexp files text-properties overlay sha1 md5 base64 format env code-pages mule custom widget hashtable-print-readable backquote threads dbusbind inotify dynamic-setting system-font-setting font-render-setting move-toolbar gtk x-toolkit x multi-tty make-network-process emacs) Memory information: ((conses 16 43920 4887) (symbols 48 5978 1) (strings 32 15451 1816) (string-bytes 1 503632) (vectors 16 9266) (vector-slots 8 124434 11300) (floats 8 20 29) (intervals 56 195 0) (buffers 1000 11)) --------------3F442C920321F473A41BAECB Content-Type: text/x-patch; name="window-sizable.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="window-sizable.diff" --- a/lisp/window.el +++ b/lisp/window.el @@ -1716,9 +1716,11 @@ window-sizable (setq window (window-normalize-window window)) (cond ((< delta 0) - (max (- (window-min-size window horizontal ignore pixelwise) - (window-size window horizontal pixelwise)) - delta)) + (let ((min-size (window-min-size window horizontal ignore pixelwise)) + (size (window-size window horizontal pixelwise))) + (if (<= size min-size) + 0 + (max (- min-size size) delta)))) ((> delta 0) (if (window-size-fixed-p window horizontal ignore) 0 --------------3F442C920321F473A41BAECB--