diff options
author | Nick Coghlan <ncoghlan@gmail.com> | 2012-11-05 11:33:22 (GMT) |
---|---|---|
committer | Nick Coghlan <ncoghlan@gmail.com> | 2012-11-05 11:33:22 (GMT) |
commit | d9d1d08b07f6f173c65b527c9d81fac1937b9762 (patch) | |
tree | fcb32876b07ad9903212af470056a39a233646c8 | |
parent | 82de6d20de3ba0a198a10bc4956ad8c7f240245e (diff) | |
parent | 1de70b52a4cee0acb9b0d972c16bfc247e3f8906 (diff) | |
download | cpython-d9d1d08b07f6f173c65b527c9d81fac1937b9762.zip cpython-d9d1d08b07f6f173c65b527c9d81fac1937b9762.tar.gz cpython-d9d1d08b07f6f173c65b527c9d81fac1937b9762.tar.bz2 |
Merge #6717 crasher from 3.3
-rw-r--r-- | 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 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() |