Bug 103035 - sed can die needlessly with too many open files
Summary: sed can die needlessly with too many open files
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: sed
Version: 9
Hardware: i386
OS: Linux
medium
low
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact: Ben Levenson
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2003-08-25 18:50 UTC by Anthony Papineau
Modified: 2007-04-18 16:57 UTC (History)
0 users

Fixed In Version: 4.0.7-2
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2003-09-08 09:22:56 UTC
Embargoed:


Attachments (Terms of Use)

Description Anthony Papineau 2003-08-25 18:50:40 UTC
Description of problem:

sed can die needlessly with too many open files

Version-Release number of selected component (if applicable):

Red Hat 9, package sed-4.0.5-1

How to reproduce: Try a sed command line that would read more than
about 1024 files.  Here we create a directory with 1040 files and try
to sed them all at once.  Note that the sed command attempts to do
exactly the same thing as the grep command preceding it, but only
opens, in this case, the first 1021 files.

Script started on Fri Aug 22 20:35:49 2003
sh-2.05b$ ls
sh-2.05b$ for a in a b c d e f g h i j k l m

>>  do
>>    for b in a b c d e f g h i j
>>    do
>>      for c in a b c d e f g h
>>      do
>>        date >$a$b$c
>>      done
>>    done
>>  done

sh-2.05b$ cat * | wc -l
   1040
sh-2.05b$ ls | wc -l
   1040
sh-2.05b$ grep : * | wc -l
   1040
sh-2.05b$ sed -n /:/p * | wc -l
sed: can't read mhf: Too many open files
sed: can't read mhg: Too many open files
sed: can't read mhh: Too many open files
sed: can't read mia: Too many open files
sed: can't read mib: Too many open files
sed: can't read mic: Too many open files
sed: can't read mid: Too many open files
sed: can't read mie: Too many open files
sed: can't read mif: Too many open files
sed: can't read mig: Too many open files
sed: can't read mih: Too many open files
sed: can't read mja: Too many open files
sed: can't read mjb: Too many open files
sed: can't read mjc: Too many open files
sed: can't read mjd: Too many open files
sed: can't read mje: Too many open files
sed: can't read mjf: Too many open files
sed: can't read mjg: Too many open files
sed: can't read mjh: Too many open files
   1021
sh-2.05b$ exit

Script done on Fri Aug 22 20:37:28 2003

Comment 1 Jakub Jelinek 2003-09-08 09:22:56 UTC
Seems to be fixed in sed-4.0.7-{2,3}.


Note You need to log in before you can comment on or make changes to this bug.