From: Nick Coghlan Date: Mon, 5 Nov 2012 11:26:57 +0000 (+1000) Subject: Record a known crasher from #6717 X-Git-Tag: v3.2.4rc1~365 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=692b023f7763ccc73f5459f812717f0c627188fd;p=thirdparty%2FPython%2Fcpython.git Record a known crasher from #6717 --- 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 000000000000..acd863f5509c --- /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()