Path: csiph.com!xmission!news.snarked.org!news.linkpendium.com!news.linkpendium.com!panix!usenet.stanford.edu!not-for-mail From: "" Newsgroups: gnu.bash.bug Subject: File descriptor of process substitution unexpectedly persisting Date: Fri, 21 Jun 2019 19:58:22 +0100 Lines: 37 Approved: bug-bash@gnu.org Message-ID: References: <20190621195822.be84baf077ebe5dfda8b72ae@plushkava.net> NNTP-Posting-Host: lists.gnu.org Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Trace: usenet.stanford.edu 1561150005 14788 209.51.188.17 (21 Jun 2019 20:46:45 GMT) X-Complaints-To: action@cs.stanford.edu To: bug-bash@gnu.org Envelope-to: bug-bash@gnu.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=plushkava.net; h=date:from:to:subject:message-id:mime-version:content-type :content-transfer-encoding; s=fm3; bh=wOS/N0W+3bnSjR2VvLHHX4JLg3 3J3UQHoL5ufoZjLSc=; b=Dxwq8AoHWYfYogNBlz5CdVRRf3WA9aMNFQD0y8XZWj q5Xy2GJZHYtCsC9FUY55iXF1sWnesLrik+DGwVPx/Rb0IzNwih/igsK/K1pwJvFC DmSrAL7ZQq72bX3cL/XeikzPnhK/aFbcCzGkLXlIeMIjZxSSbd8hO9TkCp3fEIrk svZG1Wqy4OQStcAdv1pcE/nkbOdtmgV8R8glTRDnOGXLS/WhZILeH98v0QpSOrzc UKc98vB0zVCNBIGSJZ4ZWqnknS1PkImes48v9AHCTsRU7nXdImQ47oOmX9LUTEpJ IFrEJVfPWmzkuVvQsFig3YUDfL4bD3ou8Blfy3MRee7g== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:message-id:mime-version:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=wOS/N0 W+3bnSjR2VvLHHX4JLg33J3UQHoL5ufoZjLSc=; b=OqO7o6VBvhXJWXndSSjpnT oQVMTgKG576jebEWsiG7+CSDd4PR2/kaz9LoDlAFVl7Oj7JddgGCwCYBR75kNGV8 Rasr44YDJssU3rug8wfIFVowsXJS0ebSr8Sp+YU70lra/NK5vTqizmtQz+YuIe+f yF5eA4jPtTBaCwt24i3keDRKB8aH8jnQROEn0/P5NYMiRbju4MatSv6NrulQHhPE UyrVepm9e5nyMyzM5Ak7QOl8QBNnrIim040TuFGZLEBZKmr+vWc1ifaOoYzYhaIj 6662zajkqKIVM18DTr2+P7Vc4v/Rm1okKT33kuNETzQQgxmnvuVssb9mJ5ihOEuw == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduvddrtdeigddufeehucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucgogfhmphhthietlhhirghsucdlfeelmdenucfjug hrpeffhffvuffkofggtgfgsehtjeertdfjtddvnecuhfhrohhmpedffdcuoehkfhhmsehp lhhushhhkhgrvhgrrdhnvghtqeenucfkphepudelfedrudefkedrvddukedrudeltdenuc frrghrrghmpehmrghilhhfrhhomhepkhhfmhesphhluhhshhhkrghvrgdrnhgvthenucev lhhushhtvghrufhiiigvpedt X-ME-Proxy: X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.32; x86_64-unknown-linux-gnu) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 64.147.123.24 X-Mailman-Approved-At: Fri, 21 Jun 2019 16:46:39 -0400 X-BeenThere: bug-bash@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Bug reports for the GNU Bourne Again SHell List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Mailman-Original-Message-ID: <20190621195822.be84baf077ebe5dfda8b72ae@plushkava.net> Xref: csiph.com gnu.bash.bug:15065 Hi, As tested interactively with bash 5.0.7(1) and GNU/Linux, the following command prints a constant number of active file descriptors, as expected: $ while :; do { read; } < <(:); sleep 0.5; printf %s\\n /proc/self/fd/* | wc -l; done 6 6 6 6 6 ... etc However, merely by assigning a variable prior to the loop, though within the same line, the number will continuously grow: $ var=0; while :; do { read; } < <(:); sleep 0.5; printf %s\\n /proc/self/fd/* | wc -l; done 6 7 8 9 10 ... etc If then adjusted so that the read command is not part of a compound command, normality is restored: $ var=0; while :; do read < <(:); sleep 0.5; printf %s\\n /proc/self/fd/* | wc -l; done 5 5 5 5 5 ... etc I noticed this behaviour upon running out of file descriptors after executing structurally similar code that deliberately utilises a compound command to read twice, thus discarding the first line of input. -- Kerin Millar