summaryrefslogtreecommitdiffstats
path: root/Lib/test/crashers
diff options
context:
space:
mode:
authorBrett Cannon <bcannon@gmail.com>2007-09-07 04:18:30 (GMT)
committerBrett Cannon <bcannon@gmail.com>2007-09-07 04:18:30 (GMT)
commit1e534b5425d836cb58a73d24f0be791d67bf3503 (patch)
tree1f9fc8b8802c5ba236c026fc6cbe785d7f9bf20b /Lib/test/crashers
parent68a6da99e6dc127d817143f74e98d665117f99c2 (diff)
downloadcpython-1e534b5425d836cb58a73d24f0be791d67bf3503.zip
cpython-1e534b5425d836cb58a73d24f0be791d67bf3503.tar.gz
cpython-1e534b5425d836cb58a73d24f0be791d67bf3503.tar.bz2
Fix a crasher where Python code managed to infinitely recurse in C code without
ever going back out to Python code in PyObject_Call(). Required introducing a static RuntimeError instance so that normalizing an exception there is no reliance on a recursive call that would put the exception system over the recursion check itself.
Diffstat (limited to 'Lib/test/crashers')
-rw-r--r--Lib/test/crashers/infinite_rec_1.py11
-rw-r--r--Lib/test/crashers/infinite_rec_2.py10
-rw-r--r--Lib/test/crashers/infinite_rec_4.py7
-rw-r--r--Lib/test/crashers/infinite_rec_5.py10
4 files changed, 0 insertions, 38 deletions
diff --git a/Lib/test/crashers/infinite_rec_1.py b/Lib/test/crashers/infinite_rec_1.py
deleted file mode 100644
index 573a509..0000000
--- a/Lib/test/crashers/infinite_rec_1.py
+++ /dev/null
@@ -1,11 +0,0 @@
-
-# http://python.org/sf/1202533
-
-import new, operator
-
-class A:
- pass
-A.__mul__ = new.instancemethod(operator.mul, None, A)
-
-if __name__ == '__main__':
- A()*2 # segfault: infinite recursion in C
diff --git a/Lib/test/crashers/infinite_rec_2.py b/Lib/test/crashers/infinite_rec_2.py
deleted file mode 100644
index 5a14b33..0000000
--- a/Lib/test/crashers/infinite_rec_2.py
+++ /dev/null
@@ -1,10 +0,0 @@
-
-# http://python.org/sf/1202533
-
-class A(str):
- __get__ = getattr
-
-if __name__ == '__main__':
- a = A('a')
- A.a = a
- a.a # segfault: infinite recursion in C
diff --git a/Lib/test/crashers/infinite_rec_4.py b/Lib/test/crashers/infinite_rec_4.py
deleted file mode 100644
index 14f1520..0000000
--- a/Lib/test/crashers/infinite_rec_4.py
+++ /dev/null
@@ -1,7 +0,0 @@
-
-# http://python.org/sf/1202533
-
-if __name__ == '__main__':
- lst = [apply]
- lst.append(lst)
- apply(*lst) # segfault: infinite recursion in C
diff --git a/Lib/test/crashers/infinite_rec_5.py b/Lib/test/crashers/infinite_rec_5.py
deleted file mode 100644
index 18d2963..0000000
--- a/Lib/test/crashers/infinite_rec_5.py
+++ /dev/null
@@ -1,10 +0,0 @@
-
-# http://python.org/sf/1267884
-
-import types
-
-class C:
- __str__ = types.InstanceType.__str__
-
-if __name__ == '__main__':
- str(C()) # segfault: infinite recursion in C