Skip to content

expat crash python #42389

Closed
Closed

Description

@rozhnov
mannequin
BPO 1296433
Nosy @freddrake, @brettcannon
Files
  • crash.py: this script crash python
  • expat-crash.patch: fix attempt 1
  • 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/brettcannon'
    closed_at = <Date 2006-07-01.16:33:00.000>
    created_at = <Date 2005-09-20.14:10:03.000>
    labels = ['expert-XML']
    title = 'expat crash python'
    updated_at = <Date 2006-07-01.16:33:00.000>
    user = 'https://bugs.python.org/rozhnov'

    bugs.python.org fields:

    activity = <Date 2006-07-01.16:33:00.000>
    actor = 'fdrake'
    assignee = 'brett.cannon'
    closed = True
    closed_date = None
    closer = None
    components = ['XML']
    creation = <Date 2005-09-20.14:10:03.000>
    creator = 'rozhnov'
    dependencies = []
    files = ['1783', '1784']
    hgrepos = []
    issue_num = 1296433
    keywords = []
    message_count = 7.0
    messages = ['26336', '26337', '26338', '26339', '26340', '26341', '26342']
    nosy_count = 5.0
    nosy_names = ['fdrake', 'effbot', 'nnorwitz', 'brett.cannon', 'rozhnov']
    pr_nums = []
    priority = 'high'
    resolution = 'fixed'
    stage = None
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue1296433'
    versions = ['Python 2.4']

    Activity

    1. rozhnov commented on Sep 20, 2005

      rozhnovmannequin
      MannequinAuthor

      This simple script crash python.
      Parsing of commented xml string work good.
      (i.e. raised exception not crash python)
      Buffer overflow during convertion to unicode?

      Tested on Win XP and linux with kernel 2.4 with same
      results.

    2. nnorwitz commented on Sep 22, 2005

      nnorwitzmannequin
      Mannequin

      Logged In: YES
      user_id=33168

      I can reproduce on Linux with current CVS and expat
      1.95.5-2. Note the size of the data only needs to be
      greater than 1024.

      xml = "<?xml version='1.0' encoding='iso8859'?><s>%s</s>" %
      ('a' * 1025)

      I am not certain this problem is specific to Python. It
      might be down in expat only. Need to investigate further.

    3. effbot commented on Nov 12, 2005

      effbotmannequin
      Mannequin

      Logged In: YES
      user_id=38376

      Works for me under 2.3.2 (with expat 1.95.6) and 2.4.1 (with
      expat 1.95.8).

      Try upgrading your expat and see if the problem goes away.

    4. nnorwitz commented on Nov 12, 2005

      nnorwitzmannequin
      Mannequin

      Logged In: YES
      user_id=33168

      I had recently upgraded to expat 1.95.8, so I was hopeful.
      But it still crashed for me on linux.

      I did get a better stack trace which allowed me to come up
      with a patch that solves the problem and passes all the
      tests. The patch seems a bit odd and I think there might be
      another problem going on here. It would be great if someone
      more familiar with xmlparse could take a look at the patch
      and figure out if it's right or not.

    5. brettcannon commented on Jun 30, 2006

      @brettcannon
      Member

      Logged In: YES
      user_id=357491

      Still seems to be failing even with the Expat 2.0 upgrade in
      HEAD.

    6. brettcannon commented on Jun 30, 2006

      @brettcannon
      Member

      Logged In: YES
      user_id=357491

      The fault is with Expat and not us. I have submitted a bug
      report with a possible patch at
      http://sourceforge.net/tracker/index.php?func=detail&aid=1515266&group_id=10127&atid=110127
      . I don't know what their turn-around time will be with
      this so I will email python-dev to see how long people want
      to wait on the Expat developers before we just push our own
      patch for this.

    7. freddrake commented on Jul 1, 2006

      @freddrake
      Member

      Logged In: YES
      user_id=3066

      This is now fixed in the Expat CVS with lib/xmlparse.c
      revisions 1.154 and 1.155. I've merged these into the Expat
      bundled with Python in revision 47191 (on the trunk), and
      moved the crasher test into the tests for xml.parsers.expat.

      I don't know when the next Expat release will go out yet,
      but this will keep us from being dependent on that schedule.

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

    Metadata

    Metadata

    Assignees

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions