GNU bug report logs - #4534
assertion failure at window.c:grow_mini_window

Previous Next

Package: emacs;

Reported by: Juanma Barranquero <lekktu <at> gmail.com>

Date: Wed, 23 Sep 2009 03:10:04 UTC

Severity: normal

Done: Juanma Barranquero <lekktu <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Juanma Barranquero <lekktu <at> gmail.com>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: martin rudalics <rudalics <at> gmx.at>, 4534 <at> debbugs.gnu.org
Subject: bug#4534: assertion failure at window.c:grow_mini_window
Date: Sat, 24 Oct 2009 17:37:26 +0200
OK, unless someone opposes I'm going to commit the attached patch.

Currently, both grow_mini_window() and shrink_window_lowest_first() do
in fact accept negative deltas, and act accordingly; so, the names are
misleading with respect to the actual behavior, if not the intent, of
both functions. I'm not comfortable with this, but as Martin said he
was going to rewrite the window code after 23.2, it's a short term
situation anyway.

Other than skipping a useless call to window_min_size() when delta <
0, the patch does not change current behavior, so for people building
without -DXASSERTS it should not introduce any new bug. For those
people with -DXASSERTS, the patch in fact avoids an unnecessary
exception and allows Emacs to continue without incident. That means
there's no obvious downside to this change; even assuming there's a
problem with negative deltas in grow_mini_window(), etc., it is better
to let the negative delta go through with the hope that it will cause
a traceable bug. Most people does not have -DXASSERTS, though, and not
such bug has even been reported.

   Juanma



2009-10-24  Juanma Barranquero  <lekktu <at> gmail.com>

	* window.c (grow_mini_window): Comment out "delta >= 0" assertion.
	For delta < 0, skip check that only makes sense when the mini-window
	is going to be enlarged.  (Bug#4534)


Index: src/window.c
===================================================================
RCS file: /cvsroot/emacs/emacs/src/window.c,v
retrieving revision 1.642
diff -u -2 -r1.642 window.c
--- src/window.c	23 Oct 2009 17:52:57 -0000	1.642
+++ src/window.c	24 Oct 2009 15:33:16 -0000
@@ -4649,10 +4649,13 @@

   xassert (MINI_WINDOW_P (w));
-  xassert (delta >= 0);
+  /* Commenting out the following assertion goes against the stated interface
+     of this function, but it currently does not seem to do anything useful.
+     See discussion of this issue in the thread for bug#4534.
+     xassert (delta >= 0); */

   /* Compute how much we can enlarge the mini-window without deleting
      other windows.  */
   root = XWINDOW (FRAME_ROOT_WINDOW (f));
-  if (delta)
+  if (delta > 0)
     {
       int min_height = window_min_size (root, 0, 0, 0, 0);



This bug report was last modified 15 years and 216 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.