Skip to content

Crash on deleting Element attribute #69877

Closed

Description

@serhiy-storchaka
BPO 25691
Nosy @scoder, @larryhastings, @vadmium, @serhiy-storchaka
Files
  • etree_del_attributes.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 = None
    closed_at = <Date 2015-11-23.07:01:10.423>
    created_at = <Date 2015-11-21.17:04:39.640>
    labels = ['extension-modules', 'type-crash']
    title = 'Crash on deleting Element attribute'
    updated_at = <Date 2015-11-23.07:28:15.898>
    user = 'https://github.com/serhiy-storchaka'

    bugs.python.org fields:

    activity = <Date 2015-11-23.07:28:15.898>
    actor = 'larry'
    assignee = 'none'
    closed = True
    closed_date = <Date 2015-11-23.07:01:10.423>
    closer = 'serhiy.storchaka'
    components = ['Extension Modules']
    creation = <Date 2015-11-21.17:04:39.640>
    creator = 'serhiy.storchaka'
    dependencies = []
    files = ['41114']
    hgrepos = []
    issue_num = 25691
    keywords = ['patch']
    message_count = 5.0
    messages = ['255063', '255125', '255129', '255132', '255134']
    nosy_count = 6.0
    nosy_names = ['scoder', 'larry', 'eli.bendersky', 'python-dev', 'martin.panter', 'serhiy.storchaka']
    pr_nums = []
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'crash'
    url = 'https://bugs.python.org/issue25691'
    versions = ['Python 3.3', 'Python 3.4', 'Python 3.5']

    Activity

    1. serhiy-storchaka commented on Nov 21, 2015

      @serhiy-storchaka
      MemberAuthor
      >>> import xml.etree.ElementTree as ET
      >>> e = ET.Element('tag')
      >>> del e.tag
      Segmentation fault (core dumped)

      Proposed patch fixes the crash.

    2. vadmium commented on Nov 23, 2015

      @vadmium
      Member

      The patch looks good to me.

      This may be a side effect of poor documentation. I guess the documentation at <https://docs.python.org/dev/c-api/typeobj.html#c.PyTypeObject.tp_setattro\> and/or the referenced functions should mention that the they also delete attributes when the name argument is null.

    3. python-dev commented on Nov 23, 2015

      python-devmannequin
      Mannequin

      New changeset 852c9ed9115c by Serhiy Storchaka in branch '3.4':
      Issue bpo-25691: Fixed crash on deleting ElementTree.Element attributes.
      https://hg.python.org/cpython/rev/852c9ed9115c

      New changeset 3a44f06907f1 by Serhiy Storchaka in branch '3.5':
      Issue bpo-25691: Fixed crash on deleting ElementTree.Element attributes.
      https://hg.python.org/cpython/rev/3a44f06907f1

      New changeset 936fcd0ba6b1 by Serhiy Storchaka in branch 'default':
      Issue bpo-25691: Fixed crash on deleting ElementTree.Element attributes.
      https://hg.python.org/cpython/rev/936fcd0ba6b1

      New changeset e3dea2e4f93d by Serhiy Storchaka in branch '2.7':
      Issue bpo-25691: Added tests on deleting cElementTree.Element attributes.
      https://hg.python.org/cpython/rev/e3dea2e4f93d

    4. serhiy-storchaka commented on Nov 23, 2015

      @serhiy-storchaka
      MemberAuthor

      Thank you for your review Martin. Opened bpo-25701 for documenting.

      Interestingly, 2.7 is free from this bug. It has a check for NULL.

    5. larryhastings commented on Nov 23, 2015

      @larryhastings
      Contributor

      This change didn't make it into 3.5.1. It will be released with 3.5.2. I've already updated the Misc/NEWS entry.

    6. transferred this issue fromon Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Metadata

    Metadata

    Assignees

    No one assigned

      Labels

      extension-modulesC modules in the Modules dirtype-crashA hard crash of the interpreter, possibly with a core dump

      Projects

      No projects

        Milestone

        No milestone

        Relationships

        None yet

        Development

        No branches or pull requests

        Issue actions