mirror of
https://github.com/python/cpython.git
synced 2025-11-03 19:34:08 +00:00
Add testcase for SF bug 574207 (chained __slots__ dealloc segfault).
Fix forthcoming.
This commit is contained in:
parent
2d3c03df9a
commit
2d702465b3
1 changed files with 14 additions and 0 deletions
|
|
@ -3219,6 +3219,19 @@ def subtype_resurrection():
|
||||||
# it as a leak.
|
# it as a leak.
|
||||||
del C.__del__
|
del C.__del__
|
||||||
|
|
||||||
|
def slottrash():
|
||||||
|
# Deallocating deeply nested slotted trash caused stack overflows
|
||||||
|
if verbose:
|
||||||
|
print "Testing slot trash..."
|
||||||
|
class trash(object):
|
||||||
|
__slots__ = ['x']
|
||||||
|
def __init__(self, x):
|
||||||
|
self.x = x
|
||||||
|
o = None
|
||||||
|
for i in xrange(50000):
|
||||||
|
o = trash(o)
|
||||||
|
del o
|
||||||
|
|
||||||
def do_this_first():
|
def do_this_first():
|
||||||
if verbose:
|
if verbose:
|
||||||
print "Testing SF bug 551412 ..."
|
print "Testing SF bug 551412 ..."
|
||||||
|
|
@ -3310,6 +3323,7 @@ def test_main():
|
||||||
copy_setstate()
|
copy_setstate()
|
||||||
slices()
|
slices()
|
||||||
subtype_resurrection()
|
subtype_resurrection()
|
||||||
|
slottrash()
|
||||||
if verbose: print "All OK"
|
if verbose: print "All OK"
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue