Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #46373

Re: Fatal Python error

References <CAN1F8qXPEM4B=2e7KOhWeTKzxmeeb_w_S97wYiHCMXH3jfzL6g@mail.gmail.com>
From Oscar Benjamin <oscar.j.benjamin@gmail.com>
Date 2013-05-29 13:45 +0100
Subject Re: Fatal Python error
Newsgroups comp.lang.python
Message-ID <mailman.2353.1369831542.3114.python-list@python.org> (permalink)

Show all headers | View raw


On 29 May 2013 12:48, Joshua Landau <joshua.landau.ws@gmail.com> wrote:
> Hello all, again. Instead of revising like I'm meant to be, I've been
> delving into a bit of Python and I've come up with this code:

Here's a simpler example that gives similar results:

$ py -3.3
Python 3.3.2 (v3.3.2:d047928ae3f6, May 16 2013, 00:03:43) [MSC v.1600
32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> def broken():
...   try:
...     broken()
...   except RuntimeError:
...     broken()
...
>>> broken()
Fatal Python error: Cannot recover from stack overflow.

Current thread 0x0000058c:
  File "<stdin>", line 3 in broken
  File "<stdin>", line 3 in broken
...

Under Python 2.7.5 it just goes into an infinite loop. Under Python
3.2.5 and 3.3.2 it crashes the interpreter as shown above.

What the broken() function is doing is totally stupid: responding to a
recursion error with more recursion. However this may indicate or be
considered a bug in the 3.x interpreter.


Oscar

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Re: Fatal Python error Oscar Benjamin <oscar.j.benjamin@gmail.com> - 2013-05-29 13:45 +0100

csiph-web