** Description changed:

- Binary package hint: emacs23
+ (Description updated by Brian Gernhardt)
  
- On several systems that I maintain, we occasionally see user's emacs
- processes that are using 100% of a CPU, usually when that user is not
- even logged in.  Some follow-up with the users seems to indicate that
- this can happen when emacs is running in an ssh session, and ssh is
- terminated uncleanly.
+ When emacs is running in an ssh session and ssh is terminated uncleanly,
+ it begins to use 100% CPU and slowly but constantly increase its used
+ memory.
  
- I have been able to reproduce this somewhat-reliably (say, one time in
- five) by starting emacs, entering M-x shell, running 'yes', and then
- using the ssh escape ~. to end my session.  The emacs process lives,
- continuing to use CPU (and consume more memory, which is presumably tied
- to my test case continuing to produce output to an emacs buffer).  I
- have obtained a core file for such a process by attaching to it with gdb
- and using the 'gcore' command, but my build with DEB_BUILD_OPTIONS=debug
- does not seem to have preserved debug symbols (I guess I need nostrip as
- well?), so it's unclear how useful it is.  (It's also 700M, due to the
- aforementioned RAM usage ballooning.)
+ [Impact]
  
- I looked at the NEWS file for upstream emacs 23.2 and 23.3 and didn't
- see anything that looked relevant to this issue, so I suspect it's still
- a problem.
+ In a department with approximately 50 desktops, one publicly accessible
+ server, and a couple hundred users, I have to kill on average one emacs
+ process a day.  If left alone, those processes not only slow down the
+ machine (by using up CPU time) but also eventually trigger the OOM
+ killer when their memory usage exceeds the amount of available swap
+ space.
  
- My testing has been done on:
- root@caspian:~# uname -a
- Linux caspian 2.6.32-25-generic #44-Ubuntu SMP Fri Sep 17 20:05:27 UTC 2010 
x86_64 GNU/Linux
- root@caspian:~# lsb_release -a
- No LSB modules are available.
- Distributor ID: Ubuntu
- Description:    Ubuntu 10.04.1 LTS
- Release:        10.04
- Codename:       lucid
+ Unfortunately, the Linux OOM killer is not 100% accurate at removing the
+ cause and I have seen other long-running high-memory processes.  While I
+ have heard no complaints about data loss, it is possible.
  
- And I've been using the source package version 23.1+1-4ubuntu7.2
+ [Development Fix]
+ 
+ Newer versions of Ubuntu have fixed this problem by having newer
+ versions of emacs.  The issue was fixed in 23.2a, so all Ubuntu packages
+ > 23.2 are fixed.
+ 
+ [Stable Fix]
+ 
+ The fix from emacs applies cleanly to the source for 23.1 and can be
+ found in their git repository:
+ 
http://git.savannah.gnu.org/cgit/emacs.git/patch/?id=1857569af70493e9dcd446c8bfb029096b355593
+ 
+ [Test Case]
+ 
+ 1) ssh to localhost
+ 2) start emacs
+ 3) Control-Z
+ 4) Enter, tilde, period (to kill the SSH session)
+ 5) emacs starts spinning and eating memory (verified by top)
+ 
+ [Regression Portential]
+ 
+ Given that the fix only affects emacs when it is exiting, it is unlikely
+ to cause any user regressions.

** Description changed:

- (Description updated by Brian Gernhardt)
- 
  When emacs is running in an ssh session and ssh is terminated uncleanly,
  it begins to use 100% CPU and slowly but constantly increase its used
  memory.
  
  [Impact]
  
  In a department with approximately 50 desktops, one publicly accessible
  server, and a couple hundred users, I have to kill on average one emacs
  process a day.  If left alone, those processes not only slow down the
  machine (by using up CPU time) but also eventually trigger the OOM
  killer when their memory usage exceeds the amount of available swap
  space.
  
  Unfortunately, the Linux OOM killer is not 100% accurate at removing the
  cause and I have seen other long-running high-memory processes.  While I
  have heard no complaints about data loss, it is possible.
  
  [Development Fix]
  
  Newer versions of Ubuntu have fixed this problem by having newer
  versions of emacs.  The issue was fixed in 23.2a, so all Ubuntu packages
  > 23.2 are fixed.
  
  [Stable Fix]
  
  The fix from emacs applies cleanly to the source for 23.1 and can be
  found in their git repository:
  
http://git.savannah.gnu.org/cgit/emacs.git/patch/?id=1857569af70493e9dcd446c8bfb029096b355593
  
  [Test Case]
  
  1) ssh to localhost
  2) start emacs
  3) Control-Z
  4) Enter, tilde, period (to kill the SSH session)
  5) emacs starts spinning and eating memory (verified by top)
  
  [Regression Portential]
  
  Given that the fix only affects emacs when it is exiting, it is unlikely
  to cause any user regressions.

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/786730

Title:
  emacs spins when ssh is uncleanly terminated

To manage notifications about this bug go to:
https://bugs.launchpad.net/emacs/+bug/786730/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to