From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Jorgen Schaefer Newsgroups: gmane.emacs.bugs Subject: bug#17561: Emacs can forget processes Date: Sun, 25 May 2014 09:57:35 +0200 Message-ID: <20140525095735.6cfac9af@forcix.jorgenschaefer.de> References: <537F773C.8060202@cs.ucla.edu> <20140523184419.70fe136d@forcix.jorgenschaefer.de> <538124C0.8080107@cs.ucla.edu> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1401004707 23169 80.91.229.3 (25 May 2014 07:58:27 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 25 May 2014 07:58:27 +0000 (UTC) Cc: 17561@debbugs.gnu.org To: Paul Eggert Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun May 25 09:58:20 2014 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1WoTJy-0000Qx-U7 for geb-bug-gnu-emacs@m.gmane.org; Sun, 25 May 2014 09:58:19 +0200 Original-Received: from localhost ([::1]:50627 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WoTJy-0002rZ-EJ for geb-bug-gnu-emacs@m.gmane.org; Sun, 25 May 2014 03:58:18 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:36253) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WoTJp-0002rQ-5X for bug-gnu-emacs@gnu.org; Sun, 25 May 2014 03:58:15 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WoTJj-0005L6-7G for bug-gnu-emacs@gnu.org; Sun, 25 May 2014 03:58:09 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:60690) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WoTJj-0005L2-4E for bug-gnu-emacs@gnu.org; Sun, 25 May 2014 03:58:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1WoTJi-0006Ep-E2 for bug-gnu-emacs@gnu.org; Sun, 25 May 2014 03:58:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Jorgen Schaefer Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 25 May 2014 07:58:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 17561 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 17561-submit@debbugs.gnu.org id=B17561.140100466323936 (code B ref 17561); Sun, 25 May 2014 07:58:02 +0000 Original-Received: (at 17561) by debbugs.gnu.org; 25 May 2014 07:57:43 +0000 Original-Received: from localhost ([127.0.0.1]:59567 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WoTJO-0006E0-ML for submit@debbugs.gnu.org; Sun, 25 May 2014 03:57:43 -0400 Original-Received: from loki.jorgenschaefer.de ([87.230.15.51]:51138) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WoTJL-0006Do-QL for 17561@debbugs.gnu.org; Sun, 25 May 2014 03:57:41 -0400 Original-Received: by loki.jorgenschaefer.de (Postfix, from userid 998) id 1F1FF2029E2; Sun, 25 May 2014 09:57:37 +0200 (CEST) Original-Received: from forcix.jorgenschaefer.de (port-9910.pppoe.wtnet.de [84.46.38.220]) by loki.jorgenschaefer.de (Postfix) with ESMTPSA id 43737202226; Sun, 25 May 2014 09:57:36 +0200 (CEST) In-Reply-To: <538124C0.8080107@cs.ucla.edu> X-Mailer: Claws Mail 3.9.3 (GTK+ 2.24.23; i486-pc-linux-gnu) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 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: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:89479 Archived-At: On Sat, 24 May 2014 16:01:20 -0700 Paul Eggert wrote: > Jorgen Schaefer wrote: > > >> Can you run the shell command 'strace -p' on an Emacs with the > >> problem, and trace the system calls near the offending area? > > > > The bug report includes an strace output. Emacs does the pselect6 > > call > > Sorry, I should have been more specific. It'd be nice to see the > strace output for when you run start-process in a temp buffer, not > for later when Emacs is in a tight loop. Oh, my bad. Luckily, the bug just occurred again (it's really non- deterministic): strace -fttT output The trace starts with a number of these triplets, which seem to be "Emacs behaving normally". After terminating the process and returning to "normal" later, Emacs does not issue these rt_sigprocmask calls anymore, though. 16300 09:41:27.072717 pselect6(20, [3 4 5 6 8 10 14 15 19], [], NULL, {0, 176410474}, {NULL, 8}) = 0 (Timeout) <0.176635> 16300 09:41:27.249649 rt_sigprocmask(SIG_BLOCK, [WINCH IO], NULL, 8) = 0 <0.000011> 16300 09:41:27.249881 rt_sigprocmask(SIG_UNBLOCK, [WINCH IO], NULL, 8) = 0 <0.000010> Then there's a large bunch of syscalls related to my command to restart the process, with the "\r" now being me sending the M-x command: 16300 09:41:28.298391 read(3, "\r", 1) = 1 <0.000012> 16300 09:41:28.298438 ioctl(3, FIONREAD, [0]) = 0 <0.000009> 16300 09:41:28.298480 ioctl(3, FIONREAD, [0]) = 0 <0.000009> 16300 09:41:28.312476 write(3, "\r", 1) = 1 <0.000021> 16300 09:41:28.317392 kill(4294953129, SIGHUP) = 0 <0.002235> 16300 09:41:28.321642 rt_sigprocmask(SIG_BLOCK, [WINCH IO], NULL, 8) = 0 <0.000017> 16300 09:41:28.321841 write(3, "\33[K\33[H\n\n", 8) = 8 <0.000018> 16300 09:41:28.321909 rt_sigprocmask(SIG_UNBLOCK, [WINCH IO], NULL, 8) = 0 <0.000012> 16300 09:41:28.321975 --- SIGIO (I/O possible) @ 0 (0) --- 16300 09:41:28.322004 rt_sigreturn(0x1d) = 0 <0.000013> 16300 09:41:28.322056 ioctl(3, FIONREAD, [0]) = 0 <0.000014> 16300 09:41:28.322183 ioctl(3, FIONREAD, [0]) = 0 <0.000012> 16300 09:41:28.322253 pselect6(20, [3 4 5 6 8 10 14 15 19], [], NULL, {0, 499801124}, {NULL, 8}) = 1 (in [15], left {0, 499788244}) <0.000024> 16300 09:41:28.322337 read(15, "", 4096) = 0 <0.000012> 16300 09:41:28.322475 ioctl(3, FIONREAD, [0]) = 0 <0.000014> 16300 09:41:28.322533 pselect6(20, [3 4 5 6 8 10 14 15 19], [], NULL, {0, 499519197}, {NULL, 8}) = 1 (in [15], left {0, 499513475}) <0.000017> 16300 09:41:28.322603 read(15, "", 4096) = 0 <0.000010> Killing the process via the process list (hence the "d"): 16300 09:49:00.151571 read(3, "d", 1) = 1 <0.000009> 16300 09:49:00.151604 ioctl(3, FIONREAD, [0]) = 0 <0.000007> 16300 09:49:00.151636 ioctl(3, FIONREAD, [0]) = 0 <0.000006> 16300 09:49:00.151790 rt_sigprocmask(SIG_BLOCK, [CHLD], [QUIT ALRM CHLD PROF], 8) = 0 <0.000020> 16300 09:49:00.151849 kill(4294953129, SIGKILL) = 0 <0.000013> 16300 09:49:00.151896 rt_sigprocmask(SIG_SETMASK, [QUIT ALRM CHLD PROF], NULL, 8) = 0 <0.000007> 16300 09:49:00.151964 close(12) = 0 <0.000015> 16300 09:49:00.152003 close(15) = 0 <0.000010> 16300 09:49:00.153389 rt_sigprocmask(SIG_BLOCK, [WINCH IO], NULL, 8) = 0 <0.000010> 16300 09:49:00.153531 rt_sigprocmask(SIG_UNBLOCK, [WINCH IO], NULL, 8) = 0 <0.000008> > > read(2) returning 0 indicates an EOF (which pselect6 indicates as > > waiting input), I suspect there could at least be a sanity check > > here to close the file descriptors instead of continuously polling. > > Maybe, though I worry that might mask the bug and might cause other, > more serious failures down the road. It'd be nicer to fix the actual > bug, if we can figure out what it is. > > For what it's worth I tried reproducing the bug with emacs-24 'emacs > -Q' on Fedora, using your recipe, but this didn't have a problem. I > ran it 1000 times rapidly in sequence and it was OK. I ran it 10000 > times and ran out of file descriptors but that's to be expected. Yes, the bug is really random. I have not been able to intentionally reproduce it. It just happens once in a while. Until this bug report, I wasn't even sure what was causing my Emacs to stop responding in the first place. It just happened, once every few days, that Emacs suddenly becomes very sluggish. My Emacs sessions usually have a number of processes open. When the bug showed up just now, it was five processes and three network connections, for example. I'm not sure if that's related. Regards, Jorgen