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#21730: 25.0.50; Random errors in redisplay--pre-redisplay-functions Date: Thu, 22 Oct 2015 17:40:19 +0300 Message-ID: <83vb9zt19o.fsf@gnu.org> References: <87io5zh7m1.fsf@md5i.com> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1445524898 11840 80.91.229.3 (22 Oct 2015 14:41:38 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 22 Oct 2015 14:41:38 +0000 (UTC) Cc: 21730@debbugs.gnu.org To: Michael Welsh Duggan Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Oct 22 16:41:25 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 1ZpH3L-0004ls-CN for geb-bug-gnu-emacs@m.gmane.org; Thu, 22 Oct 2015 16:41:15 +0200 Original-Received: from localhost ([::1]:60358 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZpH3F-0004YQ-Pt for geb-bug-gnu-emacs@m.gmane.org; Thu, 22 Oct 2015 10:41:09 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:48493) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZpH3C-0004YL-1C for bug-gnu-emacs@gnu.org; Thu, 22 Oct 2015 10:41:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZpH38-0004qg-0r for bug-gnu-emacs@gnu.org; Thu, 22 Oct 2015 10:41:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:42276) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZpH37-0004qc-T4 for bug-gnu-emacs@gnu.org; Thu, 22 Oct 2015 10:41:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1ZpH37-0006zu-Oq for bug-gnu-emacs@gnu.org; Thu, 22 Oct 2015 10:41:01 -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:41:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 21730 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 21730-submit@debbugs.gnu.org id=B21730.144552484626806 (code B ref 21730); Thu, 22 Oct 2015 14:41:01 +0000 Original-Received: (at 21730) by debbugs.gnu.org; 22 Oct 2015 14:40:46 +0000 Original-Received: from localhost ([127.0.0.1]:32984 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZpH2r-0006yI-JA for submit@debbugs.gnu.org; Thu, 22 Oct 2015 10:40:45 -0400 Original-Received: from mtaout25.012.net.il ([80.179.55.181]:40895) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZpH2o-0006y8-26 for 21730@debbugs.gnu.org; Thu, 22 Oct 2015 10:40:43 -0400 Original-Received: from conversion-daemon.mtaout25.012.net.il by mtaout25.012.net.il (HyperSendmail v2007.08) id <0NWM00700LOEDZ00@mtaout25.012.net.il> for 21730@debbugs.gnu.org; Thu, 22 Oct 2015 17:38:01 +0300 (IDT) Original-Received: from HOME-C4E4A596F7 ([84.94.185.246]) by mtaout25.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0NWM002QILZC4D60@mtaout25.012.net.il>; Thu, 22 Oct 2015 17:38:00 +0300 (IDT) In-reply-to: <87io5zh7m1.fsf@md5i.com> 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:107844 Archived-At: > From: Michael Welsh Duggan > Date: Thu, 22 Oct 2015 00:04:06 -0400 > > I don't have a recipe for this. Every now again I get the following in > my *Messages* buffer: > > redisplay--pre-redisplay-functions: (args-out-of-range 0) > > I turned on debug-on-error, and got the following backtrace: > > Debugger entered--Lisp error: (args-out-of-range 0) > get-char-property(0 cursor-sensor-functions) > cursor-sensor--detect(#) > run-hook-with-args(cursor-sensor--detect #) > redisplay--pre-redisplay-functions(t) > apply(redisplay--pre-redisplay-functions t) > #[128 "\300\301\"\210\300\302\"\207" [apply > redisplay--pre-redisplay-functions ignore nil] 4 nil nil](t) > redisplay_internal\ \(C\ function\)() > > This happens infrequently, about a couple of times a day. I cannot make > this happen on demand, but I can add debugging code if led in the > correct direction. Thanks for reporting this. I'll try to help, although Stefan might have better ideas. >From the backtrace it is obvious that the immediate reason for the problem is the call to 'get-char-property' with an invalid 1st argument of zero (it's a buffer position, so should be at least 1). Looking at 'cursor-sensor--detect', I see this: (defun cursor-sensor--detect (window) (unless cursor-sensor-inhibit (let* ((point (window-point window)) ;; It's often desirable to make the cursor-sensor-functions property ;; non-sticky on both ends, but that means get-pos-property might ;; never see it. (new (or (get-char-property point 'cursor-sensor-functions) (unless (bobp) (get-char-property (1- point) 'cursor-sensor-functions)))) So my guess is that the value of 'point' (the variable, not the function) is 1, i.e. beginning of buffer, and subtracting 1 from it produces that zero. Then the second call to 'get-char-property' barfs as expected. The code tries to protect itself against such a calamity by calling 'bobp', but that function looks at the buffer's value of point, which might be different from what 'window-point' returns. So my advice would be to replace the call to 'bobp' with an explicit test of the value of the local variable 'point', and see if that fixes the problem.