diff options
| author | Simon Robertshaw <simon@hardwired.org.uk> | 2011-10-26 13:50:50 (GMT) |
|---|---|---|
| committer | Simon Robertshaw <simon@hardwired.org.uk> | 2011-10-26 13:50:50 (GMT) |
| commit | e46ef289e142982d7bd592faa7b0f85470364c01 (patch) | |
| tree | cda253e03788f7db0a7cdcd05662f66b4455e298 /src/python/stdlib/test/crashers/gc_has_finalizer.py | |
| parent | d0d0d62bbcbb5c3417f8cba419c83bac192ea985 (diff) | |
| download | powder-e46ef289e142982d7bd592faa7b0f85470364c01.zip powder-e46ef289e142982d7bd592faa7b0f85470364c01.tar.gz | |
Remove Python console stuff
Diffstat (limited to 'src/python/stdlib/test/crashers/gc_has_finalizer.py')
| -rw-r--r-- | src/python/stdlib/test/crashers/gc_has_finalizer.py | 36 |
1 files changed, 0 insertions, 36 deletions
diff --git a/src/python/stdlib/test/crashers/gc_has_finalizer.py b/src/python/stdlib/test/crashers/gc_has_finalizer.py deleted file mode 100644 index 737959b..0000000 --- a/src/python/stdlib/test/crashers/gc_has_finalizer.py +++ /dev/null @@ -1,36 +0,0 @@ -""" -The gc module can still invoke arbitrary Python code and crash. -This is an attack against _PyInstance_Lookup(), which is documented -as follows: - - The point of this routine is that it never calls arbitrary Python - code, so is always "safe": all it does is dict lookups. - -But of course dict lookups can call arbitrary Python code. -The following code causes mutation of the object graph during -the call to has_finalizer() in gcmodule.c, and that might -segfault. -""" - -import gc - - -class A: - def __hash__(self): - return hash("__del__") - def __eq__(self, other): - del self.other - return False - -a = A() -b = A() - -a.__dict__[b] = 'A' - -a.other = b -b.other = a - -gc.collect() -del a, b - -gc.collect() |
