From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Dan Nicolaescu Newsgroups: gmane.emacs.bugs Subject: bug#9990: valgrind warning in add_row_entry Date: Fri, 11 Nov 2011 15:20:19 -0500 Message-ID: References: <83k47ailf0.fsf@gnu.org> <83zkg2fzgt.fsf@gnu.org> <83vcqqfy5h.fsf@gnu.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1321042855 25263 80.91.229.12 (11 Nov 2011 20:20:55 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 11 Nov 2011 20:20:55 +0000 (UTC) Cc: 9990@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Nov 11 21:20:51 2011 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1ROxaj-0007fa-DI for geb-bug-gnu-emacs@m.gmane.org; Fri, 11 Nov 2011 21:20:49 +0100 Original-Received: from localhost ([::1]:56934 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ROxai-0008AV-T0 for geb-bug-gnu-emacs@m.gmane.org; Fri, 11 Nov 2011 15:20:48 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]:48771) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ROxaf-00089p-G1 for bug-gnu-emacs@gnu.org; Fri, 11 Nov 2011 15:20:46 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ROxae-00074V-8G for bug-gnu-emacs@gnu.org; Fri, 11 Nov 2011 15:20:45 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:44624) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ROxae-00074R-19 for bug-gnu-emacs@gnu.org; Fri, 11 Nov 2011 15:20:44 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1ROxav-0006CM-Qm for bug-gnu-emacs@gnu.org; Fri, 11 Nov 2011 15:21:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Dan Nicolaescu Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 11 Nov 2011 20:21:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 9990 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 9990-submit@debbugs.gnu.org id=B9990.132104283923794 (code B ref 9990); Fri, 11 Nov 2011 20:21:01 +0000 Original-Received: (at 9990) by debbugs.gnu.org; 11 Nov 2011 20:20:39 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1ROxaZ-0006Bj-Ly for submit@debbugs.gnu.org; Fri, 11 Nov 2011 15:20:39 -0500 Original-Received: from fencepost.gnu.org ([140.186.70.10] ident=Debian-exim) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1ROxaY-0006Bd-Dg for 9990@debbugs.gnu.org; Fri, 11 Nov 2011 15:20:38 -0500 Original-Received: from dann by fencepost.gnu.org with local (Exim 4.71) (envelope-from ) id 1ROxaF-0004z6-V5; Fri, 11 Nov 2011 15:20:19 -0500 In-Reply-To: <83vcqqfy5h.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 11 Nov 2011 17:59:22 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (gnu/linux) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Fri, 11 Nov 2011 15:21:01 -0500 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 140.186.70.43 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.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:53819 Archived-At: Eli Zaretskii writes: >> Date: Fri, 11 Nov 2011 17:30:58 +0200 >> From: Eli Zaretskii >> Cc: 9990@debbugs.gnu.org >> >> However, I spotted something strange related to the call to >> row_equal_p, here: >> >> /* Skip over rows equal at the bottom. */ >> i = last_new; >> j = last_old; >> while (i - 1 > first_new >> && j - 1 > first_old >> && MATRIX_ROW (current_matrix, i - 1)->enabled_p >> && (MATRIX_ROW (current_matrix, i - 1)->y >> == MATRIX_ROW (desired_matrix, j - 1)->y) >> && !MATRIX_ROW (desired_matrix, j - 1)->redraw_fringe_bitmaps_p >> && row_equal_p (MATRIX_ROW (desired_matrix, i - 1), >> MATRIX_ROW (current_matrix, j - 1), 1)) >> --i, --j; >> >> Some of these conditions use incorrect indices to access the glyph >> matrices: `i' should be used for the current matrix and `j' for the >> desired matrix. Some of these conditions use `i' and `j' correctly, >> some don't. > > Below is a patch I intend to install, if no one finds any thinko in > it. Dan, can you try this and see if it resolves the valgrind > complaints (assuming you can reproduce them)? > > === modified file 'src/dispnew.c' > --- src/dispnew.c 2011-10-08 10:58:50 +0000 > +++ src/dispnew.c 2011-11-11 15:53:27 +0000 > @@ -4334,10 +4334,10 @@ scrolling_window (struct window *w, int > j = last_old; > while (i - 1 > first_new > && j - 1 > first_old > - && MATRIX_ROW (current_matrix, i - 1)->enabled_p > - && (MATRIX_ROW (current_matrix, i - 1)->y > - == MATRIX_ROW (desired_matrix, j - 1)->y) > - && !MATRIX_ROW (desired_matrix, j - 1)->redraw_fringe_bitmaps_p > + && MATRIX_ROW (current_matrix, j - 1)->enabled_p > + && (MATRIX_ROW (current_matrix, j - 1)->y > + == MATRIX_ROW (desired_matrix, i - 1)->y) > + && !MATRIX_ROW (desired_matrix, i - 1)->redraw_fringe_bitmaps_p > && row_equal_p (MATRIX_ROW (desired_matrix, i - 1), > MATRIX_ROW (current_matrix, j - 1), 1)) > --i, --j; I haven't seen the one in row_equal_p anymore (but that one was not easy to reproduce), the ones in update_window still show up.