Ttl/evolutionary-circuits

OSError: too many open files

Closed this issue · 0 comments

Ttl commented

On long simulations crashes with this traceback:

Traceback (most recent call last):
  File "/usr/lib/python2.7/threading.py", line 551, in __bootstrap_inner
    self.run()
  File "/home/henrik/koodi/circuits/git/temp/circuits.py", line 132, in run
    self.result = simulate(self.spice_in)
  File "/home/henrik/koodi/circuits/git/temp/circuits.py", line 116, in simulate
    spice = subprocess.Popen(['ngspice', '-s'],stdin=subprocess.PIPE,stdout=subprocess.PIPE,stderr=subprocess.PIPE)
  File "/usr/lib/python2.7/subprocess.py", line 672, in __init__
    errread, errwrite) = self._get_handles(stdin, stdout, stderr)
  File "/usr/lib/python2.7/subprocess.py", line 1038, in _get_handles
    p2cread, p2cwrite = self.pipe_cloexec()
  File "/usr/lib/python2.7/subprocess.py", line 1091, in pipe_cloexec
    r, w = os.pipe()
OSError: [Errno 24] Too many open files

There's some existing discussion on this bug and it seems that the subrocess pipe is left open for some reason.