[Python-checkins] r75750 - in python/branches/release26-maint: Misc/ACKS Misc/NEWS Objects/listobject.c
antoine.pitrou
python-checkins at python.org
Tue Oct 27 13:56:06 CET 2009
Author: antoine.pitrou
Date: Tue Oct 27 13:56:06 2009
New Revision: 75750
Log:
Merged revisions 75367 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r75367 | antoine.pitrou | 2009-10-11 23:03:26 +0200 (dim., 11 oct. 2009) | 4 lines
Issue #7084: Fix a (very unlikely) crash when printing a list from one
thread, and mutating it from another one. Patch by Scott Dial.
........
Modified:
python/branches/release26-maint/ (props changed)
python/branches/release26-maint/Misc/ACKS
python/branches/release26-maint/Misc/NEWS
python/branches/release26-maint/Objects/listobject.c
Modified: python/branches/release26-maint/Misc/ACKS
==============================================================================
--- python/branches/release26-maint/Misc/ACKS (original)
+++ python/branches/release26-maint/Misc/ACKS Tue Oct 27 13:56:06 2009
@@ -167,6 +167,7 @@
Erik Demaine
Roger Dev
Raghuram Devarakonda
+Scott Dial
Toby Dickenson
Mark Dickinson
Daniel Diniz
Modified: python/branches/release26-maint/Misc/NEWS
==============================================================================
--- python/branches/release26-maint/Misc/NEWS (original)
+++ python/branches/release26-maint/Misc/NEWS Tue Oct 27 13:56:06 2009
@@ -16,6 +16,9 @@
fixes the problem of some exceptions being thrown at shutdown when the
interpreter is killed. Patch by Adam Olsen.
+- Issue #7084: Fix a (very unlikely) crash when printing a list from one
+ thread, and mutating it from another one. Patch by Scott Dial.
+
Library
-------
Modified: python/branches/release26-maint/Objects/listobject.c
==============================================================================
--- python/branches/release26-maint/Objects/listobject.c (original)
+++ python/branches/release26-maint/Objects/listobject.c Tue Oct 27 13:56:06 2009
@@ -319,6 +319,7 @@
{
int rc;
Py_ssize_t i;
+ PyObject *item;
rc = Py_ReprEnter((PyObject*)op);
if (rc != 0) {
@@ -333,15 +334,19 @@
fprintf(fp, "[");
Py_END_ALLOW_THREADS
for (i = 0; i < Py_SIZE(op); i++) {
+ item = op->ob_item[i];
+ Py_INCREF(item);
if (i > 0) {
Py_BEGIN_ALLOW_THREADS
fprintf(fp, ", ");
Py_END_ALLOW_THREADS
}
- if (PyObject_Print(op->ob_item[i], fp, 0) != 0) {
+ if (PyObject_Print(item, fp, 0) != 0) {
+ Py_DECREF(item);
Py_ReprLeave((PyObject *)op);
return -1;
}
+ Py_DECREF(item);
}
Py_BEGIN_ALLOW_THREADS
fprintf(fp, "]");
More information about the Python-checkins
mailing list