From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.devel Subject: Re: grep-use-null-device Date: Wed, 31 Aug 2005 09:02:22 +0300 Organization: JURTA Message-ID: <87mzmy1wmh.fsf@jurta.org> References: <87ll2kiczv.fsf@jurta.org> <878xyiyh2n.fsf-monnier+emacs@gnu.org> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1125469972 10596 80.91.229.2 (31 Aug 2005 06:32:52 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 31 Aug 2005 06:32:52 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Aug 31 08:32:51 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1EAM99-0001ly-ST for ged-emacs-devel@m.gmane.org; Wed, 31 Aug 2005 08:32:32 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EAMDJ-0003zK-9L for ged-emacs-devel@m.gmane.org; Wed, 31 Aug 2005 02:36:49 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1EAM0s-0008TJ-9G for emacs-devel@gnu.org; Wed, 31 Aug 2005 02:23:58 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1EAM0p-0008ST-Ow for emacs-devel@gnu.org; Wed, 31 Aug 2005 02:23:57 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EAM0n-0008Js-VF for emacs-devel@gnu.org; Wed, 31 Aug 2005 02:23:54 -0400 Original-Received: from [194.126.101.98] (helo=mail.neti.ee) by monty-python.gnu.org with esmtp (Exim 4.34) id 1EALlI-0005GW-5M for emacs-devel@gnu.org; Wed, 31 Aug 2005 02:07:52 -0400 Original-Received: from mail.neti.ee (80-235-43-170-dsl.mus.estpak.ee [80.235.43.170]) by Relayhost2.neti.ee (Postfix) with ESMTP id E3B441FBF; Wed, 31 Aug 2005 09:05:02 +0300 (EEST) Original-To: Stefan Monnier In-Reply-To: <878xyiyh2n.fsf-monnier+emacs@gnu.org> (Stefan Monnier's message of "Tue, 30 Aug 2005 22:31:42 -0400") User-Agent: Gnus/5.110004 (No Gnus v0.4) Emacs/22.0.50 (gnu/linux) X-Virus-Scanned: by amavisd-new-2.2.1 (20041222) (Debian) at neti.ee X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:42516 Archived-At: >> `compilation-start' needs to check if the process is running >> before calling `process-send-eof': > > That's odd. AFAICT no blobking operation takes place between the > start-process and the process-send-eof, so the process-status should still > be `run' no matter how quickly the process exits (because Emacs shouldn't > process the SIGCHLD it receives until later). > > What am I missing? The process exits during execution of create_process. The gdb log below with a breakpoint on sigchld_handler demonstrates what really happens: Breakpoint 4, sigchld_handler (signo=17) at process.c:6249 6249 XSETINT (p->raw_status_low, u.i & 0xffff); (gdb) n 6250 XSETINT (p->raw_status_high, u.i >> 16); (gdb) n 6253 if ((WIFSIGNALED (w) || WIFEXITED (w)) (gdb) n 6260 FD_CLR (XINT (p->infd), &input_wait_mask); (gdb) n 6261 FD_CLR (XINT (p->infd), &non_keyboard_wait_mask); (gdb) p w $1 = 512 <-- WIFEXITED (gdb) bt #0 sigchld_handler (signo=17) at process.c:6261 #1 #2 0x4031f784 in sigprocmask () from /lib/libc.so.6 #3 0x0817af28 in create_process (process=141365940, new_argv=0xbfffe954, current_dir=140249731) at process.c:2153 #4 0x0817a97d in Fstart_process (nargs=5, args=0xbfffea94) at process.c:1695 ... (gdb) fr 3 #3 0x0817af28 in create_process (process=141365940, new_argv=0xbfffe954, current_dir=140249731) at process.c:2153 2153 sigprocmask (SIG_SETMASK, &procmask, 0); -- Juri Linkov http://www.jurta.org/emacs/