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: martin rudalics <rudalics <at> gmx.at>
To: Juanma Barranquero <lekktu <at> gmail.com>
Cc: 4534 <at> debbugs.gnu.org
Subject: bug#4534: assertion failure at window.c:grow_mini_window
Date: Thu, 24 Sep 2009 08:49:30 +0200
>> Would writing
>>
>>              if (height > WINDOW_TOTAL_LINES (w))
>>                {
>>                  freeze_window_starts (f, 1);
>>                  grow_mini_window (w, height - WINDOW_TOTAL_LINES (w));
>>                }
>>
>> instead do better?
>
> In my case, height < WINDOW_TOTAL_LINES (w) at that point (that's what
> triggers the xassert), so adding the above check works exactly like
> removing the if() altogether: it does not crash, but it does not
> shrink the minibuffer to 5 lines, which would be the correct height.

Seems I'm too silly to understand what's going on in resize_mini_window.
Apparently

      if (EQ (Vresize_mini_windows, Qgrow_only))
        ... fails so ...
      else
        ... gets executed ...
        {
          /* Always resize to exact size needed.  */
          if (height > WINDOW_TOTAL_LINES (w))
            ... fails again, so ...
          else if (height < WINDOW_TOTAL_LINES (w))
            ... we're here ...
            {
              int old_height = WINDOW_TOTAL_LINES (w);
              freeze_window_starts (f, 0);
              shrink_mini_window (w);
              ... should resize the mini_window down to one line ...

              if (height)
                {
                  freeze_window_starts (f, 1);
		  ... and the following causes the assertion failure to
                      trigger because the second arguments gets less
                      than zero ...
		  grow_mini_window (w, height - WINDOW_TOTAL_LINES (w));
                }

              window_height_changed_p = WINDOW_TOTAL_LINES (w) != old_height;
            }
        }

Now if I replace the check

              if (height)

by

              if (height > WINDOW_TOTAL_LINES (w))

I should be able to avoid the delta = -1 assertion failure in
grow_mini_window.  Can you confirm my reasoning so far?

The fact that `height' is something like zero or less seems to stem from
some miscalculation (probably caused by the line-wrapping part) earlier
in the code of resize_mini_window.  If that's so could you try to find
out why height is not at least one line?

martin



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.