[Python-checkins] cpython (3.2): Record a known crasher from #6717
nick.coghlan
python-checkins at python.org
Mon Nov 5 12:33:35 CET 2012
http://hg.python.org/cpython/rev/0dfa3b09a6fe
changeset: 80268:0dfa3b09a6fe
branch: 3.2
parent: 80255:be882735e0b6
user: Nick Coghlan <ncoghlan at gmail.com>
date: Mon Nov 05 21:26:57 2012 +1000
summary:
Record a known crasher from #6717
files:
Lib/test/crashers/trace_at_recursion_limit.py | 27 ++++++++++
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
--- /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()
--
Repository URL: http://hg.python.org/cpython
More information about the Python-checkins
mailing list