From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: michael.cadilhac@lrde.org (=?iso-8859-1?Q?Micha=EBl?= Cadilhac) Newsgroups: gmane.emacs.devel Subject: Re: delete-process bug Date: Sat, 27 May 2006 11:19:58 +0200 Organization: Epita/LRDE Message-ID: <87odxjakox.fsf@lrde.org> References: <87k69eyddj.fsf@lrde.org> <87fyj0r41g.fsf@lrde.org> <20060524112846.GA12046@agmartin.aq.upm.es> <87bqtmjrsh.fsf_-_@lrde.org> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0602329755==" X-Trace: sea.gmane.org 1148721596 28826 80.91.229.2 (27 May 2006 09:19:56 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sat, 27 May 2006 09:19:56 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat May 27 11:19:53 2006 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1Fjuxb-0008Gc-Oe for ged-emacs-devel@m.gmane.org; Sat, 27 May 2006 11:19:52 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Fjuxa-0001kc-Qn for ged-emacs-devel@m.gmane.org; Sat, 27 May 2006 05:19:50 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1FjuxO-0001kU-Sq for emacs-devel@gnu.org; Sat, 27 May 2006 05:19:38 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1FjuxN-0001k6-4x for emacs-devel@gnu.org; Sat, 27 May 2006 05:19:38 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FjuxN-0001k2-0V for emacs-devel@gnu.org; Sat, 27 May 2006 05:19:37 -0400 Original-Received: from [62.39.139.2] (helo=kualalumpur.lrde.epita.fr) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA:32) (Exim 4.52) id 1Fjv2S-0002Zo-6J for emacs-devel@gnu.org; Sat, 27 May 2006 05:24:52 -0400 Original-Received: from mahaena.lrde.epita.fr ([192.168.101.66] helo=mahaena.lrde) by kualalumpur.lrde.epita.fr with esmtp (Exim 4.50) id 1FjuxK-0004o2-6x; Sat, 27 May 2006 11:19:34 +0200 Original-To: Michael Mauger Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAElBMVEU/JREXDATg1LV8UCao i1fQpmoP3Nd6AAACa0lEQVQ4jWWUQW7jMAxFqZEPICJzAjXeM6W8dyNqX9ji/a8yn04xnWIEJLD9 LJH85DcJFyJV3erqPty8ExHfBikXSdn0WVezC0hOAQiA2nCsAHOqEnPe4k+puU8zw/t+xquqjRKA 4lHsmQBT8C5pDtBwfwH8VdcHI5+FHtjRxrQRwZsf3hNjZRKAPEzHEdH9mFNSYb5dQK3r8KM6ftNy KikAirDZFWdVkDqbxjGFbAcwbQCxxc8mPRHUGOcCIMgMACV23RfJTch3gC6ofT3qCdG0NyUUPfYF yQrKCIAnuYsgX2qPzW2i9sNrfSOSPPZQiygtCNlCjlpXJV38lIKshF/AZzsAMoArdCKNHfXukPuJ ImbLh+9J2gXwap0QpZ7NjZ7ekdkFcDiqPiLGcHmuvaG/AHgy62s52Lae1ABoA7D6d2kDoAvgbnyD ZutEd6lTHOXfYPHVJDH1K8a1+oyrjoZpAGn1x5pfwPr2E9yjxSpk50/gEyKgD/+BD/KzN3tQ13b8 Cx5loF0AgnZf5IUny9hRHQOYBllHDM+6s3oviZBu77mFjDm621Np3hkjR90wE1BkTYvhdDgDgCmR xWChFfcYAOqMm5NZkVWMur8AL5+oeMQOob2FmY76FiM+PrDDZypwGdqokSlAaQOmGH6mW8KpsOwl 0YOLedjSITr6scNRF8D4PesH33QmLrx8AzjpV/3kkg025w2gfAFYKCLluJAc4Ap+h18oo4S8wzaY klDsBUTiY8EZFkg5Iass75FubC9wd8qa0u9+gRxAsAKEaRAo6iB+vwCMGmdBjvgidQGA1ntMX4CS ZYGV/wADyL80LIX/UAAAAABJRU5ErkJggg== In-Reply-To: (Michael Mauger's message of "Fri, 26 May 2006 17:27:36 +0000 (UTC)") User-Agent: Gnus/5.110006 (No Gnus v0.6) Emacs/22.0.50 (gnu/linux) 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:55356 Archived-At: --===============0602329755== Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" --=-=-= Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Michael Mauger writes: > Stefan Monnier iro.umontreal.ca> writes: > >>=20 >> > Thanks for working on this. I agree that `live_deleted_processes' >> > is a good name. ("Zombie process" has a different meaning.) >>=20 >> > However, maybe there is still a race condition. Suppose the signal >> > comes in the middle of the line >>=20 >> > + live_deleted_processes =3D Fcons (make_number (p->pid), >> > + /* GC previous elements. */ >> > + Fdelq (Qnil,=20 > live_deleted_processes)); >>=20 >> > Suppose it comes between there and the call to remove_process? >>=20 >> I think it's OK: if the signal handler comes before the assignment to >> live_deleted_processes, then it'll all behave as if the signal came even >> before the call to delete-process. If it comes afterwards, the signal w= ill >> be ignored (as if it came after the call to delete-process). >>=20 >> > Does the right thing happen in all these cases? >>=20 >> I believe so. >>=20 > > My instinct would be to add the pid to the list prior to causing the even= t that=20 > the list is designed to detect. Treating the signal as though it happene= d=20 > before the call to delete-process (if we don't add the pid to the list fi= rst)=20 > when we know it was most likely caused by delete-process seems to be aski= ng for=20 > trouble. Sounds better, indeed. However, no race condition could have happened because of a (more) simple thing (than what I said): The race condition appears when 1) Emacs got a SIGCHLD 2) and the process has been suppressed from process_list. But the deletion from process_list is made _after_ the adding to live_deleted_processes. So no problem here, I think, the process is always known (so not supposed to be a synchronous one). If something has to be put in comment to say that no race condition is triggered, I think something like the following is OK: ``A race condition occurred when the deleted process was no longer in process_list but still had a SIGCHLD treatment to do. Now, the deleted process is never thought to be asynchronous.'' Regards =2D-=20 | Micha=EBl `Micha' Cadilhac | Le copillage-collage = | | Epita/LRDE Promo 2007 | tue le programmeur. = | | http://www.lrde.org/~cadilh_m | -- Dictons LRDE = | `-- - JID: micha@amessage.be --' - -= -' --=-=-= Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2 (GNU/Linux) iD8DBQFEeBnBZYNf4qobZ7kRAoKrAKCFhJ14bEBC89c9n6zZFAokWeJgvgCfSxzd K7Hbq1TRwOLbEgVIogIV/T4= =d9YK -----END PGP SIGNATURE----- --=-=-=-- --===============0602329755== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Emacs-devel mailing list Emacs-devel@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-devel --===============0602329755==--