From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: bug#7181: 24.0.50; args-out-of-range while reverting C++ header file Date: Sun, 10 Oct 2010 01:33:19 +0200 Message-ID: References: <87zkuo2djr.fsf@telefonica.net> <83wrprn3ou.fsf@gnu.org> <87sk0f32pp.fsf@telefonica.net> <87ocb331wo.fsf@telefonica.net> <20101009211332.GA5486@muc.de> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1286667194 23720 80.91.229.12 (9 Oct 2010 23:33:14 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sat, 9 Oct 2010 23:33:14 +0000 (UTC) Cc: =?iso-8859-1?Q?=D3scar?= Fuentes , 7181@debbugs.gnu.org, emacs-devel@gnu.org To: Alan Mackenzie Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Oct 10 01:33:12 2010 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1P4iue-00010Q-8f for ged-emacs-devel@m.gmane.org; Sun, 10 Oct 2010 01:33:12 +0200 Original-Received: from localhost ([127.0.0.1]:42125 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1P4iud-0001wq-K5 for ged-emacs-devel@m.gmane.org; Sat, 09 Oct 2010 19:33:11 -0400 Original-Received: from [140.186.70.92] (port=58305 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1P4iuZ-0001wl-Ee for emacs-devel@gnu.org; Sat, 09 Oct 2010 19:33:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1P4iuY-0000Ec-8J for emacs-devel@gnu.org; Sat, 09 Oct 2010 19:33:07 -0400 Original-Received: from fencepost.gnu.org ([140.186.70.10]:52202) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1P4iuY-0000EY-4A for emacs-devel@gnu.org; Sat, 09 Oct 2010 19:33:06 -0400 Original-Received: from dyn.144-85-184-059.dsl.vtx.ch ([144.85.184.59]:20225 helo=ceviche.home) by fencepost.gnu.org with esmtpsa (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.69) (envelope-from ) id 1P4iuW-00023L-Kl; Sat, 09 Oct 2010 19:33:04 -0400 Original-Received: by ceviche.home (Postfix, from userid 20848) id CEE0A6610C; Sun, 10 Oct 2010 01:33:19 +0200 (CEST) In-Reply-To: <20101009211332.GA5486@muc.de> (Alan Mackenzie's message of "Sat, 9 Oct 2010 21:13:32 +0000") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:131550 Archived-At: >> With the attached files the problem can be reproduced predictability: >> >> Save the attached files b.h.master and b.h.next to a directory and cd to >> it. >> >> $ emacs -Q & >> $ cp b.h.master b.h >> C-x C-f b.h >> $ cp b.h.next b.h >> M-x revert-buffer >> >> and the args-out-of-range error pops: >> >> c-clear-char-property-with-value-function: Args out of range: 166, 453 >> >> I was unable to try with the latest Emacs sources because the build is >> broken. My Emacs is from the 16 September. >> > Thanks for the recipe. I turned on debug-on-error and got this > traceback: > Debugger entered--Lisp error: (args-out-of-range 166 453) > remove-text-properties(166 453 (category)) > c-clear-char-property-with-value-function(1 453 category c-cpp-delimiter) > c-neutralize-syntax-in-and-mark-CPP(94 94 286) > c-after-change(94 94 286) <<====================================== > insert-file-contents("/home/acm/b.h" t nil nil t) > revert-buffer(t) > call-interactively(revert-buffer nil nil) > c-after-change is on the after-change-functions hook. The values of BEG > END OLD-LEN it is being passed look utterly wrong. BEG and END should > delimit the entire buffer and OLD-LEN should be the length of the > previous buffer. Surely? No, here the after-change is called right after removing the chars that are different, and just before inserting the new (different) chars. You can reproduce the same error without reverting: emacs -Q b.h.master M-x c-mode C-u 93 C-f C-SPC C-u 286 C-f C-w Stefan