From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS3215 2.0.0.0/16 X-Spam-Status: No, score=-3.2 required=3.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,UNPARSEABLE_RELAY shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from nautica.notk.org (ipv6.notk.org [IPv6:2001:41d0:1:7a93::1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id 3B5671F852 for ; Wed, 2 Feb 2022 00:24:03 +0000 (UTC) Received: by nautica.notk.org (Postfix, from userid 108) id 48C30C01A; Wed, 2 Feb 2022 01:23:59 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=codewreck.org; s=2; t=1643761439; bh=EmvoqEof098jNXaeNtWHfwyAsY2/9lbfiDmsqMC45fY=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=WN4twekHTnAJjq2zgzHg95zujZmtP3+8X/nMRJWtWBmOZxvGFDfvZgi1KxyivmVWP P8RB1PUVk6vw5nYBt9JCLyiufy5Iyvqx58DMqY6obIQi2Hc+JYhuUc3v5Rn3cmCSQZ QbrewViK/8whuBiSPPN8LPabEvPrxW+3NzBabX4hfau8o+/MWyAjHU4bJ5eygxeUdf zR4RJ2nMh43s7gjhhEAcY34BSY9+/zkSz4rdhz3QIQqOJhOQcKA88G5aec4hp0REAc yQQonWE6QHROM5gyglKpsq15bxBnqbspw9224KRx9Tu8011V7ggryyGCLc69YHyUDB SxysTA9ehfMzQ== Received: from odin.codewreck.org (localhost [127.0.0.1]) by nautica.notk.org (Postfix) with ESMTPS id EB8A2C009; Wed, 2 Feb 2022 01:23:57 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=codewreck.org; s=2; t=1643761439; bh=EmvoqEof098jNXaeNtWHfwyAsY2/9lbfiDmsqMC45fY=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=WN4twekHTnAJjq2zgzHg95zujZmtP3+8X/nMRJWtWBmOZxvGFDfvZgi1KxyivmVWP P8RB1PUVk6vw5nYBt9JCLyiufy5Iyvqx58DMqY6obIQi2Hc+JYhuUc3v5Rn3cmCSQZ QbrewViK/8whuBiSPPN8LPabEvPrxW+3NzBabX4hfau8o+/MWyAjHU4bJ5eygxeUdf zR4RJ2nMh43s7gjhhEAcY34BSY9+/zkSz4rdhz3QIQqOJhOQcKA88G5aec4hp0REAc yQQonWE6QHROM5gyglKpsq15bxBnqbspw9224KRx9Tu8011V7ggryyGCLc69YHyUDB SxysTA9ehfMzQ== Received: from localhost (odin.codewreck.org [local]) by odin.codewreck.org (OpenSMTPD) with ESMTPA id bcaf8ecb; Wed, 2 Feb 2022 00:23:53 +0000 (UTC) Date: Wed, 2 Feb 2022 09:23:38 +0900 From: Dominique Martinet To: Eric Wong Cc: Julien Moutinho , meta@public-inbox.org Subject: Re: FD_CLOEXEC w/ nix-shell [was: Test failures with 1.7.0] Message-ID: References: <20211208010730.f47xxgzj53nwgvja@sourcephile.fr> <20211208040836.GA27368@dcvr> <20211209013743.okzgim7bbrpahks7@sourcephile.fr> <20220201232740.M97535@dcvr> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20220201232740.M97535@dcvr> List-Id: Eric Wong wrote on Tue, Feb 01, 2022 at 11:27:40PM +0000: > Is nix-shell setting FD_CLOEXEC on all FDs (>= 3) it creates? > IMNSHO it should. ugh, it definitely should -- in this case it looks like a plain fd leak. $ ls -l /proc/$$/fd/ total 0 lrwx------ 1 asmadeus users 64 Feb 2 09:17 0 -> /dev/pts/28 lrwx------ 1 asmadeus users 64 Feb 2 09:17 1 -> /dev/pts/28 lrwx------ 1 asmadeus users 64 Feb 2 09:17 2 -> /dev/pts/28 lrwx------ 1 asmadeus users 64 Feb 2 09:17 255 -> /dev/pts/28 lrwx------ 1 asmadeus users 64 Feb 2 09:17 4 -> '/tmp/nix-shell.vhDsb9 (deleted)' $ ls -l /proc/self/fd/ total 0 lrwx------ 1 asmadeus users 64 Feb 2 09:17 0 -> /dev/pts/28 lrwx------ 1 asmadeus users 64 Feb 2 09:17 1 -> /dev/pts/28 lrwx------ 1 asmadeus users 64 Feb 2 09:17 2 -> /dev/pts/28 lr-x------ 1 asmadeus users 64 Feb 2 09:17 3 -> /proc/1220800/fd lrwx------ 1 asmadeus users 64 Feb 2 09:17 4 -> '/tmp/nix-shell.vhDsb9 (deleted)' nix-shell/nix shell don't seem to have the problem it's a 'nix develop' bug, I'll follow it up with nix devs and get it fixed there. (I don't have an opinion if you want to make your tests more robust, it might be a good thing in general anyway) Thanks for figuring this out! -- Dominique