From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Juanma Barranquero Newsgroups: gmane.emacs.bugs Subject: bug#4534: assertion failure at window.c:grow_mini_window Date: Sat, 24 Oct 2009 17:37:26 +0200 Message-ID: References: <4ABB9106.1090306@gmx.at> <4ABB99E4.6030200@gmx.at> <4ABBADF6.9040509@gmx.at> Reply-To: Juanma Barranquero , 4534@emacsbugs.donarmstrong.com NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: ger.gmane.org 1256399257 12871 80.91.229.12 (24 Oct 2009 15:47:37 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 24 Oct 2009 15:47:37 +0000 (UTC) Cc: 4534@emacsbugs.donarmstrong.com To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Oct 24 17:47:29 2009 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1N1iq1-0006At-As for geb-bug-gnu-emacs@m.gmane.org; Sat, 24 Oct 2009 17:47:29 +0200 Original-Received: from localhost ([127.0.0.1]:38925 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1N1iq0-0000ap-MK for geb-bug-gnu-emacs@m.gmane.org; Sat, 24 Oct 2009 11:47:28 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1N1ipu-0000Xm-Fu for bug-gnu-emacs@gnu.org; Sat, 24 Oct 2009 11:47:22 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1N1ipo-0000Ro-IU for bug-gnu-emacs@gnu.org; Sat, 24 Oct 2009 11:47:21 -0400 Original-Received: from [199.232.76.173] (port=59966 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1N1ipo-0000Rd-D5 for bug-gnu-emacs@gnu.org; Sat, 24 Oct 2009 11:47:16 -0400 Original-Received: from rzlab.ucr.edu ([138.23.92.77]:35817) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1N1ipn-0000WC-Pe for bug-gnu-emacs@gnu.org; Sat, 24 Oct 2009 11:47:16 -0400 Original-Received: from rzlab.ucr.edu (rzlab.ucr.edu [127.0.0.1]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n9OFlDSu029525; Sat, 24 Oct 2009 08:47:13 -0700 Original-Received: (from debbugs@localhost) by rzlab.ucr.edu (8.14.3/8.14.3/Submit) id n9OFj4PN029002; Sat, 24 Oct 2009 08:45:04 -0700 Resent-Date: Sat, 24 Oct 2009 08:45:04 -0700 X-Loop: owner@emacsbugs.donarmstrong.com Resent-From: Juanma Barranquero Resent-To: bug-submit-list@donarmstrong.com Resent-CC: Emacs Bugs 2Resent-Date: Sat, 24 Oct 2009 15:45:04 +0000 Resent-Message-ID: Resent-Sender: owner@emacsbugs.donarmstrong.com X-Emacs-PR-Message: followup 4534 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Original-Received: via spool by 4534-submit@emacsbugs.donarmstrong.com id=B4534.125639866828223 (code B ref 4534); Sat, 24 Oct 2009 15:45:04 +0000 Original-Received: (at 4534) by emacsbugs.donarmstrong.com; 24 Oct 2009 15:37:48 +0000 X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. Original-Received: from ey-out-2122.google.com (ey-out-2122.google.com [74.125.78.26]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n9OFbkIv028220 for <4534@emacsbugs.donarmstrong.com>; Sat, 24 Oct 2009 08:37:48 -0700 Original-Received: by ey-out-2122.google.com with SMTP id 9so1898336eyd.15 for <4534@emacsbugs.donarmstrong.com>; Sat, 24 Oct 2009 08:37:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:cc:content-type; bh=EjOfdiKeg5Vj7fJv32tstmGR4Y7wL04oHRJg9/PILMQ=; b=RBzwxjIGSIWQ1XhubhVAYGjr3Pj2ainFoxkvNSkZEhichqJ8ucvM2pwLRMx6XhDGIt Rv3p/5Z6n1DWIapv0hMyiDZQyIm23GbN4HLlQsgadQFASrPZ9HsRlJrucmAJqQCuwYrv ABPkjmeo8ah2luci3+T+FAMUa04pIh7KeeXNU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; b=f1YaW0x87xhanO/IGCfZlpJ9hi6POJV62GSuzIxaUQLQNDKM2QlQfr0DdFKZ25Bd/l yaQeixaFWl+gkJj5ky6w30P5ru4njDriVBRFYFFcLk0XwR9QDiwa/g1b2q7PjLddD/1F Af0c3M3fBYaLQXMRh5sSt8SmmQxoOeFsVrVu8= Original-Received: by 10.211.132.33 with SMTP id j33mr2065614ebn.20.1256398666114; Sat, 24 Oct 2009 08:37:46 -0700 (PDT) In-Reply-To: X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) Resent-Date: Sat, 24 Oct 2009 11:47:21 -0400 X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:32200 Archived-At: 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 * 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);