title: What will happen if function goes out of stack space during infinite recursion?
body: <p>There is a function that calls itself recursively infinitely.</p>
  
  <p>This function has some arguments too.</p>
  
  <p>For every function call the arguments and return address are pushed on the stack .</p>
  
  <p>For each process there is fixed size of stack space that cannot grow dynamically like heap.
  And I guess each thread also has its own stack.</p>
  
  <p>Now if a function is called recursively infinitely and process runs out of stack space , what will happen?</p>
  
  <p>Will program crash?
  Will OS handle the situation?
  There is 4GB of address space so why cannot OS do something to increase stack size.</p>