From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Steven Tamm Newsgroups: gmane.emacs.devel Subject: Re: Mac OS X: Rebuild Require after Security Update 2002-11-21 Date: Tue, 26 Nov 2002 08:31:13 -0800 Sender: emacs-devel-admin@gnu.org Message-ID: <7A6C6DA4-015C-11D7-9286-00039390AB82@mac.com> References: <200211261453.gAQErhd07777@rum.cs.yale.edu> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 (Apple Message framework v548) Content-Type: text/plain; delsp=yes; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit X-Trace: main.gmane.org 1038328433 21900 80.91.224.249 (26 Nov 2002 16:33:53 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Tue, 26 Nov 2002 16:33:53 +0000 (UTC) Cc: Andrew Choi , emacs-devel@gnu.org Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 18Giek-0005gv-00 for ; Tue, 26 Nov 2002 17:33:50 +0100 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.12 #1 (Debian)) id 18Gikv-0002C2-00 for ; Tue, 26 Nov 2002 17:40:13 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10) id 18GidK-0008MA-00; Tue, 26 Nov 2002 11:32:22 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10) id 18GicK-00084f-00 for emacs-devel@gnu.org; Tue, 26 Nov 2002 11:31:20 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10) id 18GicH-00083W-00 for emacs-devel@gnu.org; Tue, 26 Nov 2002 11:31:18 -0500 Original-Received: from smtpout.mac.com ([17.250.248.89]) by monty-python.gnu.org with esmtp (Exim 4.10) id 18GicG-00083D-00 for emacs-devel@gnu.org; Tue, 26 Nov 2002 11:31:16 -0500 Original-Received: from asmtp02.mac.com (asmtp02-qfe3 [10.13.10.66]) by smtpout.mac.com (8.12.2/MantshX 2.0) with ESMTP id gAQGVF9V022349 for ; Tue, 26 Nov 2002 08:31:15 -0800 (PST) Original-Received: from mac.com ([12.236.43.16]) by asmtp02.mac.com (Netscape Messaging Server 4.15) with ESMTP id H66Z8200.NLT; Tue, 26 Nov 2002 08:31:14 -0800 Original-To: "Stefan Monnier" In-Reply-To: <200211261453.gAQErhd07777@rum.cs.yale.edu> X-Mailer: Apple Mail (2.548) Errors-To: emacs-devel-admin@gnu.org X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.0.11 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: Emacs development discussions. List-Unsubscribe: , List-Archive: Xref: main.gmane.org gmane.emacs.devel:9687 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:9687 It doesn't cause a kernel panic on my box, it just causes the system to become totally unresponsive. The apple version of emacs includes this code around ever call to vfork. #ifndef PUMA_VFORK_ISSUES_CLEARED_UP pid = fork (); #else pid = vfork (); #endif Apparently, puma vfork issues are not cleared up, so it appears the answer is to use fork. I started to do some debugging of this issue, but the fact that after every run the computer hangs makes things quite annoying. I narrowed down the problem (I think). This code works: #include #include int main(int argc, char **argv) { pid_t parent = getpid(); pid_t child; printf("Parent pid %x\n", parent); child = vfork(); if (child < 0) { perror("vfork"); _exit(2); } if (!child) { printf("Child pid %x\n", getpid()); printf("Bad exec return %d\n", execv("/nofile/noplace", argv)); _exit(1); } return 0; } If you remove the _exit(1), it causes a nasty seg fault (it seems to blow away the entire state of the process). If you remove the _exit(1) and switch to fork() it works. So I think the problem may be with vfork not correctly cleaning up after itself if the process goes kablooy. Andrew, did you report a radar issue associated with this? A couple other people tried to switch bash to use vfork, because in later darwin releases the performance of fork seems to have gotten worse. They found similar issues with the system hanging. http://lists.apple.com/archives/darwin-kernel/2002/Oct/02/ forkexecperformance.txt -Steven >> /* The following solves the problem that Emacs hangs when evaluating >> (make-comint "test0" "/nodir/nofile" nil "") when /nodir/nofile >> does not exist. */ >> #undef HAVE_WORKING_VFORK >> #define vfork fork >> #define DONT_REOPEN_PTY >> >> I just tried removing these three lines and Emacs (in fact OS X!) >> still >> hangs when evaluating that expression. > > Does it really freeze the kernel or just the UI or just Emacs ? > If it freezes the kernel, post it to bugtraq as a DoS issue and it > should get fixed within a few days. > > > Stefan >