From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Alan Malloy Newsgroups: gmane.emacs.bugs Subject: bug#7951: 23.1; SIG_HUP handler infinite loop? Date: Mon, 31 Jan 2011 11:05:01 -0800 Message-ID: <4D4707DD.5010306@yieldbuild.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="------------070708070302040506070000" X-Trace: dough.gmane.org 1296503735 8033 80.91.229.12 (31 Jan 2011 19:55:35 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 31 Jan 2011 19:55:35 +0000 (UTC) To: 7951@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Jan 31 20:55:30 2011 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1PjzqU-0000fK-37 for geb-bug-gnu-emacs@m.gmane.org; Mon, 31 Jan 2011 20:55:30 +0100 Original-Received: from localhost ([127.0.0.1]:51653 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PjzqT-0004OX-9h for geb-bug-gnu-emacs@m.gmane.org; Mon, 31 Jan 2011 14:55:29 -0500 Original-Received: from [140.186.70.92] (port=54835 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PjzXI-0006f0-NT for bug-gnu-emacs@gnu.org; Mon, 31 Jan 2011 14:35:42 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PjzXG-0006CF-3O for bug-gnu-emacs@gnu.org; Mon, 31 Jan 2011 14:35:40 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:58443) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PjzXG-0006C5-1y for bug-gnu-emacs@gnu.org; Mon, 31 Jan 2011 14:35:38 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1Pjz1h-0003CC-Vp; Mon, 31 Jan 2011 14:03:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Alan Malloy Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 31 Jan 2011 19:03:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 7951 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.129650056812260 (code B ref -1); Mon, 31 Jan 2011 19:03:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 31 Jan 2011 19:02:48 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Pjz1S-0003Bh-7n for submit@debbugs.gnu.org; Mon, 31 Jan 2011 14:02:47 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Pjyui-00032A-HB for submit@debbugs.gnu.org; Mon, 31 Jan 2011 13:55:49 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Pjz2m-0007zc-B4 for submit@debbugs.gnu.org; Mon, 31 Jan 2011 14:04:09 -0500 Original-Received: from lists.gnu.org ([199.232.76.165]:41288) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Pjz2l-0007zY-Qm for submit@debbugs.gnu.org; Mon, 31 Jan 2011 14:04:08 -0500 Original-Received: from [140.186.70.92] (port=40450 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Pjz2i-0005rs-Nn for bug-gnu-emacs@gnu.org; Mon, 31 Jan 2011 14:04:06 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Pjz2h-0007zE-1l for bug-gnu-emacs@gnu.org; Mon, 31 Jan 2011 14:04:04 -0500 Original-Received: from mail-fx0-f41.google.com ([209.85.161.41]:64195) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Pjz2g-0007z8-N7 for bug-gnu-emacs@gnu.org; Mon, 31 Jan 2011 14:04:03 -0500 Original-Received: by fxm12 with SMTP id 12so6877604fxm.0 for ; Mon, 31 Jan 2011 11:04:01 -0800 (PST) Original-Received: by 10.223.86.12 with SMTP id q12mr5854907fal.18.1296500639349; Mon, 31 Jan 2011 11:03:59 -0800 (PST) Original-Received: from [192.168.1.18] ([38.111.148.242]) by mx.google.com with ESMTPS id l3sm915133fan.2.2011.01.31.11.03.57 (version=SSLv3 cipher=RC4-MD5); Mon, 31 Jan 2011 11:03:58 -0800 (PST) User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.13) Gecko/20101208 Thunderbird/3.1.7 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 209.85.161.41 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 199.232.76.165 X-Mailman-Approved-At: Mon, 31 Jan 2011 14:02:45 -0500 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Mon, 31 Jan 2011 14:03:01 -0500 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 140.186.70.43 X-Mailman-Approved-At: Mon, 31 Jan 2011 14:47:46 -0500 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:43791 Archived-At: This is a multi-part message in MIME format. --------------070708070302040506070000 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Steps to reproduce: 1. ssh into my machine from somewhere else 2. fire up emacs in terminal mode 3. suspend the emacs process with C-z 4. violently kill the ssh process on the other machine, so that it doesn't send a clean logout Symptoms: The emacs process remains alive on my machine, quickly climbs to 100% CPU usage, and gradually allocates more and more memory, apparently stopping at 2GB. It doesn't respond to SIGINT (kill [pid]); I have to send it a SIGKILL to get my machine back. If I strace the running process, I get the following lines repeated forever: gettimeofday({1296499016, 975065}, NULL) = 0 gettimeofday({1296499016, 975102}, NULL) = 0 gettimeofday({1296499016, 975128}, NULL) = 0 rt_sigprocmask(SIG_BLOCK, [IO], [HUP TERM IO], 8) = 0 ioctl(3, FIONREAD, [0]) = -1 EIO (Input/output error) kill(1793, SIGHUP) = 0 ioctl(3, SNDCTL_TMR_TIMEBASE or TCGETS, 0xbfc0fba8) = -1 EIO (Input/output error) ioctl(3, SNDCTL_TMR_TIMEBASE or TCGETS, 0xbfc0fb14) = -1 EIO (Input/output error) ioctl(3, SNDCTL_TMR_STOP or TCSETSW, {B0 -opost -isig -icanon -echo ...}) = -1 EIO (Input/output error) write(3, "\7", 1) = -1 EIO (Input/output error) gettimeofday({1296499016, 975503}, NULL) = 0 gettimeofday({1296499016, 975529}, NULL) = 0 gettimeofday({1296499016, 975555}, NULL) = 0 rt_sigprocmask(SIG_BLOCK, [IO], [HUP TERM IO], 8) = 0 ioctl(3, FIONREAD, [0]) = -1 EIO (Input/output error) kill(1793, SIGHUP) = 0 ioctl(3, SNDCTL_TMR_TIMEBASE or TCGETS, 0xbfc0fba8) = -1 EIO (Input/output error) FD 3 is /dev/tty, if that's relevant. In my limited experience, it looks like something weird is happening in the SIGHUP handler, possibly trying to send some data to the disconnected TTY and repeating when that causes an error. But really I've no idea, so I'll leave it at that and hope the strace is useful. I'd like to attach GDB to get a stack trace, but I didn't install from source and it would be kinda a hassle to switch unless someone tells me that will be useful. In GNU Emacs 23.1.1 (i486-pc-linux-gnu, X toolkit, Xaw3d scroll bars) of 2010-11-23 on rothera, modified by Debian Windowing system distributor `The X.Org Foundation', version 11.0.10706000 configured using `configure '--build=i486-linux-gnu' '--host=i486-linux-gnu' '--prefix=/usr' '--sharedstatedir=/var/lib' '--libexecdir=/usr/lib' '--localstatedir=/var/lib' '--infodir=/usr/share/info' '--mandir=/usr/share/man' '--with-pop=yes' '--enable-locallisppath=/etc/emacs23:/etc/emacs:/usr/local/share/emacs/23.1/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/23.1/site-lisp:/usr/share/emacs/site-lisp:/usr/share/emacs/23.1/leim' '--with-x=yes' '--with-x-toolkit=lucid' '--with-toolkit-scroll-bars' 'build_alias=i486-linux-gnu' 'host_alias=i486-linux-gnu' 'CFLAGS=-DDEBIAN -g -O2' 'LDFLAGS=-g' 'CPPFLAGS='' 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: en_US.UTF-8 value of $XMODIFIERS: nil locale-coding-system: utf-8-unix default-enable-multibyte-characters: t Major mode: Lisp Interaction Minor modes in effect: global-auto-complete-mode: t auto-complete-mode: t delete-selection-mode: t tooltip-mode: t tool-bar-mode: t mouse-wheel-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t global-auto-composition-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t column-number-mode: t line-number-mode: t transient-mark-mode: t Recent input: C-x k Recent messages: Loading /etc/emacs/site-start.d/50emacs-goodies-el.el (source)...done Loading /etc/emacs/site-start.d/50git-core.el (source)...done Loading /etc/emacs/site-start.d/50psvn.el (source)...done Loading /etc/emacs/site-start.d/50slime.el (source)... Loading /usr/share/emacs23/site-lisp/slime/slime-autoloads...done Loading /etc/emacs/site-start.d/50slime.el (source)...done Loading delsel...done Loading /home/akm/.emacs.d/elpa/package.el (source)...done Loading /home/akm/src/clojure/cdt/ide/emacs/cdt.el (source)...done For information about GNU Emacs and the GNU system, type C-h C-a. [2 times] -- ------------------------------------------------------------------------ Alan Malloy HubPages software engineer 415-273-9702 alan.malloy@yieldbuild.com --------------070708070302040506070000 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Steps to reproduce:

