A stack overflow:
When a program attempts to use more space than is available on the call stack
(that is, when it attempts to access memory beyond the call stack's bounds,
which is essentially a buffer overflow), the stack is said to overflow, typically
resulting in a program crash.
Your recursion is probably too deep, try replacing it with a while / for loop. :)