Roundup Robot added the comment:
New changeset 4ee8d38398d4 by Serhiy Storchaka in branch '2.7':
Optimize the test for issue #13454.
http://hg.python.org/cpython/rev/4ee8d38398d4
New changeset d391b2849a51 by Serhiy Storchaka in branch '3.2':
Optimize the test for issue #13454.
Roundup Robot added the comment:
New changeset f7e14a1af609 by Serhiy Storchaka in branch '3.2':
Issue #13454: Fix a crash when deleting an iterator created by itertools.tee()
http://hg.python.org/cpython/rev/f7e14a1af609
New changeset eff2a7346243 by Serhiy Storchaka in branch '3.3':
Issue
Changes by Serhiy Storchaka storch...@gmail.com:
--
resolution: - fixed
stage: patch review - committed/rejected
status: open - closed
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13454
Serhiy Storchaka added the comment:
If no one objects I will commit this next week.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13454
___
___
Serhiy Storchaka added the comment:
Good point. Here is updated patch.
--
Added file:
http://bugs.python.org/file28467/itertools_tee_nonrecursive_clear_2.patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13454
Serhiy Storchaka added the comment:
Ping.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13454
___
___
Python-bugs-list mailing list
Changes by Serhiy Storchaka storch...@gmail.com:
--
assignee: - serhiy.storchaka
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13454
___
___
Georg Brandl added the comment:
The patch replaces a
Py_CLEAR(tdo-nextlink)
with a construct that does, basically, something like this several times:
Py_DECREF(tdo-nextlink)
tdo-nextlink
which is what leads to the issues that Py_CLEAR is supposed to prevent.
Therefore I think this patch
Serhiy Storchaka added the comment:
Please review.
--
keywords: +needs review
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13454
___
___
Changes by Serhiy Storchaka storch...@gmail.com:
Removed file:
http://bugs.python.org/file27568/itertools_tee_nonrecursive_clear.patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13454
___
Changes by Serhiy Storchaka storch...@gmail.com:
Added file:
http://bugs.python.org/file27578/itertools_tee_nonrecursive_clear.patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13454
___
Serhiy Storchaka added the comment:
Here is a patch (tests included). Thank Pyry for report, Victor and Amaury for
analysis.
Maybe I picked up the poor names for iterators? May be exhausted and
unexhausted would be better? Feel free to correct me.
--
keywords: +patch
nosy:
Antoine Pitrou added the comment:
Serhiy, I only see a test in your patch, no actual modification to itertools.
--
nosy: +pitrou
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13454
___
Changes by Serhiy Storchaka storch...@gmail.com:
Removed file:
http://bugs.python.org/file27566/itertools_tee_nonrecursive_clear.patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13454
___
Serhiy Storchaka added the comment:
Oh, I worked on it in a different directory. Fortunately I found a temporary
copy and I do not have to write all code again. Sorry.
--
Added file:
http://bugs.python.org/file27568/itertools_tee_nonrecursive_clear.patch
New submission from Pyry Pakkanen frostb...@suomi24.fi:
Running the following results in a Segmentation fault on Ubuntu 11.10 64-bit
with both python and python3.
from itertools import *
c = count()
a,b = tee(c)
for i in range(1000):
next(a)
del(b)
--
messages: 148124
nosy: PyryP
STINNER Victor victor.stin...@haypocalc.com added the comment:
tee() uses a linked-list of teedataobject. This list is destroyed by recursive
calls to teedataobject_dealloc().
Extract of the gdb trace:
#5 0x08171a8e in teedataobject_clear (tdo=0xad21b394) at
./Modules/itertoolsmodule.c:412
Ezio Melotti ezio.melo...@gmail.com added the comment:
Confirmed on py3k, it doesn't seem to happen with smaller values.
--
components: +Extension Modules
nosy: +ezio.melotti, rhettinger
stage: - test needed
versions: +Python 3.3
___
Python tracker
Amaury Forgeot d'Arc amaur...@gmail.com added the comment:
Also, a check for NULL would not hurt in tee_next():
diff -r 1e0e821d2626 Modules/itertoolsmodule.c
--- a/Modules/itertoolsmodule.c Fri Nov 04 22:17:45 2011 +0100
+++ b/Modules/itertoolsmodule.c Tue Nov 22 17:24:42 2011 +0100
@@ -475,6
19 matches
Mail list logo