This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author vstinner
Recipients behackett, emptysquare, vstinner
Date 2015-09-23.21:40:00
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1443044401.04.0.71942669291.issue25222@psf.upfronthosting.co.za>
In-reply-to
Content
I'm not sure that I understood the bug.

You are testing a function which enters an unlimited loop. You expect to get a RecursionError, but Python does crash.

Well, Python has no perfect protection again stack overflow. It's only best effect. You should change sys.setrecursionlimit() to a lower limit to try to limit the risk of a crash.

It's hard to predict how the stack will be used.

FYI the error message comes from Python/ceval.c:

    if (tstate->overflowed) {
        if (tstate->recursion_depth > recursion_limit + 50) {
            /* Overflowing while handling an overflow. Give up. */
            Py_FatalError("Cannot recover from stack overflow.");
        }
        return 0;
    }

I suggest you to use sys.setrecursionlimit() in your test, or remove the test.

Maybe there is a real bug, but if it's the case, it will probably be hard to investigate it. You need to dig into gdb.
History
Date User Action Args
2015-09-23 21:40:01vstinnersetrecipients: + vstinner, emptysquare, behackett
2015-09-23 21:40:01vstinnersetmessageid: <1443044401.04.0.71942669291.issue25222@psf.upfronthosting.co.za>
2015-09-23 21:40:01vstinnerlinkissue25222 messages
2015-09-23 21:40:00vstinnercreate