Subject: 24.0.50; args-out-of-range while reverting C++ header file

From: [email-masked] (Oscar Fuentes)
Date: Sat, 09 Oct 2010 06:30:32 +0200

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 [email-masked] 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
<make some big modification on disk to the file>
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 <return> M-x r e v e r t SPC b u 
f f e r <return> y e s <return> M-x <up> <return> y 
e s <return> SPC C-_ M-x s e t SPC v a r i <tab> <return> 
d e b u <tab> o n <tab> e r r <tab> <return> t <return> 
M-x r e v e r t SPC b u f f e r <return> y e s <return> 
M-x r e v e r t SPC b u f f e r <return> y e s <return> 
<up> <up> <up> <up> <up> <up> <up> <up> <up> <up> C-SPC 
<down> <down> <down> <down> <down> <down> <down> <down> 
<down> <down> M-w <help-echo> <help-echo> <help-echo> 
<help-echo> <help-echo> <menu-bar> <help-menu> <se
nd-emacs-bug-report>

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)