Bug 860312 - emacs chews CPU, spams .xsession-errors with "Back to top level."
Summary: emacs chews CPU, spams .xsession-errors with "Back to top level."
Keywords:
Status: CLOSED EOL
Alias: None
Product: Fedora
Classification: Fedora
Component: emacs
Version: 19
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Petr Hracek
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-09-25 14:41 UTC by Jason Tibbitts
Modified: 2015-02-17 14:28 UTC (History)
13 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-02-17 14:28:18 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Jason Tibbitts 2012-09-25 14:41:30 UTC
Since I updated my 100+ desktops to F17, I've been having problems with user volumes filling up with huge .xsession-errors files containing little other than "Back to top level." repeated endlessly.  I tracked this down to emacs processes, and further came upon debbugs.gnu.org/cgi/bugreport.cgi?bug=10669/ which appears to cover the same issue.

It doesn't seem like many people see this, but for some reason my users are hitting it several times per day.  I myself have been unable to reproduce it, but then I've spent most of my time cleaning up after this problem rather than trying to understand what's causing it.  I just wanted to get it on the record here to see if anyone else has hints on figuring out what's happening and why my users are all seeing it when few others are.

Comment 1 Jason Tibbitts 2012-09-25 15:50:18 UTC
Just happened again to one of my users.  Here's the contents of .xsession-errors from startup until the process was killed (excluding millions of repetitions of "Back to top level."

Warning: due to a long standing Gtk+ bug
http://bugzilla.gnome.org/show_bug.cgi?id=85715
Emacs might crash when run in daemon mode and the X11 connection is unexpectedly lost.
Using an Emacs configured with --with-x-toolkit=lucid does not have this problem.
("/usr/bin/emacs" "--no-splash" "--smid=101d421af6133000134850254500000199660029")
krunner(4716) KDevelopSessions::KDevelopSessions: INIT KDEV 
krunner(4716) KDevelopSessions::loadSessions: LOADSESSION!.>>> 
Loading /usr/share/emacs/site-lisp/site-start.d/auctex.el (source)...
Loading /usr/share/emacs/site-lisp/site-start.d/auctex.el (source)...done
Loading /usr/share/emacs/site-lisp/site-start.d/desktop-entry-mode-init.el (source)...
Loading /usr/share/emacs/site-lisp/site-start.d/desktop-entry-mode-init.el (source)...done
Loading /usr/share/emacs/site-lisp/site-start.d/focus-init.el (source)...
Loading /usr/share/emacs/site-lisp/site-start.d/focus-init.el (source)...done
Loading /usr/share/emacs/site-lisp/site-start.d/php-mode-init.el (source)...
Loading /usr/share/emacs/site-lisp/site-start.d/php-mode-init.el (source)...done
Loading /usr/share/emacs/site-lisp/site-start.d/preview-latex.el (source)...
Loading /usr/share/emacs/site-lisp/site-start.d/preview-latex.el (source)...done
Loading /usr/share/emacs/site-lisp/site-start.d/rpm-spec-mode-init.el (source)...
Loading /usr/share/emacs/site-lisp/site-start.d/rpm-spec-mode-init.el (source)...done
Starting Emacs daemon.
Back to top level.
Back to top level.
  [continued millions of times]
Back to top level.
Error: server did not start correctly
  [emacs process was killed here]

Comment 2 Jason Tibbitts 2012-10-04 14:35:35 UTC
This seems to be related to emacs being started at login by the session manager.  Everyone uses KDE here so I can't speak for what other environments do.   Here's the relevant bit:

restartCommand42=/bin/emacs,--smid=101d421af4136000134928522500000092680049,--no-splash,--chdir=/home/bellona8/Documents,--daemon

At login that will chew CPU and spew to .xsession-errors  mercilessly until killed.  What's worse is that it doesn't actually run, so the user starts another one, and on the next login you get two of them doing the same thing.

Comment 3 Mary Ellen Foster 2012-11-07 10:03:09 UTC
Just happened to me again -- note that I never use emacs deliberately, so it's somehow starting automatically without me requesting it. Possibly a MIME type/file association thing.

