mirror of
https://github.com/python/cpython.git
synced 2025-08-30 21:48:47 +00:00
Merge #6717 crasher from 3.2
This commit is contained in:
commit
1de70b52a4
1 changed files with 27 additions and 0 deletions
27
Lib/test/crashers/trace_at_recursion_limit.py
Normal file
27
Lib/test/crashers/trace_at_recursion_limit.py
Normal 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()
|
Loading…
Add table
Add a link
Reference in a new issue