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#554: OSX: with-temp-buffer kills unrelated processes Date: Mon, 14 Jul 2008 19:26:52 +0900 Organization: Faculty of Science, Chiba University Message-ID: References: <20080713173957.65071954A3D@mt-computer.local> Reply-To: YAMAMOTO Mitsuharu , 554@emacsbugs.donarmstrong.com NNTP-Posting-Host: lo.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 1216032469 13734 80.91.229.12 (14 Jul 2008 10:47:49 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 14 Jul 2008 10:47:49 +0000 (UTC) To: Markus Triska , 554@emacsbugs.donarmstrong.com Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Jul 14 12:48:37 2008 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.50) id 1KILbP-0005yC-PV for geb-bug-gnu-emacs@m.gmane.org; Mon, 14 Jul 2008 12:48:20 +0200 Original-Received: from localhost ([127.0.0.1]:55233 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KILaX-0005hG-Pp for geb-bug-gnu-emacs@m.gmane.org; Mon, 14 Jul 2008 06:47:25 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KILaS-0005gu-ND for bug-gnu-emacs@gnu.org; Mon, 14 Jul 2008 06:47:20 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KILaR-0005gY-7B for bug-gnu-emacs@gnu.org; Mon, 14 Jul 2008 06:47:20 -0400 Original-Received: from [199.232.76.173] (port=41113 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KILaQ-0005gV-Uu for bug-gnu-emacs@gnu.org; Mon, 14 Jul 2008 06:47:18 -0400 Original-Received: from rzlab.ucr.edu ([138.23.92.77]:55577) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KILaQ-0002vB-C1 for bug-gnu-emacs@gnu.org; Mon, 14 Jul 2008 06:47:18 -0400 Original-Received: from rzlab.ucr.edu (rzlab.ucr.edu [127.0.0.1]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id m6EAlGHS004834; Mon, 14 Jul 2008 03:47:16 -0700 Original-Received: (from debbugs@localhost) by rzlab.ucr.edu (8.13.8/8.13.8/Submit) id m6EAZ31p001326; Mon, 14 Jul 2008 03:35:03 -0700 X-Loop: don@donarmstrong.com Resent-From: YAMAMOTO Mitsuharu Resent-To: bug-submit-list@donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Mon, 14 Jul 2008 10:35:03 +0000 Resent-Message-ID: Resent-Sender: don@donarmstrong.com X-Emacs-PR-Message: report 554 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Original-Received: via spool by 554-submit@emacsbugs.donarmstrong.com id=B554.121603122032566 (code B ref 554); Mon, 14 Jul 2008 10:35:03 +0000 Original-Received: (at 554) by emacsbugs.donarmstrong.com; 14 Jul 2008 10:27:00 +0000 Original-Received: from mathmail.math.s.chiba-u.ac.jp (mathmail.math.s.chiba-u.ac.jp [133.82.132.2]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id m6EAQrXj032560 for <554@emacsbugs.donarmstrong.com>; Mon, 14 Jul 2008 03:26:55 -0700 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 3F0532C44; Mon, 14 Jul 2008 19:26:52 +0900 (JST) In-Reply-To: <20080713173957.65071954A3D@mt-computer.local> User-Agent: Wanderlust/2.14.0 (Africa) SEMI/1.14.6 (Maruoka) FLIM/1.14.8 =?UTF-8?Q?(Shij=C7=B8)?= APEL/10.6 Emacs/23.0.50 (sparc-sun-solaris2.8) MULE/5.0 (SAKAKI) X-detected-kernel: by monty-python.gnu.org: Linux 2.6 (newer, 3) Resent-Date: Mon, 14 Jul 2008 06:47:20 -0400 X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list 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:18716 Archived-At: >>>>> On Sun, 13 Jul 2008 19:39:57 +0200 (CEST), Markus Triska said: --text follows this line-- > Let w.el consist of the following forms: > (start-process "bc1" (current-buffer) "bc") > (with-temp-buffer (start-process "bc2" (current-buffer) "bc")) > When I do "emacs -Q w.el", and press C-M-x on the first form, "bc" > (the GNU arbitrary precision calculator) is started and puts its > start-up message at the end of the buffer (you can also use any other > program that waits for further input). When I then press C-M-x on the > second form, the first process receives SIGHUP, and the message reads: > "Process bc1 hangup" > I can reproduce this with Emacs 22.2 and latest CVS on OSX. I tried to > trace it in gdb by putting a breakpoint at process_send_signal, but > couldn't reproduce it in the debugger. Otherwise it works every time. Just some analysis: not a solution I'm afraid. It seems that the child process receives SIGHUP before it calls execvp. As the child process is still running the Emacs executable, it sends SIGHUP to all the subprocesses when it receives SIGHUP (fatal_error_signal -> shut_down_emacs -> kill_buffer_processes). A similar problem can be found in following example: (process-running-child-p (start-process "bc1" (current-buffer) "bc")) => t (process-running-child-p (prog1 (start-process "bc1" (current-buffer) "bc") (sleep-for 1))) => nil I think these behaviors are not observable in other platforms, because they use vfork, and the parent side effectively blocks until the child side calls execvp or others in its typical implementations. Emacs on Darwin is using fork instead of vfork because the latter had (or have?) some problems I'm not familiar with. YAMAMOTO Mitsuharu mituharu@math.s.chiba-u.ac.jp