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 xxm
Recipients xxm
Date 2021-01-18.04:17:00
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1610943420.56.0.379356825462.issue42951@roundup.psfhosted.org>
In-reply-to
Content
In issue 42500, recursive calls in "Try-except" are resolved. This PR has fixed the crashes of some programs, such as program 1. And the core dump error is replaced with RecursiveError.  
However, program 2 will not report a RecursiveError. The program will fall into an infinite loop. Even "Ctrl C" cannot stop the infinite loop. I try to track the execution of this program and insert "print" information(see program 3). The output seems random in execution between try branch and except branch!  I think this is a new bug after fixing 42500. I believe the program should also return RecursiveError.


Program 1
=========================== 
def foo():
    try:
        1/0
    except:
        foo()
foo()
================================

Program 2
================================
def foo():
    try:
        foo()
    except:
        foo()
foo()
================================


Program 3
================================
def foo():
    try:
        print("a")
        foo()
    except:
        print("b")
        foo()

foo()
================================
Output for program3( unexpected infinite random loop. ):
......bbaaaabbabbaabbabbaaabbabbaabbabbaaaaaaaabbabbaabbabbaaabbabbaabbabbaaaabbabbaabbabbaaabbabbaabbabbaaaaabbabbaabbabbaaabbabbaabbabbaaaabbabbaabbabbaaabbabbaabbabbaaaaaabbabbaabbabbaaabbabbaabbabbaaaabb......

>>python -V
Python 3.10.0a4
History
Date User Action Args
2021-01-18 04:17:00xxmsetrecipients: + xxm
2021-01-18 04:17:00xxmsetmessageid: <1610943420.56.0.379356825462.issue42951@roundup.psfhosted.org>
2021-01-18 04:17:00xxmlinkissue42951 messages
2021-01-18 04:17:00xxmcreate