[pypy-issue] [issue1086] cpyext: calling PyIter_Next() on a "dictionaryiterator" object crashes when the dict was modified

Stefan Behnel tracker at bugs.pypy.org
Sun Mar 11 16:48:16 CET 2012


New submission from Stefan Behnel <stefan_ml at behnel.de>:

The iterdict.pyx test crashes in the PyPy adapted Cython.

https://github.com/scoder/cython/blob/master/tests/run/iterdict.pyx#L362

    cdef int count = 0
    for i in d.iterkeys():
        d[i+1] = 5
        count += 1
        if count > 5:
            break # safety

Readable parts of the GDB stack trace:

#2  0x0000000000f2afbc in PyIter_Next ()
#3  0x00007ffff4c6ad72 in __Pyx_dict_iter_next (dict_or_iter=0x7ffff7e45350,
orig_length=140737315342408, ppos=0x7fffffffb428, pkey=0x7fffffffb418,
pvalue=0x0, pitem=0x0, is_dict=0) at iterdict.c:5714
#4  0x00007ffff4c651f6 in __pyx_pf_8iterdict_40iterdict_change_size
(__pyx_self=0x0, __pyx_v_d=0x7ffff7e45320) at iterdict.c:4007
#5  0x00007ffff4c65079 in __pyx_pw_8iterdict_41iterdict_change_size
(__pyx_self=0x0, __pyx_v_d=0x7ffff7e45320) at iterdict.c:3929

----------
messages: 4063
nosy: pypy-issue, sbehnel
priority: bug
status: unread
title: cpyext: calling PyIter_Next() on a "dictionaryiterator" object crashes when the dict was modified

________________________________________
PyPy bug tracker <tracker at bugs.pypy.org>
<https://bugs.pypy.org/issue1086>
________________________________________


More information about the pypy-issue mailing list