Hi,

Thank you for your answers.
Yes, your right, my program can't terminate. Maybe my example was not good.
Here is another example where it still crash in my computer :

sys.setrecursionlimit(100000)
def rec(niter):
    if niter == 0:
        return
    rec(niter-1)
rec(50000)
print "hello !" #will never print this !

I think it's not normal that it makes python crash, without saying anything.
It should at least display what is the error (probably a stack overflow 
here).

I have reprogrammed the computing I wanted to do without recursion, and it 
crash less, but it still crash sometimes.
How can I have more details of why sage crash ? Are there tools to help 
debugging a crash like this ?

Best regards,
Paul

Le jeudi 3 avril 2014 14:04:08 UTC+2, Simon King a écrit :
>
> Hi Paul, 
>
> On 2014-04-02, Paul Mercat <[email protected] <javascript:>> wrote: 
> > sys.setrecursionlimit(100000) 
> > def rec(niter): 
> >     rec(niter-1) 
> >     rec(niter-1) 
> > rec(100) 
> > 
> > I would be very pleased if somebody knows how to fix this bug. 
>
> See http://en.wikipedia.org/wiki/Recursion_%28computer_science%29 
>
> You can not expect a recursion to terminate if you don't provide a 
> condition for termination. 
>
> Best regards, 
> Simon 
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.

Reply via email to