Merged revisions 76763 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk ........ r76763 | antoine.pitrou | 2009-12-12 20:13:08 +0100 (sam., 12 déc. 2009) | 7 lines Issue #7466: segmentation fault when the garbage collector is called in the middle of populating a tuple. Patch by Florent Xicluna. (note: no NEWS entry for trunk since the bug was introduced in 2.7/3.1) ........
This commit is contained in:
parent
05d2e08401
commit
6b7dfc924d
@ -146,6 +146,9 @@ class TupleTest(seq_tests.CommonTest):
|
|||||||
pass
|
pass
|
||||||
self.check_track_dynamic(MyTuple, True)
|
self.check_track_dynamic(MyTuple, True)
|
||||||
|
|
||||||
|
def test_bug7466(self):
|
||||||
|
# Trying to untrack an unfinished tuple could crash Python
|
||||||
|
self._not_tracked(tuple(gc.collect() for i in range(101)))
|
||||||
|
|
||||||
def test_main():
|
def test_main():
|
||||||
support.run_unittest(TupleTest)
|
support.run_unittest(TupleTest)
|
||||||
|
@ -12,6 +12,9 @@ What's New in Python 3.2 Alpha 1?
|
|||||||
Core and Builtins
|
Core and Builtins
|
||||||
-----------------
|
-----------------
|
||||||
|
|
||||||
|
- Issue #7466: segmentation fault when the garbage collector is called
|
||||||
|
in the middle of populating a tuple. Patch by Florent Xicluna.
|
||||||
|
|
||||||
- Issue #7419: setlocale() could crash the interpreter on Windows when called
|
- Issue #7419: setlocale() could crash the interpreter on Windows when called
|
||||||
with invalid values.
|
with invalid values.
|
||||||
|
|
||||||
|
@ -850,7 +850,8 @@ _PyTuple_Resize(PyObject **pv, Py_ssize_t newsize)
|
|||||||
|
|
||||||
/* XXX UNREF/NEWREF interface should be more symmetrical */
|
/* XXX UNREF/NEWREF interface should be more symmetrical */
|
||||||
_Py_DEC_REFTOTAL;
|
_Py_DEC_REFTOTAL;
|
||||||
_PyObject_GC_UNTRACK(v);
|
if (_PyObject_GC_IS_TRACKED(v))
|
||||||
|
_PyObject_GC_UNTRACK(v);
|
||||||
_Py_ForgetReference((PyObject *) v);
|
_Py_ForgetReference((PyObject *) v);
|
||||||
/* DECREF items deleted by shrinkage */
|
/* DECREF items deleted by shrinkage */
|
||||||
for (i = newsize; i < oldsize; i++) {
|
for (i = newsize; i < oldsize; i++) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user