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: Wed, 28 May 2014 22:53:46 +0200 Message-ID: <20140528225346.227e166d@forcix.jorgenschaefer.de> References: <537F773C.8060202@cs.ucla.edu> <20140523184419.70fe136d@forcix.jorgenschaefer.de> <538124C0.8080107@cs.ucla.edu> <20140525095735.6cfac9af@forcix.jorgenschaefer.de> <53837516.3070508@cs.ucla.edu> <20140526204952.1dba664e@forcix.jorgenschaefer.de> <5383D535.2000407@cs.ucla.edu> <20140527202756.7bade0ce@forcix.jorgenschaefer.de> <538506AB.3090201@cs.ucla.edu> <20140528001641.190b7ada@forcix.jorgenschaefer.de> <5385322D.7030406@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 1401310468 9487 80.91.229.3 (28 May 2014 20:54:28 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 28 May 2014 20:54:28 +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 Wed May 28 22:54: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 1Wpkra-00025Z-DF for geb-bug-gnu-emacs@m.gmane.org; Wed, 28 May 2014 22:54:18 +0200 Original-Received: from localhost ([::1]:44880 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wpkra-0005Gy-5A for geb-bug-gnu-emacs@m.gmane.org; Wed, 28 May 2014 16:54:18 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:40622) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WpkrQ-0005Fd-QO for bug-gnu-emacs@gnu.org; Wed, 28 May 2014 16:54:14 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WpkrK-00008i-Nh for bug-gnu-emacs@gnu.org; Wed, 28 May 2014 16:54:08 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:35981) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WpkrK-00008V-Kf for bug-gnu-emacs@gnu.org; Wed, 28 May 2014 16:54:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1WpkrK-0006Nz-1G for bug-gnu-emacs@gnu.org; Wed, 28 May 2014 16:54: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: Wed, 28 May 2014 20:54:01 +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.140131043424533 (code B ref 17561); Wed, 28 May 2014 20:54:01 +0000 Original-Received: (at 17561) by debbugs.gnu.org; 28 May 2014 20:53:54 +0000 Original-Received: from localhost ([127.0.0.1]:34858 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WpkrC-0006Nc-4v for submit@debbugs.gnu.org; Wed, 28 May 2014 16:53:54 -0400 Original-Received: from loki.jorgenschaefer.de ([87.230.15.51]:47430) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Wpkr9-0006NO-7g for 17561@debbugs.gnu.org; Wed, 28 May 2014 16:53:52 -0400 Original-Received: by loki.jorgenschaefer.de (Postfix, from userid 998) id A43C7202230; Wed, 28 May 2014 22:53:49 +0200 (CEST) Original-Received: from forcix.jorgenschaefer.de (port-5054.pppoe.wtnet.de [84.46.19.209]) by loki.jorgenschaefer.de (Postfix) with ESMTPSA id A6CE8202222; Wed, 28 May 2014 22:53:47 +0200 (CEST) In-Reply-To: <5385322D.7030406@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:89642 Archived-At: On Tue, 27 May 2014 17:47:41 -0700 Paul Eggert wrote: > I'm still suspicious of the interaction between pthread_sigmask and > vfork, though. What happens if you do the following shell session, > where "$" is the shell prompt and "(gdb)" is the GDB prompt? Assuming you meant in an Emacs with vfork enabled (i.e. the default): > $ grep -i pthread src/config.h /* Define to 1 if you have pthread (-lpthread). */ #define HAVE_PTHREAD 1 /* Define to 1 if you have the header file. */ #define HAVE_PTHREAD_H 1 /* Define to 1 if the pthread_sigmask function can be used (despite bugs). */ /* #undef HAVE_PTHREAD_SIGMASK */ /* Define to 1 if pthread_sigmask(), when it fails, returns -1 and sets errno. /* #undef PTHREAD_SIGMASK_FAILS_WITH_ERRNO */ /* Define to 1 if pthread_sigmask() may returns 0 and have no effect. */ /* #undef PTHREAD_SIGMASK_INEFFECTIVE */ /* Define to 1 if pthread_sigmask() unblocks signals incorrectly. */ /* #undef PTHREAD_SIGMASK_UNBLOCK_BUG */ #define PTY_TTY_NAME_SPRINTF { char *ptyname = 0; sigset_t blocked; sigemptyset (&blocked); sigaddset (&blocked, SIGCHLD); pthread_sigmask (SIG_BLOCK, &blocked, 0); if (grantpt (fd) != -1 && unlockpt (fd) != -1) ptyname = ptsname(fd); pthread_sigmask (SIG_UNBLOCK, &blocked, 0); if (!ptyname) { emacs_close (fd); return -1; } snprintf (pty_name, PTY_NAME_SIZE, "%s", ptyname); } #ifndef _POSIX_PTHREAD_SEMANTICS # define _POSIX_PTHREAD_SEMANTICS 1 > $ ldd src/bootstrap-emacs | grep -i pthread libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f0c1cf79000) > $ gdb src/bootstrap-emacs > (gdb) disas rpl_pthread_sigmask No symbol "rpl_pthread_sigmask" in current context. > (gdb) disas pthread_sigmask Dump of assembler code for function pthread_sigmask: 0x00000000005642c0 <+0>: sub $0x8,%rsp 0x00000000005642c4 <+4>: callq 0x405790 0x00000000005642c9 <+9>: xor %edx,%edx 0x00000000005642cb <+11>: test %eax,%eax 0x00000000005642cd <+13>: jns 0x5642d6 0x00000000005642cf <+15>: callq 0x405a10 <__errno_location@plt> 0x00000000005642d4 <+20>: mov (%rax),%edx 0x00000000005642d6 <+22>: mov %edx,%eax 0x00000000005642d8 <+24>: add $0x8,%rsp 0x00000000005642dc <+28>: retq End of assembler dump. > (gdb) disas rpl_vfork No symbol "rpl_vfork" in current context. > (gdb) disas vfork Dump of assembler code for function vfork@plt: 0x0000000000405ed0 <+0>: jmpq *0x39e662(%rip) # 0x7a4538 0x0000000000405ed6 <+6>: pushq $0xfc 0x0000000000405edb <+11>: jmpq 0x404f00 End of assembler dump. > (gdb) disas rpl_fork No symbol "rpl_fork" in current context. > (gdb) disas fork Dump of assembler code for function fork@plt: 0x0000000000405cb0 <+0>: jmpq *0x39e772(%rip) # 0x7a4428 0x0000000000405cb6 <+6>: pushq $0xda 0x0000000000405cbb <+11>: jmpq 0x404f00 End of assembler dump. Regards, Jorgen