Message71141
The following code works[1] on trunk and 2.5.1, but crashes with "Fatal
Python error: Cannot recover from stack overflow," on py3k as of rev65676:
######
# Python 3.0b2+ (py3k:65676, Aug 14 2008, 14:37:38)
# [GCC 4.1.3 20070929 (prerelease) (Ubuntu 4.1.2-16ubuntu2)] on linux2
import sys
def overflower():
try:
return overflower()
except:
return sys.exc_info()
def f():
try:
return f()
except:
return overflower()
f()
######
Catching RuntimeError crashes, letting it be raised avoids the crash.
Adding "finally: return overflower()" along with a non
RuntimeError-catching except also gives a Fatal Python error.
A smaller test case for hitting the overflow in py3k would be "def f():
[...] except: return f()", but that hangs in an (desirable?) infinite
loop in 2.5 and trunk.
[1] "Works" as in "doesn't crash", but both the code above and the
infinite loop hit issue2548 when run on a debug build of trunk. Calling
overflower() alone in trunk hits the "undetected error" discussed in
that issue, but works fine in py3k. |
|
Date |
User |
Action |
Args |
2008-08-14 19:03:35 | ajaksu2 | set | recipients:
+ ajaksu2 |
2008-08-14 19:03:35 | ajaksu2 | set | messageid: <1218740615.84.0.303510238935.issue3555@psf.upfronthosting.co.za> |
2008-08-14 19:03:34 | ajaksu2 | link | issue3555 messages |
2008-08-14 19:03:33 | ajaksu2 | create | |
|