[Bug 383475] New: emacs loops opening single C++ source line
https://bugzilla.novell.com/show_bug.cgi?id=383475 Summary: emacs loops opening single C++ source line Product: openSUSE 11.0 Version: Factory Platform: x86-64 OS/Version: Other Status: NEW Severity: Normal Priority: P5 - None Component: Basesystem AssignedTo: bnc-team-screening@forge.provo.novell.com ReportedBy: koenig@linux.de QAContact: qa@suse.de Found By: --- trying to open the atteched file "x.cc" emacs loops and hogs memory. actually this already happend when I tried to enlarge that string by typing CTRL-U 9999 X to add another 10K "X" characters. that operation did never complete:-( first I used CTRL-U 999 X for the first 999 Xs which was ok, emacs didn't start looping with that. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=383475 User koenig@linux.de added comment https://bugzilla.novell.com/show_bug.cgi?id=383475#c1 --- Comment #1 from Harald Koenig <koenig@linux.de> 2008-04-24 12:28:27 MST --- Created an attachment (id=210300) --> (https://bugzilla.novell.com/attachment.cgi?id=210300) emacs loops when reading/displaying this file -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=383475 User koenig@linux.de added comment https://bugzilla.novell.com/show_bug.cgi?id=383475#c2 --- Comment #2 from Harald Koenig <koenig@linux.de> 2008-04-24 12:29:25 MST --- (In reply to comment #1 from Harald Koenig)
Created an attachment (id=210300) --> (https://bugzilla.novell.com/attachment.cgi?id=210300) [details] emacs loops when reading/displaying this file
FYI: if the file is called "x.c" instead of "x.cc", emacs is fine... -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=383475 Martin Mrazik <mmrazik@novell.com> changed: What |Removed |Added ---------------------------------------------------------------------------- AssignedTo|bnc-team-screening@forge.provo.novell.com |mfabian@novell.com -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=383475 User mfabian@novell.com added comment https://bugzilla.novell.com/show_bug.cgi?id=383475#c3 Mike Fabian <mfabian@novell.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |werner@novell.com --- Comment #3 from Mike Fabian <mfabian@novell.com> 2008-04-25 05:01:38 MST --- I cannot reproduce this with GNU Emacs. GNU Emacs takes a *long* time to open this file but finally manages it. Same with XEmacs. XEmacs loads the file rather fast if started with the default setup: xemacs -q (not using your init files.) The buffer is then not fontified (i.e. not coloured), XEmacs doesn’t use font-lock by default. Switching on fontlock then by M-x font-lock-mode RET takes a *very* long time but XEmacs finally manages. As GNU Emacs has fontlock on by default, I think the problem is that the fontlock algorithm is very slow for that type of file. And apparently even slower in XEmacs than in GNU Emacs. But the font-locking finally finishes. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=383475 User werner@novell.com added comment https://bugzilla.novell.com/show_bug.cgi?id=383475#c4 --- Comment #4 from Dr. Werner Fink <werner@novell.com> 2008-04-25 05:27:53 MST --- Harald: Which version of emacs do you have used? GNU Emacs or Xemacs? In GNU Emacs you may type Ctrl-h Ctrl-e and search for fontification. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=383475 User koenig@linux.de added comment https://bugzilla.novell.com/show_bug.cgi?id=383475#c5 --- Comment #5 from Harald Koenig <koenig@linux.de> 2008-04-25 07:15:14 MST --- (In reply to comment #4 from Werner Fink)
Harald: Which version of emacs do you have used? GNU Emacs or Xemacs? In GNU Emacs you may type Ctrl-h Ctrl-e and search for fontification.
I was using plain (gnu-) emacs (even in text mode first). usually I have all the color stuff disabled, but by accident... (In reply to comment #3 from Mike Fabian)
I cannot reproduce this with GNU Emacs. GNU Emacs takes a *long* time to open this file but finally manages it.
so you actually can reproduce this problem ;-) before reporting I was just a little bit too impatient ;-) hey, it took 45 cpu-secs on my 2 GHz T7200 (64bit core2duo), that's just insane for a single line of C++ code (ok, it's 10K characters but...) using cp x.cc x.c emacs -q x.c is _much_ faster (but obviously not a solution for the generic case;)
Same with XEmacs. XEmacs loads the file rather fast if started with the default setup:
xemacs -q
correct, ~2 cpu-secs
The buffer is then not fontified (i.e. not coloured), XEmacs doesn’t use font-lock by default.
Switching on fontlock then by
M-x font-lock-mode RET
takes a *very* long time but XEmacs finally manages.
ouch, you're right :-(
As GNU Emacs has fontlock on by default, I think the problem is that the fontlock algorithm is very slow for that type of file.
And apparently even slower in XEmacs than in GNU Emacs.
But the font-locking finally finishes.
hmm, well :-( looks like a an item for a report to gnu-/x-emacs maintainers... just FYI: I've tried older emacs versions on other platforms which I've build myself from source: always the same behaviour. so at least it's not that specific emacs version nor the 11.0-beta environment. good for you ;-) bad for emacs :-( thanks, Harald -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=383475 User werner@novell.com added comment https://bugzilla.novell.com/show_bug.cgi?id=383475#c6 Dr. Werner Fink <werner@novell.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution| |WONTFIX --- Comment #6 from Dr. Werner Fink <werner@novell.com> 2008-04-25 07:29:25 MST --- There is nothing what we can fix without breaking the behaviour and what is even more likly the code its self. The text in font-lock.el says something like: ;; Fontification for a particular mode may be available in a number of levels ;; of decoration. The higher the level, the more decoration, but the more time ;; it takes to fontify. See the variable `font-lock-maximum-decoration', and ;; also the variable `font-lock-maximum-size'. Support modes for Font Lock ;; mode can be used to speed up Font Lock mode. See `font-lock-support-mode'. If this isn't what you want you may report this upstream at https://savannah.gnu.org/projects/emacs and/or http://www.xemacs.org/Debug/index.html -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=383475 User mfabian@novell.com added comment https://bugzilla.novell.com/show_bug.cgi?id=383475#c7 --- Comment #7 from Mike Fabian <mfabian@novell.com> 2008-04-25 07:33:03 MST --- If you rename the file from x.cc to x.c, C mode font-locking is used which probably uses simpler regular expressions for fontification than those used for C++ mode. I wonder whether the regular expressions used for C++ can be simplified without introducing inaccuracies in C++ font-locking. I.e. is the slowness of C++ font-locking something which can not be avoided or is there a stupid bug in the regular expressions used for C++ font-locking. Harald found that this also happens with older versions of Emacs. That it happens the same way for both GNU Emacs and XEmacs is probably another indicator that the problem is in code for C++ font-locking shared by both versions of Emacs which has not changed for many years. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=383475 User mfabian@novell.com added comment https://bugzilla.novell.com/show_bug.cgi?id=383475#c8 --- Comment #8 from Mike Fabian <mfabian@novell.com> 2008-04-25 08:09:55 MST --- Reported upstream for XEmacs: http://tracker.xemacs.org/XEmacs/its/issue362 -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
participants (1)
-
bugzilla_noreply@novell.com