title: Segmentation fault (core dumped) when trying to use subprocess in python
body: <p>I am trying to run a program many times in parallel (with different arguments). I searched online and found that subprocess in python is a good way to do that. My code is the following:</p>
  
  <pre><code>import subprocess
  import os
  
  models_path="~/"
  procs = []
  num_of_procs_running=0
  i = 0
  for model_name in os.listdir(models_path):
      if num_of_procs_running &gt; num_of_procs:
          for p in procs:
              p.wait()
          procs = []
          num_of_procs_running = 0
      elif model_name.endswith(".onnx"):
          name, ending = model_name.split(".")
          runner = './SOME_PROGRAM '+str(i)+'&gt; output.txt'
          i+=1
          procs.append(subprocess.Popen(runner,shell=True))
          num_of_procs_running += 1
          print("Total processes:",num_of_procs_running)
          print("\n")
  for p in procs:
      p.wait()
  </code></pre>
  
  <p>I am getting Segmentation Fault(core dumped) if I am trying to run more than 56 subprocesses. My machine has 56 CPU's and and each CPU has 12 cores. How can I run more than 56 subprocesses, or maybe use threads?
  Thanks.</p>