Some kind of file descriptor overflow

2014-06-13 Thread Jorge Sivil
The script is in the answer:

http://stackoverflow.com/questions/24192459/bash-running-out-of-file-descriptors

It has 3 global variables, finishing in _CP, _TB and _CO.

It runs out of file descriptors after 1 or 2 hours.

I do not know much about Linux but I hope it helps you.

GNU bash, version 4.2.37(1)-release (i486-pc-linux-gnu)

-- 
Atte.: Jorge Sivil



Re: Some kind of file descriptor overflow

2014-06-13 Thread Jorge Sivil
Yes, sorry. The minimum reproduceable code is:

#!/bin/bash
function something() {
  while true
  do
while read VAR
do
  dummyvar="a"
done < <(find "/run/shm/debora" -type f | sort)
sleep 3
  done
}
something &

Which fails with many pipes fd open.

Changing the While feed to this:

#!/bin/bash
function something() {
  find "/run/shm/debora" -type f | sort | while true
  do
while read VAR
do
  dummyvar="a"
done
sleep 3
  done
}
something &

Works completely normal.

However, removing the call as function in background:

#!/bin/bash
while true
do
  while read VAR
  do
dummyvar="a"
  done < <(find "/run/shm/debora" -type f | sort)
  sleep 3
done

But executing the script with ./test.sh & (in background), works
without problems too.

On Fri, Jun 13, 2014 at 2:35 PM, Eduardo A. Bustamante López
 wrote:
> On Fri, Jun 13, 2014 at 09:52:49AM -0300, Jorge Sivil wrote:
>> The script is in the answer:
>>
>> http://stackoverflow.com/questions/24192459/bash-running-out-of-file-descriptors
> Can't you reduce the script to a minimum reproducible case? To be
> honest, it smells like a scripting error and not a bug, but the code
> in that answer is too large and with too many dependencies to be even
> worth the time to execute.



-- 
Atte.: Jorge Sivil