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 ajaksu2
Recipients ajaksu2
Date 2008-08-14.19:03:33
SpamBayes Score 4.680174e-09
Marked as misclassified No
Message-id <1218740615.84.0.303510238935.issue3555@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2008-08-14 19:03:35ajaksu2setrecipients: + ajaksu2
2008-08-14 19:03:35ajaksu2setmessageid: <1218740615.84.0.303510238935.issue3555@psf.upfronthosting.co.za>
2008-08-14 19:03:34ajaksu2linkissue3555 messages
2008-08-14 19:03:33ajaksu2create