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


Groups > comp.lang.python > #46374

Re: Fatal Python error

Path csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!ecngs!feeder2.ecngs.de!newsfeed.freenet.ag!news2.euro.net!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <davea@davea.name>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.000
X-Spam-Evidence '*H*': 1.00; '*S*': 0.00; 'subject:error': 0.03; 'win32': 0.03; 'broken': 0.04; 'interpreter': 0.05; 'subject:Python': 0.06; 'error:': 0.07; 'interpreter.': 0.07; 'responding': 0.07; 'logic': 0.09; 'stack,': 0.09; 'try:': 0.09; 'python': 0.11; 'def': 0.12; 'bug': 0.12; 'thread': 0.14; 'benjamin': 0.16; 'handler,': 0.16; 'handler.': 0.16; 'loop.': 0.16; 'overflow.': 0.16; 'received:74.208.4.195': 0.16; 'somehow.': 0.16; 'spotted': 0.16; 'exception': 0.16; 'wrote:': 0.18; 'all,': 0.19; 'bit': 0.19; 'else,': 0.19; 'stack': 0.19; 'meant': 0.20; 'example': 0.22; 'separate': 0.22; 'header:User- Agent:1': 0.23; 'error': 0.23; '2.x': 0.24; 'simpler': 0.24; "i've": 0.25; 'shown': 0.26; 'code:': 0.26; 'header:In-Reply- To:1': 0.27; 'function': 0.29; 'am,': 0.29; 'skip:( 20': 0.30; "i'm": 0.30; 'gives': 0.31; 'code': 0.31; '"",': 0.31; '3.x': 0.31; '>>>>': 0.31; 'indentation': 0.31; 'anyone': 0.31; 'file': 0.32; 'probably': 0.32; 'text': 0.33; 'totally': 0.33; 'problem': 0.35; 'except': 0.35; 'problem.': 0.35; 'doing': 0.36; "didn't": 0.36; 'similar': 0.36; 'level': 0.37; 'list.': 0.37; 'gmail': 0.38; 'to:addr:python-list': 0.38; 'anything': 0.39; 'to:addr:python.org': 0.39; 'more': 0.64; 'received:74.208': 0.68; 'oscar': 0.84; 'presumably': 0.84; '2013,': 0.91; 'recover': 0.91; '2013': 0.98
Date Wed, 29 May 2013 09:02:53 -0400
From Dave Angel <davea@davea.name>
User-Agent Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130510 Thunderbird/17.0.6
MIME-Version 1.0
To python-list@python.org
Subject Re: Fatal Python error
References <CAN1F8qXPEM4B=2e7KOhWeTKzxmeeb_w_S97wYiHCMXH3jfzL6g@mail.gmail.com> <CAHVvXxTxzZjhsmDw3x0Wm-wyLmdx5VehzKahnfkTSNrmigKMUA@mail.gmail.com>
In-Reply-To <CAHVvXxTxzZjhsmDw3x0Wm-wyLmdx5VehzKahnfkTSNrmigKMUA@mail.gmail.com>
Content-Type text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding 7bit
X-Provags-ID V02:K0:FFfql6Exmge+Het4lHzQnW6lBhoRWEtAEXWQCspUE73 AsK9nNzG2CRWFF/Lj5/E3YCm1tlwEK1rSJ72nNST/bIBDgf6KH wLXpmWHGkIOy8XaXg4KPE5Pt2FNR5QnqVSMhjDvyqRLYKcexg6 5neCJEaPb0GHsGLlInOVrL6yWG66gSespVOrLrqwkEyiRy90l5 wPs1YRkXPnrzUKGaw0w9Aw6hOpn7vfO5HkL/DqQlN2KHuflG7p UVb+1abYBHpex/usKm347grFB8HFCkVluplreFYL3uLwpX2ZHO afvZprfCBpcREkzct0GNeu9KKgknmtgxXgvY3iNDbc/F2FHQtI osvdxhoHUBp5YLk2q1uo=
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.2354.1369832593.3114.python-list@python.org> (permalink)
Lines 54
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1369832593 news.xs4all.nl 15866 [2001:888:2000:d::a6]:57433
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:46374

Show key headers only | View raw


On 05/29/2013 08:45 AM, Oscar Benjamin wrote:
> 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
>

More likely a bug in the 2.x interpreter.  Once inside an exception 
handler, that frame must be held somehow.  If not on the stack, then in 
some separate list.  So the logic will presumably fill memory, it just 
may take longer on 2.x .

Joshua:  Avoid doing anything complex inside an exception handler.  If 
nothing else, the exception frame is huge.  I probably would have 
spotted it except for the indentation problem triggered by html.  The 
top level code following your function didn't have any loops, so it 
wasn't a problem.

Can anyone help Joshua put his gmail into text mode?




-- 
DaveA

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


Thread

Re: Fatal Python error Dave Angel <davea@davea.name> - 2013-05-29 09:02 -0400

csiph-web