StackOverflowException

andrews

Well-known member
Joined
Nov 22, 2011
Messages
126
Programming Experience
5-10
Hi,
I use a recursion and after some trials (45) I got a StackOverflowException .
What to do ?
Thanks for any response
 

JohnH

VB.NET Forum Moderator
Staff member
Joined
Dec 17, 2005
Messages
15,561
Location
Norway
Programming Experience
10+
docs said:
The exception that is thrown when the execution stack overflows because it contains too many nested method calls.
So you have to reevalute the logic, see if it possible that the recusion could cause extremely many nested calls, or if the logic is wrong and not stopping the recursive calls. Usually this happens when logic is wrong causing inifinite recursive calls.
 

jmcilhinney

VB.NET Forum Moderator
Staff member
Joined
Aug 17, 2004
Messages
14,579
Location
Sydney, Australia
Programming Experience
10+
You're asking us to help fix code that we've never seen. That means that we can only provide very general advice and that should be stuff that you have already considered yourself. If your code doesn't work then your code is probably wrong. If we can't see your code, we can't see what's wrong with it.

That said, don't just post code and that's it. Provide a FULL and CLEAR explanation, which includes the logic that the code is supposed to implement. If you say that you want to do X and we see that the code does Y then the issue is obvious. If you just show code that does Y then we'll assume that you want to do Y.
 
Top Bottom