From debbugs-submit-bounces@debbugs.gnu.org Sat Oct 09 00:27:33 2010 Received: (at submit) by debbugs.gnu.org; 9 Oct 2010 04:27:33 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1P4R1x-0000oO-33 for submit@debbugs.gnu.org; Sat, 09 Oct 2010 00:27:33 -0400 Received: from eggs.gnu.org ([140.186.70.92]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1P4R1t-0000oJ-U7 for submit@debbugs.gnu.org; Sat, 09 Oct 2010 00:27:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1P4R55-0003qD-1g for submit@debbugs.gnu.org; Sat, 09 Oct 2010 00:30:48 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,T_RP_MATCHES_RCVD,T_TO_NO_BRKTS_FREEMAIL autolearn=unavailable version=3.3.1 Received: from lists.gnu.org ([199.232.76.165]:60068) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1P4R54-0003q2-V1 for submit@debbugs.gnu.org; Sat, 09 Oct 2010 00:30:47 -0400 Received: from [140.186.70.92] (port=51456 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1P4R50-0002FC-9m for bug-gnu-emacs@gnu.org; Sat, 09 Oct 2010 00:30:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1P4R4v-0003ma-6z for bug-gnu-emacs@gnu.org; Sat, 09 Oct 2010 00:30:42 -0400 Received: from impaqm3.telefonica.net ([213.4.138.3]:45416) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1P4R4u-0003lc-Pz for bug-gnu-emacs@gnu.org; Sat, 09 Oct 2010 00:30:37 -0400 Received: from IMPmailhost1.adm.correo ([10.20.102.38]) by IMPaqm3.telefonica.net with bizsmtp id GUPM1f0070piX6q3PUWa6N; Sat, 09 Oct 2010 06:30:34 +0200 Received: from qcore ([83.52.52.115]) by IMPmailhost1.adm.correo with BIZ IMP id GUWY1f00G2V89Bn1hUWZvQ; Sat, 09 Oct 2010 06:30:34 +0200 X-Brightmail-Tracker: AAAAAA== X-TE-authinfo: authemail="981711563$telefonica.net" |auth_email="981711563@telefonica.net" X-TE-AcuTerraCos: auth_cuTerraCos="cosuitnetc01" From: ofv@wanadoo.es (Oscar Fuentes) To: bug-gnu-emacs@gnu.org Subject: 24.0.50; args-out-of-range while reverting C++ header file Date: Sat, 09 Oct 2010 06:30:32 +0200 Message-ID: <87zkuo2djr.fsf@telefonica.net> MIME-Version: 1.0 Content-Type: text/plain X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-Spam-Score: -4.8 (----) X-Debbugs-Envelope-To: submit Cc: Alan Mackenzie X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -5.0 (-----) This bug report will be sent to the Free Software Foundation, not to your local site managers! Please write in English if possible, because the Emacs maintainers usually do not have translators to read other languages for them. Your bug report will be posted to the bug-gnu-emacs@gnu.org mailing list, and to the gnu.emacs.bug news group. Please describe exactly what actions triggered the bug and the precise symptoms of the bug. If you can, give a recipe starting from `emacs -Q': emacs -Q C-x C-f some-moderately-big-header-file.h M-x revert-buffer Lisp error: (args-out-of-range 580 36722) The buffer is left semi-reverted, on an edited state. Doing a M-x revert-buffer again works ok. Setting debug-on-error to t shows this: Debugger entered--Lisp error: (args-out-of-range 580 36722) remove-text-properties(580 36722 (category)) c-clear-char-property-with-value-function(1 36722 category c-cpp-delimiter) c-neutralize-syntax-in-and-mark-CPP(174 174 36141) c-after-change(174 174 36141) insert-file-contents("/home/oscar/dev/idb/lp0/ffi.h" t nil nil t) revert-buffer(t) call-interactively(revert-buffer t nil) execute-extended-command(nil) call-interactively(execute-extended-command nil nil) If Emacs crashed, and you have the Emacs process in the gdb debugger, please include the output from the following gdb commands: `bt full' and `xbacktrace'. For information about debugging Emacs, please read the file /usr/local/share/emacs/24.0.50/etc/DEBUG. In GNU Emacs 24.0.50.1 (x86_64-unknown-linux-gnu, X toolkit) of 2010-09-16 on qcore Windowing system distributor `The X.Org Foundation', version 11.0.60900000 configured using `configure '--without-toolkit-scroll-bars' '--with-x-toolkit=lucid'' Important settings: value of $LC_ALL: nil value of $LC_COLLATE: nil value of $LC_CTYPE: nil value of $LC_MESSAGES: nil value of $LC_MONETARY: nil value of $LC_NUMERIC: nil value of $LC_TIME: nil value of $LANG: nil value of $XMODIFIERS: nil locale-coding-system: nil default enable-multibyte-characters: t Major mode: Debugger Minor modes in effect: tooltip-mode: t mouse-wheel-mode: t tool-bar-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t line-number-mode: t transient-mark-mode: t Recent input: C-x C-f f f i . h M-x r e v e r t SPC b u f f e r y e s M-x y e s SPC C-_ M-x s e t SPC v a r i d e b u o n e r r t M-x r e v e r t SPC b u f f e r y e s M-x r e v e r t SPC b u f f e r y e s C-SPC M-w Recent messages: For information about GNU Emacs and the GNU system, type C-h C-a. Loading vc-git...done c-clear-char-property-with-value-function: Args out of range: 580, 36722 Undo! Entering debugger... Mark set Load-path shadows: None found. Features: (shadow sort gnus-util mail-extr message sendmail rfc822 mml mml-sec mm-decode mm-bodies mm-encode mail-parse rfc2231 rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mailabbrev mail-utils gmm-utils mailheader emacsbug help-mode view debug cus-edit wid-edit cus-start cus-load help-fns vc-git cc-mode cc-fonts easymenu cc-menus cc-cmds cc-styles cc-align cc-engine cc-vars cc-defs regexp-opt tooltip ediff-hook vc-hooks lisp-float-type mwheel x-win x-dnd tool-bar dnd fontset image fringe lisp-mode register page menu-bar rfn-eshadow timer select scroll-bar mldrag mouse jit-lock font-lock syntax facemenu font-core frame cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese case-table epa-hook jka-cmpr-hook help simple abbrev loaddefs button minibuffer faces cus-face files text-properties overlay md5 base64 format env code-pages mule custom widget hashtable-print-readable backquote make-network-process dynamic-setting font-render-setting x-toolkit x multi-tty emacs) From debbugs-submit-bounces@debbugs.gnu.org Sat Oct 09 04:54:48 2010 Received: (at 7181) by debbugs.gnu.org; 9 Oct 2010 08:54:48 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1P4VCa-0002UI-Jx for submit@debbugs.gnu.org; Sat, 09 Oct 2010 04:54:48 -0400 Received: from mtaout20.012.net.il ([80.179.55.166]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1P4VCY-0002UD-2S for 7181@debbugs.gnu.org; Sat, 09 Oct 2010 04:54:47 -0400 Received: from conversion-daemon.a-mtaout20.012.net.il by a-mtaout20.012.net.il (HyperSendmail v2007.08) id <0LA000M00M1SK600@a-mtaout20.012.net.il> for 7181@debbugs.gnu.org; Sat, 09 Oct 2010 10:57:52 +0200 (IST) Received: from HOME-C4E4A596F7 ([84.229.148.82]) by a-mtaout20.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0LA000LQJM8FZH90@a-mtaout20.012.net.il>; Sat, 09 Oct 2010 10:57:52 +0200 (IST) Date: Sat, 09 Oct 2010 10:57:53 +0200 From: Eli Zaretskii Subject: Re: bug#7181: 24.0.50; args-out-of-range while reverting C++ header file In-reply-to: <87zkuo2djr.fsf@telefonica.net> X-012-Sender: halo1@inter.net.il To: ofv@wanadoo.es (Oscar Fuentes) Message-id: <83wrprn3ou.fsf@gnu.org> References: <87zkuo2djr.fsf@telefonica.net> X-Spam-Score: -1.9 (-) X-Debbugs-Envelope-To: 7181 Cc: 7181@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Reply-To: Eli Zaretskii List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.9 (-) > From: ofv@wanadoo.es (Oscar Fuentes) > Date: Sat, 09 Oct 2010 06:30:32 +0200 > Cc: > > emacs -Q > C-x C-f some-moderately-big-header-file.h > > M-x revert-buffer > Lisp error: (args-out-of-range 580 36722) > > The buffer is left semi-reverted, on an edited state. Doing a M-x > revert-buffer again works ok. > > Setting debug-on-error to t shows this: > > Debugger entered--Lisp error: (args-out-of-range 580 36722) > remove-text-properties(580 36722 (category)) Can you verify that the problem happens because one or both argument positions of remove-text-properties don't exist due to the changes? From debbugs-submit-bounces@debbugs.gnu.org Sat Oct 09 09:35:59 2010 Received: (at 7181) by debbugs.gnu.org; 9 Oct 2010 13:35:59 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1P4Zah-000567-J1 for submit@debbugs.gnu.org; Sat, 09 Oct 2010 09:35:59 -0400 Received: from impaqm1.telefonica.net ([213.4.138.1]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1P4Zae-000560-V3 for 7181@debbugs.gnu.org; Sat, 09 Oct 2010 09:35:58 -0400 Received: from IMPmailhost6.adm.correo ([10.20.102.127]) by IMPaqm1.telefonica.net with bizsmtp id GdRJ1f00C2kvMAa01dfFYG; Sat, 09 Oct 2010 15:39:15 +0200 Received: from qcore ([83.52.52.115]) by IMPmailhost6.adm.correo with BIZ IMP id GdfE1f0072V89Bn1mdfESh; Sat, 09 Oct 2010 15:39:15 +0200 X-Brightmail-Tracker: AAAAAA== X-TE-authinfo: authemail="981711563$telefonica.net" |auth_email="981711563@telefonica.net" X-TE-AcuTerraCos: auth_cuTerraCos="cosuitnetc01" From: =?utf-8?Q?=C3=93scar_Fuentes?= To: Eli Zaretskii Subject: Re: bug#7181: 24.0.50; args-out-of-range while reverting C++ header file References: <87zkuo2djr.fsf@telefonica.net> <83wrprn3ou.fsf@gnu.org> Date: Sat, 09 Oct 2010 15:39:14 +0200 In-Reply-To: <83wrprn3ou.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 09 Oct 2010 10:57:53 +0200") Message-ID: <87sk0f32pp.fsf@telefonica.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -3.4 (---) X-Debbugs-Envelope-To: 7181 Cc: Alan Mackenzie , 7181@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -3.3 (---) Eli Zaretskii writes: >> emacs -Q >> C-x C-f some-moderately-big-header-file.h >> >> M-x revert-buffer >> Lisp error: (args-out-of-range 580 36722) >> >> The buffer is left semi-reverted, on an edited state. Doing a M-x >> revert-buffer again works ok. >> >> Setting debug-on-error to t shows this: >> >> Debugger entered--Lisp error: (args-out-of-range 580 36722) >> remove-text-properties(580 36722 (category)) > > Can you verify that the problem happens because one or both argument > positions of remove-text-properties don't exist due to the changes? Essentially, the end position which is out of range corresponds to the size of the *previous* contents of the file, not of the current file. For instance: While visiting file ffi.h with size 26675, replace it on disk with another version of 36721 bytes, revert-buffer, (args-out-of-range 580 26676). If we are visiting the long version of ffi.h (the one with 36721 bytes) and replace it on disk with the short version, then (args-out-of-range 580 36722). On both cases the buffer is left with 580 bytes of content, part of them belonging to the beginning of the file and the other part to the end of the file. The first byte missing from the buffer after revert-buffer fails is the first character which differs from one version to another of the file. I'll try to reduce a test case file. From debbugs-submit-bounces@debbugs.gnu.org Sat Oct 09 09:53:27 2010 Received: (at 7181) by debbugs.gnu.org; 9 Oct 2010 13:53:27 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1P4Zra-0005E0-T2 for submit@debbugs.gnu.org; Sat, 09 Oct 2010 09:53:27 -0400 Received: from impaqm1.telefonica.net ([213.4.138.1]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1P4ZrX-0005Ds-PS for 7181@debbugs.gnu.org; Sat, 09 Oct 2010 09:53:25 -0400 Received: from IMPmailhost5.adm.correo ([10.20.102.126]) by IMPaqm1.telefonica.net with bizsmtp id GdaU1f00K2jdgqJ01dwhy8; Sat, 09 Oct 2010 15:56:41 +0200 Received: from qcore ([83.52.52.115]) by IMPmailhost5.adm.correo with BIZ IMP id Gdwg1f0012V89Bn1ldwgiZ; Sat, 09 Oct 2010 15:56:41 +0200 X-Brightmail-Tracker: AAAAAA== X-TE-authinfo: authemail="981711563$telefonica.net" |auth_email="981711563@telefonica.net" X-TE-AcuTerraCos: auth_cuTerraCos="cosuitnetc01" From: =?utf-8?Q?=C3=93scar_Fuentes?= To: Alan Mackenzie Subject: Re: bug#7181: 24.0.50; args-out-of-range while reverting C++ header file References: <87zkuo2djr.fsf@telefonica.net> <83wrprn3ou.fsf@gnu.org> <87sk0f32pp.fsf@telefonica.net> Date: Sat, 09 Oct 2010 15:56:39 +0200 In-Reply-To: <87sk0f32pp.fsf@telefonica.net> (=?utf-8?Q?=22=C3=93scar?= Fuentes"'s message of "Sat, 09 Oct 2010 15:39:14 +0200") Message-ID: <87ocb331wo.fsf@telefonica.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: -3.3 (---) X-Debbugs-Envelope-To: 7181 Cc: 7181@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -3.2 (---) --=-=-= Content-Type: text/plain 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. --=-=-= Content-Type: application/octet-stream Content-Disposition: attachment; filename=b.h.master Content-Transfer-Encoding: base64 I2lmbmRlZiBCQVNJQ09QU19IX0Y5MDIxNjFDCiNkZWZpbmUgQkFTSUNPUFNfSF9GOTAyMTYxQwoK I2luY2x1ZGUgImZmaS5oIgojaW5jbHVkZSA8dGltZS5oPgoKTFAwX05FV19UWVBFX0RFQ19FWFBP UlRFRCh1bnNpZ25lZCBjaGFyKTsKTFAwX05FV19UWVBFX0RFQ19FWFBPUlRFRCh0bSk7CgpuYW1l c3BhY2UgbHAwIHsKCnN0cnVjdCBJbnQgOiBwdWJsaWMgT3BCYXNlMDxpbnQ+IHt9OwoKc3RydWN0 IENhc3RDaGFyVG9TdHJpbmdPUCA6IHB1YmxpYyBPcEJhc2UxPHN0ZDo6c3RyaW5nLCBjaGFyPiB7 CiAgc3RhdGljIHZvaWQgdyhzdGQ6OnN0cmluZyAqciwgY2hhciB2KSB7CiAgICBzdGQ6OnN0cmlu ZyB0OwogICAgdCArPSB2OwogICAgRkZJUmV0Q2xhc3MociwgdCk7CiAgfQp9OwoKfSAvLyBuYW1l c3BhY2UgbHAwCgojZW5kaWYgLyogI2lmbmRlZiBCQVNJQ09QU19IX0Y5MDIxNjFDICovIAo= --=-=-= Content-Type: application/octet-stream Content-Disposition: attachment; filename=b.h.next Content-Transfer-Encoding: base64 I2lmbmRlZiBCQVNJQ09QU19IX0Y5MDIxNjFDCiNkZWZpbmUgQkFTSUNPUFNfSF9GOTAyMTYxQwoK I2luY2x1ZGUgImZmaS5oIgojaW5jbHVkZSA8dGltZS5oPgoKbmFtZXNwYWNlIGxwMCB7Cgp0ZW1w bGF0ZSA8dHlwZW5hbWUgRGVyaXZlZCwgdHlwZW5hbWUgQmFzZT4Kc3RydWN0IER5bmFtaWNDYXN0 T3AgOiBwdWJsaWMgT3BCYXNlMTxEZXJpdmVkKiwgQmFzZSo+CnsKICBzdGF0aWMgRGVyaXZlZCog dyhCYXNlICpwKSB7CiAgICByZXR1cm4gZHluYW1pY19jYXN0PERlcml2ZWQqPihwKTsKICB9Cn07 Cgp9IC8vIG5hbWVzcGFjZSBscDAKCiNlbmRpZiAvKiAjaWZuZGVmIEJBU0lDT1BTX0hfRjkwMjE2 MUMgKi8gCg== --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Sat Oct 09 16:57:22 2010 Received: (at 7181) by debbugs.gnu.org; 9 Oct 2010 20:57:22 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1P4gTq-000896-Bc for submit@debbugs.gnu.org; Sat, 09 Oct 2010 16:57:22 -0400 Received: from colin.muc.de ([193.149.48.1] helo=mail.muc.de) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1P4gTn-000890-Nk for 7181@debbugs.gnu.org; Sat, 09 Oct 2010 16:57:20 -0400 Received: (qmail 14905 invoked by uid 3782); 9 Oct 2010 21:00:39 -0000 Received: from acm.muc.de (pD9E51812.dip.t-dialin.net [217.229.24.18]) by colin2.muc.de (tmda-ofmipd) with ESMTP; Sat, 09 Oct 2010 23:00:38 +0200 Received: (qmail 5625 invoked by uid 1000); 9 Oct 2010 21:13:32 -0000 Date: Sat, 9 Oct 2010 21:13:32 +0000 To: =?iso-8859-1?Q?=D3scar?= Fuentes Subject: Re: bug#7181: 24.0.50; args-out-of-range while reverting C++ header file Message-ID: <20101009211332.GA5486@muc.de> References: <87zkuo2djr.fsf@telefonica.net> <83wrprn3ou.fsf@gnu.org> <87sk0f32pp.fsf@telefonica.net> <87ocb331wo.fsf@telefonica.net> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <87ocb331wo.fsf@telefonica.net> User-Agent: Mutt/1.5.9i X-Delivery-Agent: TMDA/1.1.5 (Fettercairn) From: Alan Mackenzie X-Primary-Address: acm@muc.de X-Spam-Score: -2.5 (--) X-Debbugs-Envelope-To: 7181 Cc: 7181@debbugs.gnu.org, emacs-devel@gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.5 (--) Hi, Óscar, On Sat, Oct 09, 2010 at 03:56:39PM +0200, Óscar Fuentes wrote: > 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? -- Alan Mackenzie (Nuremberg, Germany). From debbugs-submit-bounces@debbugs.gnu.org Sat Oct 09 18:05:08 2010 Received: (at 7181) by debbugs.gnu.org; 9 Oct 2010 22:05:08 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1P4hXQ-0000A6-0h for submit@debbugs.gnu.org; Sat, 09 Oct 2010 18:05:08 -0400 Received: from impaqm1.telefonica.net ([213.4.138.1]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1P4hXN-00009k-3h for 7181@debbugs.gnu.org; Sat, 09 Oct 2010 18:05:06 -0400 Received: from IMPmailhost2.adm.correo ([10.20.102.39]) by IMPaqm1.telefonica.net with bizsmtp id GlkW1f0120r0BT601m8QeS; Sun, 10 Oct 2010 00:08:24 +0200 Received: from qcore ([83.52.52.115]) by IMPmailhost2.adm.correo with BIZ IMP id Gm8P1f0012V89Bn1im8PRk; Sun, 10 Oct 2010 00:08:24 +0200 X-Brightmail-Tracker: AAAAAA== X-TE-authinfo: authemail="981711563$telefonica.net" |auth_email="981711563@telefonica.net" X-TE-AcuTerraCos: auth_cuTerraCos="cosuitnetc01" From: =?utf-8?Q?=C3=93scar?= Fuentes To: Alan Mackenzie Subject: after-change-functions hook arguments (was: bug#7181: 24.0.50; args-out-of-range while reverting C++ header file) References: <87zkuo2djr.fsf@telefonica.net> <83wrprn3ou.fsf@gnu.org> <87sk0f32pp.fsf@telefonica.net> <87ocb331wo.fsf@telefonica.net> <20101009211332.GA5486@muc.de> Date: Sun, 10 Oct 2010 00:08:22 +0200 In-Reply-To: <20101009211332.GA5486@muc.de> (Alan Mackenzie's message of "Sat, 9 Oct 2010 21:13:32 +0000") Message-ID: <87aamn2f55.fsf_-_@telefonica.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -3.2 (---) X-Debbugs-Envelope-To: 7181 Cc: 7181@debbugs.gnu.org, emacs-devel@gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -3.1 (---) Alan Mackenzie writes: > 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? Seems that insert-file-contents is trying to be smart and determine which parts of the contents are shared among the old and the new text. On this case b.h.next and b.h.master differ only on the central region of text. The arguments passed to c-after-change indicates a deletion from position 94 to position 94+286=380. I don't know if that is correct, as the transformation is not a deletion but a replacement of the middle text segment of the buffer with a text chunk of different lenght, and the doc is not clear about that case. From debbugs-submit-bounces@debbugs.gnu.org Sat Oct 09 19:29:48 2010 Received: (at 7181) by debbugs.gnu.org; 9 Oct 2010 23:29:48 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1P4irM-0000iW-Ae for submit@debbugs.gnu.org; Sat, 09 Oct 2010 19:29:48 -0400 Received: from fencepost.gnu.org ([140.186.70.10]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1P4irJ-0000iR-Fy for 7181@debbugs.gnu.org; Sat, 09 Oct 2010 19:29:46 -0400 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 Received: by ceviche.home (Postfix, from userid 20848) id CEE0A6610C; Sun, 10 Oct 2010 01:33:19 +0200 (CEST) From: Stefan Monnier To: Alan Mackenzie Subject: Re: bug#7181: 24.0.50; args-out-of-range while reverting C++ header file Message-ID: References: <87zkuo2djr.fsf@telefonica.net> <83wrprn3ou.fsf@gnu.org> <87sk0f32pp.fsf@telefonica.net> <87ocb331wo.fsf@telefonica.net> <20101009211332.GA5486@muc.de> Date: Sun, 10 Oct 2010 01:33:19 +0200 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) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -4.9 (----) X-Debbugs-Envelope-To: 7181 Cc: =?iso-8859-1?Q?=D3scar?= Fuentes , 7181@debbugs.gnu.org, emacs-devel@gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -5.0 (-----) >> 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 From debbugs-submit-bounces@debbugs.gnu.org Sun Oct 10 09:53:53 2010 Received: (at 7181) by debbugs.gnu.org; 10 Oct 2010 13:53:53 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1P4wLY-0007MS-Oc for submit@debbugs.gnu.org; Sun, 10 Oct 2010 09:53:52 -0400 Received: from colin.muc.de ([193.149.48.1] helo=mail.muc.de) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1P4wLR-0007MN-OQ for 7181@debbugs.gnu.org; Sun, 10 Oct 2010 09:53:46 -0400 Received: (qmail 17095 invoked by uid 3782); 10 Oct 2010 13:57:06 -0000 Received: from acm.muc.de (pD9E51DE6.dip.t-dialin.net [217.229.29.230]) by colin2.muc.de (tmda-ofmipd) with ESMTP; Sun, 10 Oct 2010 15:57:03 +0200 Received: (qmail 5752 invoked by uid 1000); 10 Oct 2010 14:09:58 -0000 Date: Sun, 10 Oct 2010 14:09:58 +0000 To: =?iso-8859-1?Q?=D3scar?= Fuentes Subject: Re: bug#7181: 24.0.50; args-out-of-range while reverting C++ header file. PATCH. Message-ID: <20101010140958.GA5249@muc.de> References: <87zkuo2djr.fsf@telefonica.net> <83wrprn3ou.fsf@gnu.org> <87sk0f32pp.fsf@telefonica.net> <87ocb331wo.fsf@telefonica.net> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <87ocb331wo.fsf@telefonica.net> User-Agent: Mutt/1.5.9i X-Delivery-Agent: TMDA/1.1.5 (Fettercairn) From: Alan Mackenzie X-Primary-Address: acm@muc.de X-Spam-Score: -2.5 (--) X-Debbugs-Envelope-To: 7181 Cc: 7181@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.5 (--) Hi, Óscar, On Sat, Oct 09, 2010 at 03:56:39PM +0200, Óscar Fuentes wrote: > 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. > Please try the following patch and confirm that it works. I'll get it committed just as soon as I manage to connect to the new server: *** cc-mode.el.~3~ 2010-10-08 20:27:13.000000000 +0000 --- cc-mode.el 2010-10-10 13:46:28.074200752 +0000 *************** *** 1029,1038 **** (buffer-substring-no-properties type-pos term-pos) (buffer-substring-no-properties beg end))))))) - ;; (c-new-BEG c-new-END) will be the region to fontify. It may become - ;; larger than (beg end). - (setq c-new-BEG beg - c-new-END end) (if c-get-state-before-change-functions (mapc (lambda (fn) (funcall fn beg end)) --- 1029,1034 ---- *************** *** 1086,1091 **** --- 1082,1091 ---- (when c-recognize-<>-arglists (c-after-change-check-<>-operators beg end)) + ;; (c-new-BEG c-new-END) will be the region to fontify. It may become + ;; larger than (beg end). + (setq c-new-BEG beg + c-new-END end) (if c-before-font-lock-function (save-excursion (funcall c-before-font-lock-function beg end old-len))))))) -- Alan Mackenzie (Nuremberg, Germany). From debbugs-submit-bounces@debbugs.gnu.org Sun Oct 10 14:37:34 2010 Received: (at 7181) by debbugs.gnu.org; 10 Oct 2010 18:37:34 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1P50m6-0000ns-Aw for submit@debbugs.gnu.org; Sun, 10 Oct 2010 14:37:34 -0400 Received: from impaqm3.telefonica.net ([213.4.138.3]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1P50m3-0000nn-JN for 7181@debbugs.gnu.org; Sun, 10 Oct 2010 14:37:32 -0400 Received: from IMPmailhost2.adm.correo ([10.20.102.39]) by IMPaqm3.telefonica.net with bizsmtp id H5E51f00Z0r0BT63P6gsNA; Sun, 10 Oct 2010 20:40:52 +0200 Received: from qcore ([83.52.52.115]) by IMPmailhost2.adm.correo with BIZ IMP id H6gr1f0042V89Bn1i6gry9; Sun, 10 Oct 2010 20:40:52 +0200 X-Brightmail-Tracker: AAAAAA== X-TE-authinfo: authemail="981711563$telefonica.net" |auth_email="981711563@telefonica.net" X-TE-AcuTerraCos: auth_cuTerraCos="cosuitnetc01" From: =?utf-8?Q?=C3=93scar?= Fuentes To: Alan Mackenzie Subject: Re: bug#7181: 24.0.50; args-out-of-range while reverting C++ header file. PATCH. References: <87zkuo2djr.fsf@telefonica.net> <83wrprn3ou.fsf@gnu.org> <87sk0f32pp.fsf@telefonica.net> <87ocb331wo.fsf@telefonica.net> <20101010140958.GA5249@muc.de> Date: Sun, 10 Oct 2010 20:40:51 +0200 In-Reply-To: <20101010140958.GA5249@muc.de> (Alan Mackenzie's message of "Sun, 10 Oct 2010 14:09:58 +0000") Message-ID: <8762x93n7w.fsf@telefonica.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -3.1 (---) X-Debbugs-Envelope-To: 7181 Cc: 7181@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -3.0 (---) Alan Mackenzie writes: > Please try the following patch and confirm that it works. I'll get it > committed just as soon as I manage to connect to the new server: [snip] Yep, the error is gone. Thank you, Alan. From debbugs-submit-bounces@debbugs.gnu.org Thu Oct 21 13:35:04 2010 Received: (at control) by debbugs.gnu.org; 21 Oct 2010 17:35:04 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1P8z2d-0000bm-Ur for submit@debbugs.gnu.org; Thu, 21 Oct 2010 13:35:04 -0400 Received: from fencepost.gnu.org ([140.186.70.10]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1P8z2b-0000bQ-U5 for control@debbugs.gnu.org; Thu, 21 Oct 2010 13:35:02 -0400 Received: from rgm by fencepost.gnu.org with local (Exim 4.69) (envelope-from ) id 1P8z6L-0002hn-BE; Thu, 21 Oct 2010 13:38:53 -0400 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <19648.31405.213937.260600@fencepost.gnu.org> Date: Thu, 21 Oct 2010 13:38:53 -0400 From: Glenn Morris To: control Subject: close X-Attribution: GM X-Mailer: VM (www.wonderworks.com/vm), GNU Emacs (www.gnu.org/software/emacs) X-Hue: cyan X-Ran: Y9,r0C_5h^h^hT6OyfiZEo)6>lti4ge:!e[e?&Z91"Rc*0cNKPV(k=I@\_-to%O9h!~552 X-Debbugs-No-Ack: yes X-Spam-Score: -6.2 (------) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.2 (------) close 7181 From unknown Mon Aug 18 02:32:56 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Fri, 19 Nov 2010 12:24:03 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator