Module Module1 ' crashes with a stack overflow Function calcSum(n) Console.WriteLine(String.Format("n = {0}", n)) n = n + calcSum(n - 1) Console.WriteLine(String.Format("At line A {0}", n)) ' This function has no return statement, so will crash ' with a stack overflow. End Function Sub Main() Dim x As Integer x = calcSum(10) Console.WriteLine(String.Format("At line B {0}", x)) End Sub End Module