GNU bug report logs - #10463
24.0.92; c-literal-limits out of range

Previous Next

Packages: cc-mode, emacs;

Reported by: martin rudalics <rudalics <at> gmx.at>

Date: Mon, 9 Jan 2012 10:15:02 UTC

Severity: important

Merged with 10480

Found in version 24.0.92

Done: Alan Mackenzie <acm <at> muc.de>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 10463 in the body.
You can then email your comments to 10463 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#10463; Package emacs. (Mon, 09 Jan 2012 10:15:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to martin rudalics <rudalics <at> gmx.at>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Mon, 09 Jan 2012 10:15:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: martin rudalics <rudalics <at> gmx.at>
To: Bug-Gnu-Emacs <bug-gnu-emacs <at> gnu.org>
Subject: 24.0.92; c-literal-limits out of range
Date: Mon, 09 Jan 2012 11:13:35 +0100
For quite some time, when editing c-mode buffers I get errors which
typically look like:

Debugger entered--Lisp error: (args-out-of-range 170988 178401)
  parse-partial-sexp(170988 178401)
  c-literal-limits(nil nil t)
  c-indent-new-comment-line(t)
  default-indent-new-line(t)
  do-auto-fill()
  apply(do-auto-fill nil)
  c-mask-paragraph(nil t do-auto-fill)
  c-do-auto-fill()
  self-insert-command(1)
  call-interactively(self-insert-command nil nil)

At this time the buffer is visibly narrowed - the arguments of
`parse-partial-sexp' were apparently within (point-min) and (point-max)
of the widened buffer but the second argument was likely after the end
of the the narrowed buffer.

Moreover, the buffer was no more associated with the file I was trying
to edit, so reverting the buffer was impossible, undo information had
been discarded, killing the buffer was possible without asking.


In GNU Emacs 24.0.92.1 (i386-mingw-nt5.1.2600)
 of 2012-01-08 on NESTOR
Windowing system distributor `Microsoft Corp.', version 5.1.2600
configured using `configure --with-gcc (3.4) --no-opt'

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: ENU
  value of $XMODIFIERS: nil
  locale-coding-system: cp1252
  default enable-multibyte-characters: t

Major mode: Emacs-Lisp

Minor modes in effect:
  shell-dirtrack-mode: t
  scroll-restore-mode: t
  regexp-lock-mode: t
  eldoc-header-mode: t
  show-paren-mode: t
  tooltip-mode: t
  mouse-wheel-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  temp-buffer-resize-mode: t
  column-number-mode: t
  line-number-mode: t
  transient-mark-mode: t

Recent input:
<help-echo> <help-echo> <help-echo> <help-echo> <help-echo>
<help-echo> <menu-bar> <help-menu> <send-emacs-bug
-report>

Recent messages:
Loading paren...done
Loading vc-cvs...done
Loading vc-bzr...done
With .emacs from "2012-01-09 10:52:57 martin"

Load-path shadows:
None found.

Features:
(shadow gnus-util mail-extr message format-spec 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
hippie-exp dabbrev emacsbug cus-edit wid-edit cc-mode cc-fonts cc-guess
cc-menus cc-cmds cc-styles cc-align cc-engine cc-vars cc-defs vc-bzr
add-log speck elp cl local-tags windmove info-look find-func
elinfo-support elinfo texinfo info shell pcomplete comint ring vc-cvs
sidebar easymenu bookmark pp sort m&d scroll-restore regexp-lock
easy-mmode time-stamp eldoc help-fns find-dired dired regexp-opt
jka-compr paren cus-start cus-load avoid time-date tooltip ediff-hook
vc-hooks lisp-float-type mwheel dos-w32 disp-table ls-lisp w32-win
w32-vars tool-bar dnd fontset image fringe lisp-mode register page
menu-bar rfn-eshadow timer select scroll-bar 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 minibuffer button
faces cus-face files text-properties overlay sha1 md5 base64 format env
code-pages mule custom widget hashtable-print-readable backquote
make-network-process multi-tty emacs)




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#10463; Package emacs. (Mon, 09 Jan 2012 14:03:02 GMT) Full text and rfc822 format available.

Message #8 received at 10463 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> IRO.UMontreal.CA>
To: martin rudalics <rudalics <at> gmx.at>
Cc: 10463 <at> debbugs.gnu.org
Subject: Re: bug#10463: 24.0.92; c-literal-limits out of range
Date: Mon, 09 Jan 2012 09:02:04 -0500
> Moreover, the buffer was no more associated with the file I was trying
> to edit, so reverting the buffer was impossible, undo information had
> been discarded, killing the buffer was possible without asking.

That's presumably because the code uses something like
with-silent-modifications.  I.e. it's not a problem (contrary to the
`args-out-of-range' error, obviously).


        Stefan




