[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#11841: 24.1; emacs hangs when opening cpp file with mixed eol styles
From: |
Alan Mackenzie |
Subject: |
bug#11841: 24.1; emacs hangs when opening cpp file with mixed eol styles |
Date: |
Sat, 7 Jul 2012 21:10:11 +0000 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
Hi, Eli.
On Mon, Jul 02, 2012 at 07:42:11PM +0300, Eli Zaretskii wrote:
> > Date: Sun, 1 Jul 2012 20:51:43 -0400
> > From: Vadim K <vadimsks@gmail.com>
> > Emacs hangs forever with 100% cpu usage when I'm trying to open a
> > specific cpp file (see attached bad.cpp). The bad.cpp file has
> > Windows end of line style (0D 0A) everywhere except in the line next
> > to the last one.
> Inconsistent EOL format is not the problem, it is just the trigger.
> The problem seems to be that the C Mode is unable to process a buffer
> where some lines end in a ^M^J (a.k.a. CRLF) instead of a mere LF
> (newline). To see that, make the EOL format of the test file
> consistently CRLF, then do this:
> emacs -Q
> M-x find-file-literally RET bad.cpp RET
> M-x normal-mode
> Emacs will hang.
> I attached a debugger and produced the backtrace below. By doing
> "finish" until it hanged, I found out that it infloops inside
> c-backward-sws. HTH.
> #0 0x010e6192 in Fforward_comment (count=-4) at syntax.c:2257
> 2257 count1 = XINT (count);
[ ..... ]
> Lisp Backtrace:
> "forward-comment" (0x8890b8)
> "c-backward-sws" (0x889318)
[ .... ]
Just as an observation, (forward-comment -1) doesn't move back over a ^M.
I think it should. This might be the cause of the observed bad
behaviour.
--
Alan Mackenzie (Nuremberg, Germany).
- bug#11841: 24.1; emacs hangs when opening cpp file with mixed eol styles, Vadim K, 2012/07/02
- bug#11841: 24.1; emacs hangs when opening cpp file with mixed eol styles, Eli Zaretskii, 2012/07/02
- bug#11841: 24.1; emacs hangs when opening cpp file with mixed eol styles, Stefan Monnier, 2012/07/02
- bug#11841: 24.1; emacs hangs when opening cpp file with mixed eol styles,
Alan Mackenzie <=
- bug#11841: 24.1; emacs hangs when opening cpp file with mixed eol styles, Stefan Monnier, 2012/07/07
- bug#11841: 24.1; emacs hangs when opening cpp file with mixed eol styles, Eli Zaretskii, 2012/07/07
- bug#11841: 24.1; emacs hangs when opening cpp file with mixed eol styles, Stefan Monnier, 2012/07/08
- bug#11841: 24.1; emacs hangs when opening cpp file with mixed eol styles, Alan Mackenzie, 2012/07/08
- bug#11841: 24.1; emacs hangs when opening cpp file with mixed eol styles, Stefan Monnier, 2012/07/08
- bug#11841: 24.1; emacs hangs when opening cpp file with mixed eol styles, Alan Mackenzie, 2012/07/15
- bug#11841: 24.1; emacs hangs when opening cpp file with mixed eol styles, Stefan Monnier, 2012/07/15
bug#11841: 24.1; emacs hangs when opening cpp file with mixed eol styles, Alan Mackenzie, 2012/07/20