[ python-Bugs-1705365 ] 'nonlocal x' at top level crashes interpreter

SourceForge.net noreply at sourceforge.net
Sun Apr 22 21:20:48 CEST 2007


Bugs item #1705365, was opened at 2007-04-22 12:20
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1705365&group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Python Interpreter Core
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: John Reese (johnreese)
Assigned to: Nobody/Anonymous (nobody)
Summary: 'nonlocal x' at top level crashes interpreter

Initial Comment:
A nonlocal declaration at the interpreter top level causes a bus error.  This happens in the p3yk branch at head (r54922).  Reporter is using MacOS 10.4.9 on Intel.  Reporter is perfectly aware that nonlocal doesn't do anything useful at the top level, but feels it should not crash the interpreter.


% gdb python3.0                                          
GNU gdb 6.3.50-20050815 (Apple version gdb-563) (Wed Jul 19 05:10:58 GMT 2006)
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i386-apple-darwin"...Reading symbols for shared libraries .. done

(gdb) run
Starting program: /Users/jtr/bin/python3.0 
Reading symbols for shared libraries . done
Python 3.0x (p3yk:54922, Apr 22 2007, 12:15:19) 
[GCC 4.0.1 (Apple Computer, Inc. build 5363)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> nonlocal x

Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_PROTECTION_FAILURE at address: 0x00000004
PySet_Contains (anyset=0x0, key=0x532640) at Objects/setobject.c:2129
2129            if (!PyAnySet_Check(anyset)) {
(gdb) The program is running.  Exit anyway? (y or n) y


----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1705365&group_id=5470


More information about the Python-bugs-list mailing list