Merge #6717 crasher from 3.3

This commit is contained in:
Nick Coghlan 2012-11-05 21:33:22 +10:00
commit d9d1d08b07
1 changed files with 27 additions and 0 deletions

View File

@ -0,0 +1,27 @@
"""
From http://bugs.python.org/issue6717
A misbehaving trace hook can trigger a segfault by exceeding the recursion
limit.
"""
import sys
def x():
pass
def g(*args):
if True: # change to True to crash interpreter
try:
x()
except:
pass
return g
def f():
print(sys.getrecursionlimit())
f()
sys.settrace(g)
f()