emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: delete-process bug


From: Michaël Cadilhac
Subject: Re: delete-process bug
Date: Thu, 25 May 2006 17:17:13 +0200
User-agent: Gnus/5.110006 (No Gnus v0.6) Emacs/22.0.50 (gnu/linux)

Stefan Monnier <address@hidden> writes:

>> This is  not really  due to my  patch. However,  it shows a  real race
>> condition in process management of Emacs:
> [...]
>> After an hour of debugging, I can propose a small change that fixes
>> this bug and lets no room for any other race condition of that kind,
>> AFAICT.
> [...]
>> +    * process.c (Fdelete_process): Wait for process termination to
>> +    avoid `sigchld_handler' to consider the process to be synchronous.
>
> I don't think it's a good idea.  The process might not die in response to
> delete-process, so we would end up waiting "indefinitely".

Well, I copied the behavior of call_process, and tried to minimize the
patch.  However, I'm  interested  in knowing  when  a process  doesn't
answer a SIGKILL? I thought it was a non-ignorable signal.

> I think in order to avoid such race-conditions without waiting for the
> process's death, we'll need to remember those processes that were deleted
> but aren't dead yet.  Of course, it goes against the docstring of
> `delete-process' which says "forget about it immediately".  But we don't
> need to keep the whole process around; just the PID should be enough, kept
> in a list of "deleted but not dead" PIDs.  See sample patch below.
>

Actually,  I did  try such  a solution,  but I  wasn't sure  where the
elements of that list should be  deleted (removed? ;-)) ; I'm not very
comfortable with making such things in a sighandler.

-- 
 |      Michaël `Micha' Cadilhac   |     Le copillage-collage               |
 |         Epita/LRDE Promo 2007   |        tue le programmeur.             |
 | http://www.lrde.org/~cadilh_m   |            -- Dictons LRDE             |
 `--  -   JID: address@hidden --'                                   -  --'

Attachment: pgpMHrex1yycB.pgp
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]