From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: YAMAMOTO Mitsuharu Newsgroups: gmane.emacs.bugs Subject: bug#14862: 24.3.50; Subprocess invocation hangs Date: Sun, 14 Jul 2013 18:17:32 +0900 Organization: Faculty of Science, Chiba University Message-ID: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII X-Trace: ger.gmane.org 1373793488 18162 80.91.229.3 (14 Jul 2013 09:18:08 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 14 Jul 2013 09:18:08 +0000 (UTC) To: 14862@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Jul 14 11:18:08 2013 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 1UyIRT-0002AY-L8 for geb-bug-gnu-emacs@m.gmane.org; Sun, 14 Jul 2013 11:18:07 +0200 Original-Received: from localhost ([::1]:41842 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UyIRT-0001Ee-7u for geb-bug-gnu-emacs@m.gmane.org; Sun, 14 Jul 2013 05:18:07 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:44877) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UyIRP-0001EZ-W1 for bug-gnu-emacs@gnu.org; Sun, 14 Jul 2013 05:18:05 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UyIRP-0002Eh-2q for bug-gnu-emacs@gnu.org; Sun, 14 Jul 2013 05:18:03 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:59382) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UyIRO-0002Eb-Vt for bug-gnu-emacs@gnu.org; Sun, 14 Jul 2013 05:18:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1UyIRO-00035V-Nm for bug-gnu-emacs@gnu.org; Sun, 14 Jul 2013 05:18:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: YAMAMOTO Mitsuharu Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 14 Jul 2013 09:18:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 14862 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.137379347211837 (code B ref -1); Sun, 14 Jul 2013 09:18:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 14 Jul 2013 09:17:52 +0000 Original-Received: from localhost ([127.0.0.1]:53698 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1UyIRD-00034q-Tx for submit@debbugs.gnu.org; Sun, 14 Jul 2013 05:17:52 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:43053) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1UyIRB-00034I-6X for submit@debbugs.gnu.org; Sun, 14 Jul 2013 05:17:50 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UyIR4-0002CO-Vm for submit@debbugs.gnu.org; Sun, 14 Jul 2013 05:17:43 -0400 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:41104) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UyIR4-0002CK-Sj for submit@debbugs.gnu.org; Sun, 14 Jul 2013 05:17:42 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:44765) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UyIR3-0001Cq-5W for bug-gnu-emacs@gnu.org; Sun, 14 Jul 2013 05:17:42 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UyIR1-0002Bn-Kt for bug-gnu-emacs@gnu.org; Sun, 14 Jul 2013 05:17:41 -0400 Original-Received: from mathmail.math.s.chiba-u.ac.jp ([133.82.132.2]:58606) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UyIR1-0002B4-42 for bug-gnu-emacs@gnu.org; Sun, 14 Jul 2013 05:17:39 -0400 Original-Received: from church.math.s.chiba-u.ac.jp (church [133.82.132.36]) by mathmail.math.s.chiba-u.ac.jp (Postfix) with ESMTP id 15905C055D for ; Sun, 14 Jul 2013 18:17:32 +0900 (JST) User-Agent: Wanderlust/2.14.0 (Africa) SEMI/1.14.6 (Maruoka) FLIM/1.14.8 (=?UTF-8?Q?Shij=C5=8D?=) APEL/10.6 Emacs/22.3 (sparc-sun-solaris2.8) MULE/5.0 (SAKAKI) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). 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:76344 Archived-At: The following should only be reproducible on the platforms where neither O_CLOEXEC nor O_NOINHERIT is available, such as CentOS 5 or Mac OS X <= 10.6. * Steps to reproduce 1. $ emacs -Q 2. M-x shell RET * Result Emacs hands, blocking at line 1897 in process.c: 1889 /* Wait for child_setup to complete in case that vfork is 1890 actually defined as fork. The descriptor wait_child_setup[1] 1891 of a pipe is closed at the child side either by close-on-exec 1892 on successful execve or the _exit call in child_setup. */ 1893 { 1894 char dummy; 1895 1896 emacs_close (wait_child_setup[1]); 1897 emacs_read (wait_child_setup[0], &dummy, 1); 1898 emacs_close (wait_child_setup[0]); 1899 } where wait_child_setup[] are intended to be close-on-exec: src/process.c: 1670 if (pipe2 (wait_child_setup, O_CLOEXEC) != 0) 1671 report_file_error ("Creating pipe", Qnil); But O_CLOEXEC is actually defined as 0 on the platforms where neither O_CLOEXEC nor O_NOINHERIT is available. lib/fcntl.in.h: 194 #if !defined O_CLOEXEC && defined O_NOINHERIT 195 /* Mingw spells it 'O_NOINHERIT'. */ 196 # define O_CLOEXEC O_NOINHERIT 197 #endif 198 199 #ifndef O_CLOEXEC 200 # define O_CLOEXEC 0 201 #endif As a result, the above pipe2 call does not set the close-on-exec flag for the created file descriptors. Just setting O_CLOEXEC to some non-zero value would cause another problem, because emacs_open uses it for checking its availability: src/sysdep.c: 2168 if (! O_CLOEXEC && 0 <= fd) 2169 fcntl (fd, F_SETFD, FD_CLOEXEC); YAMAMOTO Mitsuharu mituharu@math.s.chiba-u.ac.jp In GNU Emacs 24.3.50.1 (i686-pc-linux-gnu, GTK+ Version 2.10.4) of 2013-07-14 on localhost.localdomain Bzr revision: 113419 eggert@cs.ucla.edu-20130714051848-v62h26m8r874rvlf Windowing system distributor `The X.Org Foundation', version 11.0.70101000 System Description: CentOS release 5.9 (Final)