This would typically be the error if your recursion is not set up correctly and there is no way for it to terminate. The runtime detects that there doesn't seem to be any end to this and shuts down the application.
So, I'd investigate the recursion and see if it's correctly set up.
If it is indeed correctly set up and somehow you've got a valid case with too deep recursion for the system to handle, there's still a way. Every recursion could be translated into a loop. So you'd just need to rephrase your code to be a loop instead of a recursion. Loops also run faster than recursions.
You can read more on the subject here.