[issue13454] crash when deleting one pair from tee()
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. http://hg.python.org/cpython/rev/d391b2849a51 New changeset 2258b4d89c9f by Serhiy Storchaka in branch '3.3': Optimize the test for issue #13454. http://hg.python.org/cpython/rev/2258b4d89c9f New changeset 1f57fb5e1e8e by Serhiy Storchaka in branch 'default': Optimize the test for issue #13454. http://hg.python.org/cpython/rev/1f57fb5e1e8e -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13454 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13454] crash when deleting one pair from tee()
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 #13454: Fix a crash when deleting an iterator created by itertools.tee() http://hg.python.org/cpython/rev/eff2a7346243 New changeset 02d7a127fdfb by Serhiy Storchaka in branch 'default': Issue #13454: Fix a crash when deleting an iterator created by itertools.tee() http://hg.python.org/cpython/rev/02d7a127fdfb New changeset 62f2d3f6015e by Serhiy Storchaka in branch '2.7': Issue #13454: Fix a crash when deleting an iterator created by itertools.tee() http://hg.python.org/cpython/rev/62f2d3f6015e -- nosy: +python-dev ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13454 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13454] crash when deleting one pair from tee()
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 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13454] crash when deleting one pair from tee()
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 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13454] crash when deleting one pair from tee()
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 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13454] crash when deleting one pair from tee()
Serhiy Storchaka added the comment: Ping. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13454 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13454] crash when deleting one pair from tee()
Changes by Serhiy Storchaka storch...@gmail.com: -- assignee: - serhiy.storchaka ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13454 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13454] crash when deleting one pair from tee()
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 is not correct. -- nosy: +georg.brandl ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13454 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13454] crash when deleting one pair from tee()
Serhiy Storchaka added the comment: Please review. -- keywords: +needs review ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13454 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13454] crash when deleting one pair from tee()
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 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13454] crash when deleting one pair from tee()
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 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13454] crash when deleting one pair from tee()
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: +serhiy.storchaka stage: test needed - patch review versions: +Python 3.4 Added file: http://bugs.python.org/file27566/itertools_tee_nonrecursive_clear.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13454 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13454] crash when deleting one pair from tee()
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 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13454] crash when deleting one pair from tee()
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 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13454] crash when deleting one pair from tee()
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 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13454 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13454] crash when deleting one pair from tee()
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 priority: normal severity: normal status: open title: crash when deleting one pair from tee() type: crash versions: Python 2.7, Python 3.2 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13454 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13454] crash when deleting one pair from tee()
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 #6 0x08171b39 in teedataobject_dealloc (tdo=0xad21b394) at ./Modules/itertoolsmodule.c:421 #7 0x0805ed3d in _Py_Dealloc (op=itertools.tee_dataobject at remote 0xad21b394) at Objects/object.c:1676 #8 0x08171b16 in teedataobject_clear (tdo=0xad21b274) at ./Modules/itertoolsmodule.c:413 #9 0x08171b39 in teedataobject_dealloc (tdo=0xad21b274) at ./Modules/itertoolsmodule.c:421 #10 0x0805ed3d in _Py_Dealloc (op=itertools.tee_dataobject at remote 0xad21b274) at Objects/object.c:1676 #11 0x08171b16 in teedataobject_clear (tdo=0xad21b154) at ./Modules/itertoolsmodule.c:413 #12 0x08171b39 in teedataobject_dealloc (tdo=0xad21b154) at ./Modules/itertoolsmodule.c:421 #13 0x0805ed3d in _Py_Dealloc (op=itertools.tee_dataobject at remote 0xad21b154) at Objects/object.c:1676 #14 0x08171b16 in teedataobject_clear (tdo=0xad21b034) at ./Modules/itertoolsmodule.c:413 #15 0x08171b39 in teedataobject_dealloc (tdo=0xad21b034) at ./Modules/itertoolsmodule.c:421 #16 0x0805ed3d in _Py_Dealloc (op=itertools.tee_dataobject at remote 0xad21b034) at Objects/object.c:1676 #17 0x08171b16 in teedataobject_clear (tdo=0xad292ed4) at ./Modules/itertoolsmodule.c:413 #18 0x08171b39 in teedataobject_dealloc (tdo=0xad292ed4) at ./Modules/itertoolsmodule.c:421 #19 0x0805ed3d in _Py_Dealloc (op=itertools.tee_dataobject at remote 0xad292ed4) at Objects/object.c:1676 #20 0x08171b16 in teedataobject_clear (tdo=0xad292db4) at ./Modules/itertoolsmodule.c:413 #21 0x08171b39 in teedataobject_dealloc (tdo=0xad292db4) at ./Modules/itertoolsmodule.c:421 #22 0x0805ed3d in _Py_Dealloc (op=itertools.tee_dataobject at remote 0xad292db4) at Objects/object.c:1676 #23 0x08171b16 in teedataobject_clear (tdo=0xad292c94) at ./Modules/itertoolsmodule.c:413 -- nosy: +haypo ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13454 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13454] crash when deleting one pair from tee()
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 rep...@bugs.python.org http://bugs.python.org/issue13454 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13454] crash when deleting one pair from tee()
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 +475,8 @@ if (to-index = LINKCELLS) { link = teedataobject_jumplink(to-dataobj); +if (link == NULL) +return NULL; Py_DECREF(to-dataobj); to-dataobj = (teedataobject *)link; to-index = 0; -- nosy: +amaury.forgeotdarc ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13454 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com