Information forwarded to bug-gnu-emacs <at> gnu.org, bug-cc-mode <at> gnu.org:
bug#10463; Package emacs,cc-mode. (Mon, 09 Jan 2012 18:20:01 GMT) Full text and rfc822 format available.

Message #11 received at 10463 <at> debbugs.gnu.org (full text, mbox):

From: martin rudalics <rudalics <at> gmx.at>
To: Stefan Monnier <monnier <at> IRO.UMontreal.CA>
Cc: 10463 <at> debbugs.gnu.org
Subject: Re: bug#10463: 24.0.92; c-literal-limits out of range
Date: Mon, 09 Jan 2012 19:19:25 +0100
> That's presumably because the code uses something like
> with-silent-modifications.  I.e. it's not a problem (contrary to the
> `args-out-of-range' error, obviously).

My bad.  I didn't quit the backtrace buffer but tried to fix it manually
and lost my changes :-(

martin




Information forwarded to bug-gnu-emacs <at> gnu.org, bug-cc-mode <at> gnu.org:
bug#10463; Package emacs,cc-mode. (Mon, 09 Jan 2012 21:25:02 GMT) Full text and rfc822 format available.

Message #14 received at 10463 <at> debbugs.gnu.org (full text, mbox):

From: Alan Mackenzie <acm <at> muc.de>
To: martin rudalics <rudalics <at> gmx.at>
Cc: Stefan Monnier <monnier <at> IRO.UMontreal.CA>, 10463 <at> debbugs.gnu.org
Subject: Re: bug#10463: 24.0.92; c-literal-limits out of range
Date: Mon, 9 Jan 2012 21:17:21 +0000
On Mon, Jan 09, 2012 at 07:19:25PM +0100, martin rudalics wrote a bug
report:

Hi, Martin.

Please apply this patch, use C Mode for an infinite amount of time, then
report back and tell me the bug has disappeared.

Thanks!


*** orig/cc-engine.el	2012-01-09 20:27:51.000000000 +0000
--- cc-engine.el	2012-01-09 20:53:42.000000000 +0000
***************
*** 4225,4236 ****
  
  Note that this function might do hidden buffer changes.	 See the
  comment at the start of cc-engine.el for more info."
!   (let* ((safe-place (c-state-safe-place (point)))
! 	 (lit (c-state-pp-to-literal safe-place (point))))
!     (or (cadr lit)
! 	(and detect-cpp
! 	     (save-excursion (c-beginning-of-macro))
! 	     'pound))))
  
  (defun c-literal-limits (&optional lim near not-in-delimiter)
    "Return a cons of the beginning and end positions of the comment or
--- 4225,4238 ----
  
  Note that this function might do hidden buffer changes.	 See the
  comment at the start of cc-engine.el for more info."
!   (save-restriction
!     (widen
!      (let* ((safe-place (c-state-safe-place (point)))
! 	    (lit (c-state-pp-to-literal safe-place (point))))
!        (or (cadr lit)
! 	   (and detect-cpp
! 		(save-excursion (c-beginning-of-macro))
! 		'pound))))))
  
  (defun c-literal-limits (&optional lim near not-in-delimiter)
    "Return a cons of the beginning and end positions of the comment or
***************
*** 4250,4258 ****
    (save-excursion
      (let* ((pos (point))
  	   (lim (or lim (c-state-safe-place pos)))
! 	   (pp-to-lit (c-state-pp-to-literal lim pos))
  	   (state (car pp-to-lit))
- 	   (lit-type (cadr pp-to-lit))
  	   (lit-limits (car (cddr pp-to-lit))))
  
        (cond
--- 4252,4261 ----
    (save-excursion
      (let* ((pos (point))
  	   (lim (or lim (c-state-safe-place pos)))
! 	   (pp-to-lit (save-restriction
! 			(widen)
! 			(c-state-pp-to-literal lim pos)))
  	   (state (car pp-to-lit))
  	   (lit-limits (car (cddr pp-to-lit))))
  
        (cond

> martin

-- 
Alan Mackenzie (Nuremberg, Germany).




Information forwarded to bug-gnu-emacs <at> gnu.org, bug-cc-mode <at> gnu.org:
bug#10463; Package emacs,cc-mode. (Tue, 10 Jan 2012 10:21:02 GMT) Full text and rfc822 format available.

Message #17 received at 10463 <at> debbugs.gnu.org (full text, mbox):

From: martin rudalics <rudalics <at> gmx.at>
To: Alan Mackenzie <acm <at> muc.de>
Cc: Stefan Monnier <monnier <at> IRO.UMontreal.CA>, 10463 <at> debbugs.gnu.org
Subject: Re: bug#10463: 24.0.92; c-literal-limits out of range
Date: Tue, 10 Jan 2012 11:19:50 +0100
> Please apply this patch, use C Mode for an infinite amount of time,

Editing with C Mode already takes an infinite amount of time ...

> then
> report back and tell me the bug has disappeared.

... so better not hold your breath ;-)

> !     (widen
> !      (let* ((safe-place (c-state-safe-place (point)))

My `widen' doesn't like any arguments.

