From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Michael Welsh Duggan Newsgroups: gmane.emacs.bugs Subject: bug#21730: 25.0.50; Random errors in redisplay--pre-redisplay-functions Date: Tue, 27 Oct 2015 00:19:13 -0400 Message-ID: <87y4epeyf2.fsf@md5i.com> References: <87io5zh7m1.fsf@md5i.com> <83vb9zt19o.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1445919634 21137 80.91.229.3 (27 Oct 2015 04:20:34 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 27 Oct 2015 04:20:34 +0000 (UTC) Cc: Michael Welsh Duggan , 21730@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Oct 27 05:20:19 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 1Zqvk9-0002YN-Gr for geb-bug-gnu-emacs@m.gmane.org; Tue, 27 Oct 2015 05:20:17 +0100 Original-Received: from localhost ([::1]:57454 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zqvk3-0001xT-Qm for geb-bug-gnu-emacs@m.gmane.org; Tue, 27 Oct 2015 00:20:11 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:37587) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zqvk0-0001wA-ON for bug-gnu-emacs@gnu.org; Tue, 27 Oct 2015 00:20:09 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zqvjw-00030c-B1 for bug-gnu-emacs@gnu.org; Tue, 27 Oct 2015 00:20:08 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:49169) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zqvjw-000300-73 for bug-gnu-emacs@gnu.org; Tue, 27 Oct 2015 00:20:04 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1Zqvjv-00044Q-61 for bug-gnu-emacs@gnu.org; Tue, 27 Oct 2015 00:20:03 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Michael Welsh Duggan Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 27 Oct 2015 04:20:02 +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.144591955815590 (code B ref 21730); Tue, 27 Oct 2015 04:20:02 +0000 Original-Received: (at 21730) by debbugs.gnu.org; 27 Oct 2015 04:19:18 +0000 Original-Received: from localhost ([127.0.0.1]:39877 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZqvjB-00043N-QW for submit@debbugs.gnu.org; Tue, 27 Oct 2015 00:19:18 -0400 Original-Received: from md5i.com ([75.151.244.229]:47434) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Zqvj9-00043B-Rq for 21730@debbugs.gnu.org; Tue, 27 Oct 2015 00:19:16 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=md5i.com; s=dkim; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date:References: Subject:Cc:To:From; bh=hAusEUfLIB8ZtYsEHgZQb8M8fy7HgwEVxbwxdoXLWH4=; b=S4X1fk u2WN4NOdki6KdRjgOrIsbPkOvvqusnczRmGGCWz/E/O9qP8MEq9mGFaD1K+/Yq4dCnNhcU6XWwJmS DSwIt+nZEeoJKGLEZdChymUrl/iTualRibj/cAtJWmcez; Original-Received: from md5i by md5i.com with local (Exim 4.86) (envelope-from ) id 1Zqvj7-0001YY-Ri; Tue, 27 Oct 2015 00:19:13 -0400 In-Reply-To: <83vb9zt19o.fsf@gnu.org> (Eli Zaretskii's message of "Thu, 22 Oct 2015 17:40:19 +0300") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) 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:108055 Archived-At: Eli Zaretskii writes: >> 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. I've changed the (bobp) to (= point 1). I'll run it for a couple of weeks and report back. -- Michael Welsh Duggan (md5i@md5i.com)