bash script outputs "cannot make pipe for process substitution: Too many open files"

Solution Verified - Updated -

Issue

A pipe fd leak occurred in Process Substitution of bash script. As a result, bash script outputs the following message.

./test.sh: cannot make pipe for process substitution: Too many open files

Execute the following script to reproduce:

#!/bin/bash
sub(){
while :
do
/bin/true <(/bin/true)
done
}

sub
exit

Environment

  • Red Hat Enterprise Linux (RHEL) 6 and 7
  • bash

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In
Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.