From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#20808: 24.5; Emacs looping with 100% CPU at line 15287 (?) of xdisp.c Date: Tue, 16 Jun 2015 18:03:22 +0300 Message-ID: <83vbenn1ad.fsf@gnu.org> References: <87mw03j57i.fsf@moondust.localdomain> <83ioaqpel9.fsf@gnu.org> <878ubmayn4.fsf@moondust.localdomain> <83616qoyyd.fsf@gnu.org> <87a8w1uge6.fsf@moondust.localdomain> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1434467103 30335 80.91.229.3 (16 Jun 2015 15:05:03 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 16 Jun 2015 15:05:03 +0000 (UTC) Cc: 20808@debbugs.gnu.org To: nljlistbox2@gmail.com (N. Jackson) Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Jun 16 17:04:53 2015 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Z4sQ1-0007B5-BW for geb-bug-gnu-emacs@m.gmane.org; Tue, 16 Jun 2015 17:04:53 +0200 Original-Received: from localhost ([::1]:40843 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z4sQ0-0001aH-SZ for geb-bug-gnu-emacs@m.gmane.org; Tue, 16 Jun 2015 11:04:52 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:51895) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z4sPH-0000rb-Hq for bug-gnu-emacs@gnu.org; Tue, 16 Jun 2015 11:04:13 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z4sPD-0001ri-Hy for bug-gnu-emacs@gnu.org; Tue, 16 Jun 2015 11:04:07 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:41485) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z4sPD-0001ra-Eg for bug-gnu-emacs@gnu.org; Tue, 16 Jun 2015 11:04:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1Z4sPC-0003Gi-Ut for bug-gnu-emacs@gnu.org; Tue, 16 Jun 2015 11:04:03 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 16 Jun 2015 15:04:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 20808 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 20808-submit@debbugs.gnu.org id=B20808.143446702412540 (code B ref 20808); Tue, 16 Jun 2015 15:04:02 +0000 Original-Received: (at 20808) by debbugs.gnu.org; 16 Jun 2015 15:03:44 +0000 Original-Received: from localhost ([127.0.0.1]:55945 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Z4sOt-0003GB-Ct for submit@debbugs.gnu.org; Tue, 16 Jun 2015 11:03:44 -0400 Original-Received: from mtaout27.012.net.il ([80.179.55.183]:45462) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Z4sOq-0003Fu-Gx for 20808@debbugs.gnu.org; Tue, 16 Jun 2015 11:03:41 -0400 Original-Received: from conversion-daemon.mtaout27.012.net.il by mtaout27.012.net.il (HyperSendmail v2007.08) id <0NQ100I00LM8JB00@mtaout27.012.net.il> for 20808@debbugs.gnu.org; Tue, 16 Jun 2015 17:59:09 +0300 (IDT) Original-Received: from HOME-C4E4A596F7 ([87.69.4.28]) by mtaout27.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0NQ100AQ3LMLW380@mtaout27.012.net.il>; Tue, 16 Jun 2015 17:59:09 +0300 (IDT) In-reply-to: <87a8w1uge6.fsf@moondust.localdomain> X-012-Sender: halo1@inter.net.il X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x 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:103991 Archived-At: > From: nljlistbox2@gmail.com (N. Jackson) > Cc: 20808@debbugs.gnu.org > Date: Mon, 15 Jun 2015 12:42:57 -0300 > > It's not clear to me if GDB prints out the statement it just executed or > the statement that it will execute next The latter. > The variables don't change, and after a few spins through the loop, > I set watchpoints on them and `finish' and there was no sign of them > changing after about five minutes, after which I did a C-c. As expected. That's why it infloops. > For the Fedora 21 build (the variables don't change): > > (gdb) p it.current > $11 = {pos = {charpos = 0, bytepos = 0}, overlay_string_index = 0, string_pos = {charpos = 0, bytepos = 0}, dpvec_index = 0} > (gdb) p it.current_y > $12 = 0 > (gdb) p it.max_ascent > $13 = 0 > (gdb) p it.max_descent > $14 = 0 These values make no sense. I guess the optimized binary lies to GDB. > For my build (again the variables don't change): > > (gdb) p it.current > $20 = {pos = {charpos = 2840, bytepos = 2841}, overlay_string_index = -1, string_pos = {charpos = -1, bytepos = -1}, dpvec_index = -1} > (gdb) p it.current_y > $21 = 270 > (gdb) p it.ascent > $22 = 11 > (gdb) p it.descent > $23 = 3 > (gdb) p it.method > $24 = GET_FROM_BUFFER > (gdb) p start_y > $25 = 270 > (gdb) p ZV > $34 = 2840 > (gdb) p current_buffer->zv > $35 = 2840 This makes much more sense. > I hope this helps, and I await further instructions should further > debugging be worthwhile. Yes, it helps. Please try the patch below. If it solves the problem, I will install it shortly. Please try both an optimized and a non-optimized build, if you can afford that. diff --git a/src/xdisp.c b/src/xdisp.c index 7c15330..1e2f1b26 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -15094,7 +15094,8 @@ enum RESTORE_IT (&it, &it, it1data); move_it_by_lines (&it, 1); SAVE_IT (it1, it, it1data); - } while (line_bottom_y (&it1) - start_y < amount_to_scroll); + } while (IT_CHARPOS (it) < ZV + && line_bottom_y (&it1) - start_y < amount_to_scroll); } /* If STARTP is unchanged, move it down another screen line. */