Comment 4 Mary Ellen Foster 2012-11-07 10:09:05 UTC
Aha -- figured out a bit more: in the KDE File Associations module, the top file association for files of "text/x-tex" is "Emacs Client". And I did download a .tex file from the web recently, which must have put emacs into my session.

So for me at least, the short-term fix will be to change the file associations for text/x-tex. But the underlying problem with emacs-client starting automatically seems to remain. :(

Comment 5 Josh Trutwin 2012-11-08 14:48:12 UTC
Just had this happen for a few of my users as well - we are using XFCE desktop and it seems a few applications are set to open with XEmacs Text Editor by default so I'm guessing that is the cause of the problem.  Ideally the emacs package would be updated tho....

Comment 6 Luke Hutchison 2013-01-05 09:03:04 UTC
Just discovered I have 567 *gigabytes* of "Back to top level." messages in .xsession-errors, constantly being generated at a rate of 150kB/sec... whaa??

I'm running xfce on a fresh install of F18, and emacs is run in daemon mode in the session by default for some reason. The emacs daemon shouldn't be run by default, unless it is requested. And it shouldn't be dumping this message in the log, obviously, but just removing the code that dumps this line in the log won't solve the problem, one CPU core is pegged at 100%, so whatever is causing emacs to spin needs to be fixed.

Comment 7 Luke Hutchison 2013-01-05 09:12:10 UTC
N.B. for anybody running into this, the heavy-handed "killall -9 emacs ; rm ~/.xsession-errors" doesn't free the disk space until you log out and log back in, because tons of other running processes also have the .xsession-errors open. You need to do something like "echo > ~/.xsession-errors" to empty the logfile instead.

Comment 8 Luke Hutchison 2013-01-05 09:38:42 UTC
See also https://groups.google.com/forum/#!topic/gnu.emacs.bug/uiEqe710M4U

Comment 9 Luke Hutchison 2013-01-05 10:06:35 UTC
There's a comment on the bottom of the following page about this bug:

http://www.emacswiki.org/emacs/EmacsAsDaemon

The suggested fix is:

"Workaround: Start emacs with “emacs --daemon -q”. The first time you connect via emacsclient, open your .emacs file and run ‘eval-buffer’."

After trying that fix, I get the following emacs crash on session login: Bug 875440

Fortunately, now that the emacs daemon crashes on session login, it no longer dumps error messages into .xsession-errors!

I haven't found what is actually starting the emacs daemon yet, so I can stop the daemon from starting -- the xfce session manager doesn't show it as being started on session start, and the process parent is systemd, but systemd doesn't seem to have a service file for emacs in the location /etc/systemd/system/emacs@.service , recommended on this page: 

https://wiki.archlinux.org/index.php/Emacs#As_a_daemon

Comment 10 Fedora Admin XMLRPC Client 2013-02-27 15:47:44 UTC
This package has changed ownership in the Fedora Package Database.  Reassigning to the new owner of this component.

Comment 11 Fedora End Of Life 2013-04-03 17:01:37 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 19 development cycle.
Changing version to '19'.

(As we did not run this process for some time, it could affect also pre-Fedora 19 development
cycle bugs. We are very sorry. It will help us with cleanup during Fedora 19 End Of Life. Thank you.)

More information and reason for this action is here:
https://fedoraproject.org/wiki/BugZappers/HouseKeeping/Fedora19

Comment 12 Fedora End Of Life 2015-01-09 17:23:01 UTC
This message is a notice that Fedora 19 is now at end of life. Fedora 
has stopped maintaining and issuing updates for Fedora 19. It is 
Fedora's policy to close all bug reports from releases that are no 
longer maintained. Approximately 4 (four) weeks from now this bug will
be closed as EOL if it remains open with a Fedora 'version' of '19'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 19 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 13 Fedora End Of Life 2015-02-17 14:28:18 UTC
Fedora 19 changed to end-of-life (EOL) status on 2015-01-06. Fedora 19 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.


Note You need to log in before you can comment on or make changes to this bug.