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#21732: 25.0.50; intermittent failure using windmove when in doc-view buffer Date: Thu, 22 Oct 2015 17:56:43 +0300 Message-ID: <83lhavt0ic.fsf@gnu.org> References: Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1445525850 29400 80.91.229.3 (22 Oct 2015 14:57:30 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 22 Oct 2015 14:57:30 +0000 (UTC) Cc: 21732@debbugs.gnu.org To: Daniel McClanahan Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Oct 22 16:57:15 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 1ZpHIm-0004lx-Lp for geb-bug-gnu-emacs@m.gmane.org; Thu, 22 Oct 2015 16:57:12 +0200 Original-Received: from localhost ([::1]:60492 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZpHIm-0005Bq-5K for geb-bug-gnu-emacs@m.gmane.org; Thu, 22 Oct 2015 10:57:12 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:57273) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZpHIh-00059p-QD for bug-gnu-emacs@gnu.org; Thu, 22 Oct 2015 10:57:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZpHIc-00034U-N3 for bug-gnu-emacs@gnu.org; Thu, 22 Oct 2015 10:57:07 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:42302) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZpHIc-00034P-KB for bug-gnu-emacs@gnu.org; Thu, 22 Oct 2015 10:57:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1ZpHIc-0007Om-Gk for bug-gnu-emacs@gnu.org; Thu, 22 Oct 2015 10:57:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 22 Oct 2015 14:57:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 21732 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 21732-submit@debbugs.gnu.org id=B21732.144552580628409 (code B ref 21732); Thu, 22 Oct 2015 14:57:02 +0000 Original-Received: (at 21732) by debbugs.gnu.org; 22 Oct 2015 14:56:46 +0000 Original-Received: from localhost ([127.0.0.1]:33009 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZpHIL-0007O9-Lw for submit@debbugs.gnu.org; Thu, 22 Oct 2015 10:56:46 -0400 Original-Received: from mtaout25.012.net.il ([80.179.55.181]:49168) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZpHII-0007Nz-RT for 21732@debbugs.gnu.org; Thu, 22 Oct 2015 10:56:43 -0400 Original-Received: from conversion-daemon.mtaout25.012.net.il by mtaout25.012.net.il (HyperSendmail v2007.08) id <0NWM00A00MEYWE00@mtaout25.012.net.il> for 21732@debbugs.gnu.org; Thu, 22 Oct 2015 17:54:25 +0300 (IDT) Original-Received: from HOME-C4E4A596F7 ([84.94.185.246]) by mtaout25.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0NWM00269MQP4DA0@mtaout25.012.net.il>; Thu, 22 Oct 2015 17:54:25 +0300 (IDT) In-reply-to: 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: 208.118.235.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:107850 Archived-At: > From: Daniel McClanahan > Date: Thu, 22 Oct 2015 02:12:05 -0500 > > I've been experiencing this issue at least for months, I don't think I > remember a time when it wasn't happening (I've only used emacs for a > year or so). Occasionally, when viewing a file in doc-view-mode, I've > noticed that using windmove (which I use for all my window movements) > left, right, up, or down occasionally fails, throwing the error "Wrong > type argument: wholenump, -", for some number num. > > I've attached gdb and found that this is because "cursor.y" of the > window being chosen is negative, which I found after attaching a > breakpoint to "posn-at-point," which was throwing the error, and > following it down a few calls to "pos_visible_p", and checking the > value of "w" in there. I don't know what "w->cursor.y" represents (I > know it's cursor position, but I don't know how that maps to the > cursor's lisp representation), and although I've delved into xdisp.c > to see why that would be negative (but only sometimes) in doc-view > buffers, I haven't been able to see where the cursor position is > updated, and I've spent a few hours checking it out but am finding it > difficult to follow a lot of the xdisp.c code. Thanks for looking so deep into this problem. First, I believe the function that was signaling an error is posn-at-x-y, which is called internally by posn-at-point; the latter AFAICS doesn't make any checks that could cause such an error to be signaled. Is that correct? Also, the coordinates of the cursor are not related to what these functions do or the data they examine, except accidentally, if the position passed to posn-at-point was that of point. (To answer your question, w->cursor.y is the vertical window-relative coordinate in pixels of the cursor position in window w. If that value is -1, it means Emacs didn't yet compute the cursor position in that window, which could happen if the problem happens in the middle of a redisplay cycle. Martin described another situation where it might be negative.) So to get the investigation of this bug forward, could you post here the C-level backtrace you get in GDB when this error is signaled? Please accompany it with the output of the "xbacktrace" GDB command, which should show the corresponding Lisp backtrace. (This command is defined in the file src/.gdbinit in the Emacs source tree, so you will have to source that file before issuing the command.) Finally, please post the information about your system and the Emacs configuration produced by "M-x report-Emacs-bug RET". > Steps to reproduce: kind of hard, since it's very intermittent. It might help to find out with which arguments was posn-at-point (or was it posn-at-x-y?) called, and then try reproducing the problem by manually calling that function with the same arguments in the same buffer. If that works, you will have a reproducible recipe.