Thanks, martin




Information forwarded to bug-gnu-emacs <at> gnu.org, bug-cc-mode <at> gnu.org:
bug#10463; Package emacs,cc-mode. (Tue, 10 Jan 2012 20:06:01 GMT) Full text and rfc822 format available.

Message #20 received at 10463 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> IRO.UMontreal.CA>
To: martin rudalics <rudalics <at> gmx.at>
Cc: Alan Mackenzie <acm <at> muc.de>, 10463 <at> debbugs.gnu.org
Subject: Re: bug#10463: 24.0.92; c-literal-limits out of range
Date: Tue, 10 Jan 2012 15:04:55 -0500
>> Please apply this patch, use C Mode for an infinite amount of time,
> Editing with C Mode already takes an infinite amount of time ...

But doing it with Emacs makes the time pass infinitely faster.


        Stefan




Information forwarded to bug-gnu-emacs <at> gnu.org, bug-cc-mode <at> gnu.org:
bug#10463; Package emacs,cc-mode. (Tue, 10 Jan 2012 20:31:01 GMT) Full text and rfc822 format available.

Message #23 received at 10463 <at> debbugs.gnu.org (full text, mbox):

From: Juanma Barranquero <lekktu <at> gmail.com>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: martin rudalics <rudalics <at> gmx.at>, 10463 <at> debbugs.gnu.org,
	Alan Mackenzie <acm <at> muc.de>
Subject: Re: bug#10463: 24.0.92; c-literal-limits out of range
Date: Tue, 10 Jan 2012 21:29:33 +0100
On Tue, Jan 10, 2012 at 21:04, Stefan Monnier <monnier <at> iro.umontreal.ca> wrote:

>> Editing with C Mode already takes an infinite amount of time ...
>
> But doing it with Emacs makes the time pass infinitely faster.

Yes, but do both infinites have the same cardinality...?

    Juanma




Information forwarded to bug-gnu-emacs <at> gnu.org, bug-cc-mode <at> gnu.org:
bug#10463; Package emacs,cc-mode. (Tue, 10 Jan 2012 21:23:02 GMT) Full text and rfc822 format available.

Message #26 received at 10463 <at> debbugs.gnu.org (full text, mbox):

From: martin rudalics <rudalics <at> gmx.at>
To: Stefan Monnier <monnier <at> IRO.UMontreal.CA>
Cc: Alan Mackenzie <acm <at> muc.de>, 10463 <at> debbugs.gnu.org
Subject: Re: bug#10463: 24.0.92; c-literal-limits out of range
Date: Tue, 10 Jan 2012 22:21:42 +0100
> But doing it with Emacs makes the time pass infinitely faster.

In particular when it throws you out of its ranges.

martin





Forcibly Merged 10463 10480. Request was from Glenn Morris <rgm <at> gnu.org> to control <at> debbugs.gnu.org. (Wed, 11 Jan 2012 19:08:02 GMT) Full text and rfc822 format available.

Reply sent to Alan Mackenzie <acm <at> muc.de>:
You have taken responsibility. (Wed, 11 Jan 2012 22:46:02 GMT) Full text and rfc822 format available.

Notification sent to martin rudalics <rudalics <at> gmx.at>:
bug acknowledged by developer. (Wed, 11 Jan 2012 22:46:02 GMT) Full text and rfc822 format available.

Message #33 received at 10463-done <at> debbugs.gnu.org (full text, mbox):

From: Alan Mackenzie <acm <at> muc.de>
To: 10463-done <at> debbugs.gnu.org
Subject: Bug #10463 fixed
Date: Wed, 11 Jan 2012 22:38:15 +0000
Bug fixed in revision 106849.

-- 
Alan Mackenzie (Nuremberg, Germany).




Reply sent to Alan Mackenzie <acm <at> muc.de>:
You have taken responsibility. (Wed, 11 Jan 2012 22:46:02 GMT) Full text and rfc822 format available.

Notification sent to Alex <alex <at> bennee.com>:
bug acknowledged by developer. (Wed, 11 Jan 2012 22:46:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sun, 12 Feb 2012 12:24:05 GMT) Full text and rfc822 format available.

This bug report was last modified 13 years and 182 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.