Message385171
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 |
|
Date |
User |
Action |
Args |
2021-01-18 04:17:00 | xxm | set | recipients:
+ xxm |
2021-01-18 04:17:00 | xxm | set | messageid: <1610943420.56.0.379356825462.issue42951@roundup.psfhosted.org> |
2021-01-18 04:17:00 | xxm | link | issue42951 messages |
2021-01-18 04:17:00 | xxm | create | |
|