1. ssh into my machine from somewhere else

2. fire up emacs in terminal mode

3. suspend the emacs process with C-z

4. violently kill the ssh process on the other machine, so that it
doesn't send a clean logout

Symptoms:

The emacs process remains alive on my machine, quickly climbs to 100%
CPU usage, and gradually allocates more and more memory, apparently
stopping at 2GB. It doesn't respond to SIGINT (kill [pid]); I have to
send it a SIGKILL to get my machine back. If I strace the running
process, I get the following lines repeated forever:

gettimeofday({1296499016, 975065}, NULL) = 0
gettimeofday({1296499016, 975102}, NULL) = 0
gettimeofday({1296499016, 975128}, NULL) = 0
rt_sigprocmask(SIG_BLOCK, [IO], [HUP TERM IO], 8) = 0
ioctl(3, FIONREAD, [0]) = -1 EIO (Input/output error)
kill(1793, SIGHUP) = 0
ioctl(3, SNDCTL_TMR_TIMEBASE or TCGETS, 0xbfc0fba8) = -1 EIO (Input/output error)
ioctl(3, SNDCTL_TMR_TIMEBASE or TCGETS, 0xbfc0fb14) = -1 EIO (Input/output error)
ioctl(3, SNDCTL_TMR_STOP or TCSETSW, {B0 -opost -isig -icanon -echo ...}) = -1 EIO (Input/output error)
write(3, "\7", 1) = -1 EIO (Input/output error)
gettimeofday({1296499016, 975503}, NULL) = 0
gettimeofday({1296499016, 975529}, NULL) = 0
gettimeofday({1296499016, 975555}, NULL) = 0
rt_sigprocmask(SIG_BLOCK, [IO], [HUP TERM IO], 8) = 0
ioctl(3, FIONREAD, [0]) = -1 EIO (Input/output error)
kill(1793, SIGHUP) = 0
ioctl(3, SNDCTL_TMR_TIMEBASE or TCGETS, 0xbfc0fba8) = -1 EIO (Input/output error)

