Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OrderedDict.move_to_end may cause crash in python 3.5 #69592

Closed
CruiseLiu mannequin opened this issue Oct 14, 2015 · 5 comments
Closed

OrderedDict.move_to_end may cause crash in python 3.5 #69592

CruiseLiu mannequin opened this issue Oct 14, 2015 · 5 comments
Assignees
Labels
stdlib Python modules in the Lib dir type-crash A hard crash of the interpreter, possibly with a core dump

Comments

@CruiseLiu
Copy link
Mannequin

CruiseLiu mannequin commented Oct 14, 2015

BPO 25406
Nosy @rhettinger, @ericsnowcurrently, @serhiy-storchaka
Files
  • move_to_end_issue25406.patch
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = 'https://github.com/serhiy-storchaka'
    closed_at = <Date 2015-10-14.16:26:58.814>
    created_at = <Date 2015-10-14.13:20:02.999>
    labels = ['library', 'type-crash']
    title = 'OrderedDict.move_to_end may cause crash in python 3.5'
    updated_at = <Date 2015-10-14.16:27:21.841>
    user = 'https://bugs.python.org/CruiseLiu'

    bugs.python.org fields:

    activity = <Date 2015-10-14.16:27:21.841>
    actor = 'python-dev'
    assignee = 'serhiy.storchaka'
    closed = True
    closed_date = <Date 2015-10-14.16:26:58.814>
    closer = 'serhiy.storchaka'
    components = ['Library (Lib)']
    creation = <Date 2015-10-14.13:20:02.999>
    creator = 'Cruise Liu'
    dependencies = []
    files = ['40783']
    hgrepos = []
    issue_num = 25406
    keywords = ['patch']
    message_count = 5.0
    messages = ['252991', '252996', '252999', '253004', '253005']
    nosy_count = 6.0
    nosy_names = ['rhettinger', 'python-dev', 'eric.snow', 'serhiy.storchaka', 'Cruise Liu', 'Snivy Pang']
    pr_nums = []
    priority = 'critical'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'crash'
    url = 'https://bugs.python.org/issue25406'
    versions = ['Python 3.5', 'Python 3.6']

    @CruiseLiu
    Copy link
    Mannequin Author

    CruiseLiu mannequin commented Oct 14, 2015

    Following code will crash python. Tested on linux and windows.

    Python 3.5.0 (default, Sep 20 2015, 11:28:25) 
    [GCC 5.2.0] on linux
    Type "help", "copyright", "credits" or "license" for more information.
    >>> import collections
    >>> x = collections.OrderedDict([ ('a', 1), ('b', 2), ('c', 3) ])
    >>> x.move_to_end('c', last = False)
    >>> x.move_to_end('a', last = False)
    >>> x
    Segmentation fault (core dumped)

    @CruiseLiu CruiseLiu mannequin added stdlib Python modules in the Lib dir type-crash A hard crash of the interpreter, possibly with a core dump labels Oct 14, 2015
    @serhiy-storchaka
    Copy link
    Member

    Here is a patch that fixes the issue.

    @ericsnowcurrently
    Copy link
    Member

    @serhiy, patch LGTM. Thanks for taking care of it.

    @serhiy-storchaka
    Copy link
    Member

    Thank you for your review Eric.

    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented Oct 14, 2015

    New changeset 88e6641c3dd3 by Serhiy Storchaka in branch '3.5':
    Issue bpo-25406: Fixed a bug in C implementation of OrderedDict.move_to_end()
    https://hg.python.org/cpython/rev/88e6641c3dd3

    New changeset 33d53a41daeb by Serhiy Storchaka in branch 'default':
    Issue bpo-25406: Fixed a bug in C implementation of OrderedDict.move_to_end()
    https://hg.python.org/cpython/rev/33d53a41daeb

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    stdlib Python modules in the Lib dir type-crash A hard crash of the interpreter, possibly with a core dump
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants