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#13864: 24.3.50; emacsclient -t loops when connected to emacs server running in X11 Date: Fri, 08 Mar 2013 17:58:47 +0200 Message-ID: <837glhzxvs.fsf@gnu.org> References: <86y5e4xpd8.fsf@chateau.d.if> <83ehfvt5pp.fsf@gnu.org> <86mwujou60.fsf@chateau.d.if> <83y5e2synt.fsf@gnu.org> <86ip56adz3.fsf@chateau.d.if> <83txoo1mp3.fsf@gnu.org> <868v60743o.fsf@chateau.d.if> <83ppzc1bx9.fsf@gnu.org> <866214m1bh.fsf@chateau.d.if> <838v5z1yx4.fsf@gnu.org> <86mwuf8xrq.fsf@chateau.d.if> <8362131sf1.fsf@gnu.org> <86ip538qb8.fsf@chateau.d.if> <83y5dzz88b.fsf@gnu.org> <868v5y9pb5.fsf@chateau.d.if> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1362758387 15014 80.91.229.3 (8 Mar 2013 15:59:47 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 8 Mar 2013 15:59:47 +0000 (UTC) Cc: 13864@debbugs.gnu.org To: ashish.is@lostca.se (Ashish SHUKLA) Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Mar 08 17:00:08 2013 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 1UDziE-0002XE-Rd for geb-bug-gnu-emacs@m.gmane.org; Fri, 08 Mar 2013 17:00:03 +0100 Original-Received: from localhost ([::1]:42094 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UDzht-0003H4-1E for geb-bug-gnu-emacs@m.gmane.org; Fri, 08 Mar 2013 10:59:41 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:37252) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UDzhj-0003Fi-SC for bug-gnu-emacs@gnu.org; Fri, 08 Mar 2013 10:59:38 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UDzhd-0005vs-HU for bug-gnu-emacs@gnu.org; Fri, 08 Mar 2013 10:59:31 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:35512) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UDzhd-0005vn-Da for bug-gnu-emacs@gnu.org; Fri, 08 Mar 2013 10:59:25 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1UDziE-0002aV-BU for bug-gnu-emacs@gnu.org; Fri, 08 Mar 2013 11:00:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 08 Mar 2013 16:00:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 13864 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 13864-submit@debbugs.gnu.org id=B13864.13627583829890 (code B ref 13864); Fri, 08 Mar 2013 16:00:02 +0000 Original-Received: (at 13864) by debbugs.gnu.org; 8 Mar 2013 15:59:42 +0000 Original-Received: from localhost ([127.0.0.1]:39621 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UDzhq-0002ZO-Fd for submit@debbugs.gnu.org; Fri, 08 Mar 2013 10:59:42 -0500 Original-Received: from mtaout22.012.net.il ([80.179.55.172]:48880) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UDzhk-0002Z5-RA for 13864@debbugs.gnu.org; Fri, 08 Mar 2013 10:59:37 -0500 Original-Received: from conversion-daemon.a-mtaout22.012.net.il by a-mtaout22.012.net.il (HyperSendmail v2007.08) id <0MJC00D00MWLY100@a-mtaout22.012.net.il> for 13864@debbugs.gnu.org; Fri, 08 Mar 2013 17:58:48 +0200 (IST) Original-Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout22.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0MJC00DY3N1ZY510@a-mtaout22.012.net.il>; Fri, 08 Mar 2013 17:58:48 +0200 (IST) In-reply-to: <868v5y9pb5.fsf@chateau.d.if> X-012-Sender: halo1@inter.net.il X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.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:72227 Archived-At: > From: ashish.is@lostca.se (Ashish SHUKLA) > Cc: 13864@debbugs.gnu.org > Date: Fri, 08 Mar 2013 15:38:30 +0530 > > > (gdb) break dispnew.c:4509 > > (gdb) commands > >> p i > >> p desired_matrix->nrows > >> if i < desired_matrix->nrows > >> pgrowx desired_matrix->rows+i > >> end > > I later added a 'continue' in here as Breakpoint 6 in the output. Yes, sorry about that, I forgot. > Not sure if the attached gdb output is any useful. It is, thanks. I think we are making progress. > - emacs -Q > - M-x server-start > - gdb stuff, breakpoints + loading .gdbinit > - Started an xterm of dimensions (maybe 20-25 rows) > - emacsclient -t > - key presses (none of them is C-x C-f) Emacs would begin to flicker after these, right? > - Breakpoint 1 being hit and requiring me to type 'cont' on every hit > - After some 'cont' inputs, I deleted it, and re-added it as Breakpoint 6 with > 'continue' as mentioned above. > - Breakpoint 6 being continuously hit So you are saying that scrolling_1 is never called, is that right? > - C-x 5 0 in emacsclient window > - appended '====EMACSCLIENT STOPPED====' to logfile > - emacsclient -t > - Breakpoint 6 being hit > - I resized window to 4-5 rows in an effort to reduce no. of redraw messages > - Killed gdb after 2 minutes, which killed emacs. To have a way of terminating the session in a more civilized way, I frequently use the following trick: put a breakpoint at Fredraw_display, before you start the debugging session. Then, whenever you want to change something or finish the session, just "M-x redraw-display RET" and GDB kicks in. > Let me know if you need more information. Hmm... Some observations: . update_frame_1 is constantly called with either the entire frame, starting with the menu bar, or just with the last line of the frame, which is the echo area. . I see tooltip messages being displayed in the echo area. You have a mouse active (as far as Emacs is concerned) on the xterm frame, is that right? Can you disable it and see if the flickering persists? . There are some instances where Emacs displayed "Quit" in the echo area. Did you type C-g or some such? Moving on in the investigation of the problem (assuming that disabling the mouse doesn't fix it), I assume that the function update_frame_line is being called to redraw the xterm frame, given the evidence you gathered this far. First, let's make sure this is indeed so. Use this breakpoint: (gdb) break update_frame_line (gdb) commands > p vpos > continue > end (gdb) Please see if you see all the line numbers when you recreate the situation with flickering. If you indeed see all the line numbers of a frame, next thing is to find out whether on your system the FRAME_CHAR_INS_DEL_OK macro returns zero or non-zero. (Depending on that, Emacs uses two separate portions of code in update_frame_line which try to avoid redrawing the parts of screen that didn't change.) You could, for example, put a breakpoint inside this block: if (!FRAME_CHAR_INS_DEL_OK (f)) { int i, j; /* Find the first glyph in desired row that doesn't agree with a glyph in the current row, and write the rest from there on. */ for (i = 0; i < nlen; i++) { if (i >= olen || !GLYPH_EQUAL_P (nbody + i, obody + i)) { /* Find the end of the run of different glyphs. */ j = i + 1; while (j < nlen && (j >= olen || !GLYPH_EQUAL_P (nbody + j, obody + j) || CHAR_GLYPH_PADDING_P (nbody[j]))) ++j; /* Output this run of non-matching chars. */ cursor_to (f, vpos, i); write_glyphs (f, nbody + i, j - i); i = j - 1; /* Now find the next non-match. */ } } /* Clear the rest of the line, or the non-clear part of it. */ if (olen > nlen) { cursor_to (f, vpos, nlen); clear_end_of_line (f, olen); } /* Make current row = desired row. */ make_current (desired_matrix, current_matrix, vpos); return; <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< } on the marked line, and see if it ever breaks. Thanks.