summaryrefslogtreecommitdiffstats
path: root/Lib/test/crashers
diff options
context:
space:
mode:
authorNick Coghlan <ncoghlan@gmail.com>2012-11-05 11:32:11 (GMT)
committerNick Coghlan <ncoghlan@gmail.com>2012-11-05 11:32:11 (GMT)
commit1de70b52a4cee0acb9b0d972c16bfc247e3f8906 (patch)
tree3c63855c7eb80ccfc09f5186e28609d204f59b34 /Lib/test/crashers
parent32dd36bdceb32d72b5c4e19f9fab9953a7d041ef (diff)
parent692b023f7763ccc73f5459f812717f0c627188fd (diff)
downloadcpython-1de70b52a4cee0acb9b0d972c16bfc247e3f8906.zip
cpython-1de70b52a4cee0acb9b0d972c16bfc247e3f8906.tar.gz
cpython-1de70b52a4cee0acb9b0d972c16bfc247e3f8906.tar.bz2
Merge #6717 crasher from 3.2
Diffstat (limited to 'Lib/test/crashers')
-rw-r--r--Lib/test/crashers/trace_at_recursion_limit.py27
1 files changed, 27 insertions, 0 deletions
diff --git a/Lib/test/crashers/trace_at_recursion_limit.py b/Lib/test/crashers/trace_at_recursion_limit.py
new file mode 100644
index 0000000..acd863f
--- /dev/null
+++ b/Lib/test/crashers/trace_at_recursion_limit.py
@@ -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()