From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Paul Eggert Newsgroups: gmane.emacs.bugs Subject: bug#17561: Emacs can forget processes Date: Tue, 27 May 2014 14:42:03 -0700 Organization: UCLA Computer Science Department Message-ID: <538506AB.3090201@cs.ucla.edu> 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> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------030604030204030708010002" X-Trace: ger.gmane.org 1401227189 22765 80.91.229.3 (27 May 2014 21:46:29 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 27 May 2014 21:46:29 +0000 (UTC) Cc: 17561@debbugs.gnu.org To: Jorgen Schaefer Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue May 27 23:46:22 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 1WpPCM-0006NG-8f for geb-bug-gnu-emacs@m.gmane.org; Tue, 27 May 2014 23:46:18 +0200 Original-Received: from localhost ([::1]:38311 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WpPCL-0001xz-UT for geb-bug-gnu-emacs@m.gmane.org; Tue, 27 May 2014 17:46:17 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:34766) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WpP9I-0007Jb-Df for bug-gnu-emacs@gnu.org; Tue, 27 May 2014 17:43:13 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WpP9C-0007Iu-Vi for bug-gnu-emacs@gnu.org; Tue, 27 May 2014 17:43:08 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:34869) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WpP9C-0007If-TI for bug-gnu-emacs@gnu.org; Tue, 27 May 2014 17:43:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1WpP9C-0001RS-JA for bug-gnu-emacs@gnu.org; Tue, 27 May 2014 17:43:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Paul Eggert Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 27 May 2014 21:43: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.14012269395486 (code B ref 17561); Tue, 27 May 2014 21:43:02 +0000 Original-Received: (at 17561) by debbugs.gnu.org; 27 May 2014 21:42:19 +0000 Original-Received: from localhost ([127.0.0.1]:33746 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WpP8U-0001QP-Fa for submit@debbugs.gnu.org; Tue, 27 May 2014 17:42:18 -0400 Original-Received: from smtp.cs.ucla.edu ([131.179.128.62]:52636) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WpP8R-0001Q7-7C for 17561@debbugs.gnu.org; Tue, 27 May 2014 17:42:16 -0400 Original-Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp.cs.ucla.edu (Postfix) with ESMTP id 42C9AA60012; Tue, 27 May 2014 14:42:08 -0700 (PDT) X-Virus-Scanned: amavisd-new at smtp.cs.ucla.edu Original-Received: from smtp.cs.ucla.edu ([127.0.0.1]) by localhost (smtp.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id bzsTyJ4QcsIz; Tue, 27 May 2014 14:42:03 -0700 (PDT) Original-Received: from penguin.cs.ucla.edu (Penguin.CS.UCLA.EDU [131.179.64.200]) by smtp.cs.ucla.edu (Postfix) with ESMTPSA id 92F65A60010; Tue, 27 May 2014 14:42:03 -0700 (PDT) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0 In-Reply-To: <20140527202756.7bade0ce@forcix.jorgenschaefer.de> 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:89580 Archived-At: This is a multi-part message in MIME format. --------------030604030204030708010002 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 05/27/2014 11:27 AM, Jorgen Schaefer wrote: > Should that be ac_cv_func_vfork_works=no? Yes, thanks for fixing the typo in my earlier message. > The strace is from an OpenVZ virtual host Perhaps OpenVZ is contributing to the problem? There are or were relevant bugs in its implementation of vfork; e.g., see . > I have no[w] recompiled Emacs > with the latter change, and it's using clone(2) to execute processes, > which sounds right. I haven't been able to reproduce the bug so far So far, so good anyway. That's the good news. However, some bad news: on some platforms strace is reportedly buggy in this area, and can cause vfork to misbehave even if vfork works correctly when it's not being straced. Please see . If we have found the problem, I'd like to modify Emacs to avoid the kernel bug. Let's start by trying to build a dynamic test for it. Can you please build and run the attached program, and see whether you can get it to output the message "vfork bug detected" on your platform? Please compile it with the same compiler and flags that you use to compile Emacs. You may need to invoke the test program with arguments, e.g., "./a.out 100 10000" to try the test 100 times with a delay of 10,000 nanoseconds. The goal is to detect the vfork bug as quickly as possible, so if you can detect it it'd be nice to see how small we can make the delay. You might also try to run the test program under strace to see whether that changes things. Thanks. --------------030604030204030708010002 Content-Type: text/plain; charset=UTF-8; name="vfork-test.c" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="vfork-test.c" I2luY2x1ZGUgPHN0ZGlvLmg+CiNpbmNsdWRlIDxzdGRsaWIuaD4KI2luY2x1ZGUgPHN5cy9z ZWxlY3QuaD4KI2luY2x1ZGUgPHN5cy93YWl0Lmg+CiNpbmNsdWRlIDx1bmlzdGQuaD4KCmlu dAptYWluIChpbnQgYXJnYywgY2hhciAqKmFyZ3YpCnsKICBpbnQgdGVzdF9jYXNlX2NvdW50 ID0gYXJnYyA8IDIgPyAxMDAwMDogYXRvaSAoYXJndlsxXSk7CiAgaW50IGRlbGF5X2luX25h bm9zZWNvbmRzID0gYXJnYyA8IDMgPyAxMDAwIDogYXRvaSAoYXJndlsyXSk7CiAgaW50IGk7 CiAgZm9yIChpID0gMDsgaSA8IHRlc3RfY2FzZV9jb3VudDsgaSsrKQogICAgewogICAgICBw aWRfdCBwID0gdmZvcmsgKCk7CiAgICAgIGludCBvayA9IDA7CiAgICAgIGludCB2b2xhdGls ZSBjaGlsZF9zdGF0dXMgPSAwOwogICAgICBpZiAocCA8IDApCgl7CgkgIHBlcnJvciAoInZm b3JrIik7CgkgIHJldHVybiAyOwoJfQogICAgICBpZiAocCA9PSAwKQoJewoJICBzdHJ1Y3Qg dGltZXNwZWMgdGltZW91dDsKCSAgdGltZW91dC50dl9zZWMgPSAwOwoJICB0aW1lb3V0LnR2 X25zZWMgPSBkZWxheV9pbl9uYW5vc2Vjb25kczsKCSAgcHNlbGVjdCAoMCwgMCwgMCwgMCwg JnRpbWVvdXQsIDApOwoJICBfZXhpdCAoY2hpbGRfc3RhdHVzKTsKCX0KICAgICAgaWYgKHAg PiAwKQoJewoJICBpbnQgc3RhdHVzOwoJICBjaGlsZF9zdGF0dXMgPSAxOwoJICBpZiAod2Fp dHBpZCAocCwgJnN0YXR1cywgMCkgPT0gcAoJICAgICAgJiYgV0lGRVhJVEVEIChzdGF0dXMp ICYmIHN0YXR1cyA9PSAwKQoJICAgIG9rID0gMTsKCSAgaWYgKCFvaykKCSAgICB7CgkgICAg ICBwcmludGYgKCJ2Zm9yayBidWcgZGV0ZWN0ZWRcbiIpOwoJICAgICAgcmV0dXJuIDE7Cgkg ICAgfQoJfQogICAgfQogIHJldHVybiAwOwp9Cg== --------------030604030204030708010002--