FD 3 is /dev/tty, if that's relevant. In my limited experience, it
looks like something weird is happening in the SIGHUP handler,
possibly trying to send some data to the disconnected TTY and
repeating when that causes an error. But really I've no idea, so I'll
leave it at that and hope the strace is useful. I'd like to attach GDB
to get a stack trace, but I didn't install from source and it would be
kinda a hassle to switch unless someone tells me that will be useful.


In GNU Emacs 23.1.1 (i486-pc-linux-gnu, X toolkit, Xaw3d scroll bars)
 of 2010-11-23 on rothera, modified by Debian
Windowing system distributor `The X.Org Foundation', version 11.0.10706000
configured using `configure  '--build=i486-linux-gnu' '--host=i486-linux-gnu' '--prefix=/usr' '--sharedstatedir=/var/lib' '--libexecdir=/usr/lib' '--localstatedir=/var/lib' '--infodir=/usr/share/info' '--mandir=/usr/share/man' '--with-pop=yes' '--enable-locallisppath=/etc/emacs23:/etc/emacs:/usr/local/share/emacs/23.1/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/23.1/site-lisp:/usr/share/emacs/site-lisp:/usr/share/emacs/23.1/leim' '--with-x=yes' '--with-x-toolkit=lucid' '--with-toolkit-scroll-bars' 'build_alias=i486-linux-gnu' 'host_alias=i486-linux-gnu' 'CFLAGS=-DDEBIAN -g -O2' 'LDFLAGS=-g' 'CPPFLAGS=''

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: en_US.UTF-8
  value of $XMODIFIERS: nil
  locale-coding-system: utf-8-unix
  default-enable-multibyte-characters: t

Major mode: Lisp Interaction

Minor modes in effect:
  global-auto-complete-mode: t
  auto-complete-mode: t
  delete-selection-mode: t
  tooltip-mode: t
  tool-bar-mode: t
  mouse-wheel-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  global-auto-composition-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-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> <help-echo> <help-echo> <help-echo> <help-echo>
<help-echo> <help-echo> <help-echo> <help-echo> <help-echo>
<help-echo> <help-echo> <menu-bar> <help-menu> <about-emacs>
<help-echo> C-x k <return> <help-echo> <help-echo>
<help-echo> <help-echo> <help-echo> <help-echo> <menu-bar>
<help-menu> <send-emacs-bug-report>

Recent messages:
Loading /etc/emacs/site-start.d/50emacs-goodies-el.el (source)...done
Loading /etc/emacs/site-start.d/50git-core.el (source)...done
Loading /etc/emacs/site-start.d/50psvn.el (source)...done
Loading /etc/emacs/site-start.d/50slime.el (source)...
Loading /usr/share/emacs23/site-lisp/slime/slime-autoloads...done
Loading /etc/emacs/site-start.d/50slime.el (source)...done
Loading delsel...done
Loading /home/akm/.emacs.d/elpa/package.el (source)...done
Loading /home/akm/src/clojure/cdt/ide/emacs/cdt.el (source)...done
For information about GNU Emacs and the GNU system, type C-h C-a. [2 times]

--

Alan Malloy
HubPages software engineer
415-273-9702
alan.malloy@yieldbuild.com
--------------070708070302040506070000--