From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Delivered-To: caml-list@yquem.inria.fr Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by yquem.inria.fr (Postfix) with ESMTP id D14C0BCAB for ; Tue, 31 May 2005 21:33:09 +0200 (CEST) Received: from smtp-4.hut.fi (smtp-4.hut.fi [130.233.228.94]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id j4VJX8LI015512 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Tue, 31 May 2005 21:33:09 +0200 Received: from localhost (katosiko.hut.fi [130.233.228.115]) by smtp-4.hut.fi (8.12.10/8.12.10) with ESMTP id j4VJX6t6001313 for ; Tue, 31 May 2005 22:33:06 +0300 Received: from smtp-4.hut.fi ([130.233.228.94]) by localhost (katosiko.hut.fi [130.233.228.115]) (amavisd-new, port 10024) with LMTP id 07655-39-9 for ; Tue, 31 May 2005 22:33:06 +0300 (EEST) Received: from vipunen.hut.fi (vipunen.hut.fi [130.233.228.9]) by smtp-4.hut.fi (8.12.10/8.12.10) with ESMTP id j4VJW2J3001120 for ; Tue, 31 May 2005 22:32:02 +0300 Received: (from sliedes@localhost) by vipunen.hut.fi (8.12.10/8.12.9/Submit) id j4VJVx8q012688 for caml-list@yquem.inria.fr; Tue, 31 May 2005 22:31:59 +0300 (EEST) Received: by sk2-4.tky.hut.fi (hashcash-sendmail, from uid 1000); Tue, 31 May 2005 22:32:08 +0300 Date: Tue, 31 May 2005 22:32:07 +0300 From: Sami Liedes To: caml-list@yquem.inria.fr Subject: Descriptor leak in Unix.close_process* Message-ID: <20050531193207.GK4700@sk2-4.tky.hut.fi> Mail-Followup-To: caml-list@yquem.inria.fr Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="PW0Eas8rCkcu1VkF" Content-Disposition: inline User-Agent: Mutt/1.5.9i X-Hashcash: 1:24:050531:caml-list@yquem.inria.fr::WwVf+tcgT2VGtRkt:0000000000000 000000000000000000000000jdT5 X-TKK-Virus-Scanned: by amavisd-new-2.1.2-hutcc at katosiko.hut.fi X-Miltered: at nez-perce with ID 429CBBF4.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; descriptors:01 descriptors:01 exception:01 unix:01 unix:01 functions:01 explicitly:01 explicitly:01 descriptor:02 descriptor:02 correct:08 sami:10 sami:10 think:11 think:11 X-Attachments: type="application/pgp-signature" name="signature.asc" X-Spam-Checker-Version: SpamAssassin 3.0.2 (2004-11-16) on yquem.inria.fr X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.0.2 X-Spam-Level: --PW0Eas8rCkcu1VkF Content-Type: text/plain; charset=us-ascii Content-Disposition: inline I think there's a descriptor leak in Unix.close_process_full and possibly other close_process* functions. If there's an error in closing one of the descriptors, I think the correct behavior would be to close the rest nevertheless before throwing a Unix_error exception. I think this can happen in some conditions (SIGPIPE?) even without having explicitly closed some of the descriptors. Now I have a situation where a mere Unix.close_process_full will result in a descriptor leak but explicitly trying to close them one by one will not. Sami --PW0Eas8rCkcu1VkF Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.1 (GNU/Linux) iD8DBQFCnLu3yc0QC7DZBM8RAp7nAKDH8g95xSlswHKDaIm6CnRNLDWdeQCg8niX 135ExaRwmXZSGlm33O3OLnA= =yKKZ -----END PGP SIGNATURE----- --PW0Eas8rCkcu1VkF--