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

regexp: zero-width matches in MIN_UNTIL #53878

Closed
arigo mannequin opened this issue Aug 24, 2010 · 5 comments
Closed

regexp: zero-width matches in MIN_UNTIL #53878

arigo mannequin opened this issue Aug 24, 2010 · 5 comments
Assignees
Labels
extension-modules C modules in the Modules dir topic-regex type-crash A hard crash of the interpreter, possibly with a core dump

Comments

@arigo
Copy link
Mannequin

arigo mannequin commented Aug 24, 2010

BPO 9669
Nosy @arigo, @pitrou, @ezio-melotti, @serhiy-storchaka
Files
  • empty_minuntil.py: Instantaneous infinite memory leaker
  • issue9669.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 2013-02-16.21:59:22.380>
    created_at = <Date 2010-08-24.13:12:03.172>
    labels = ['extension-modules', 'expert-regex', 'type-crash']
    title = 'regexp: zero-width matches in MIN_UNTIL'
    updated_at = <Date 2013-02-16.21:59:22.380>
    user = 'https://github.com/arigo'

    bugs.python.org fields:

    activity = <Date 2013-02-16.21:59:22.380>
    actor = 'serhiy.storchaka'
    assignee = 'serhiy.storchaka'
    closed = True
    closed_date = <Date 2013-02-16.21:59:22.380>
    closer = 'serhiy.storchaka'
    components = ['Extension Modules', 'Regular Expressions']
    creation = <Date 2010-08-24.13:12:03.172>
    creator = 'arigo'
    dependencies = []
    files = ['18628', '28744']
    hgrepos = []
    issue_num = 9669
    keywords = ['patch']
    message_count = 5.0
    messages = ['114785', '180051', '180519', '182237', '182243']
    nosy_count = 6.0
    nosy_names = ['arigo', 'pitrou', 'ezio.melotti', 'mrabarnett', 'python-dev', 'serhiy.storchaka']
    pr_nums = []
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'crash'
    url = 'https://bugs.python.org/issue9669'
    versions = ['Python 2.7', 'Python 3.2', 'Python 3.3', 'Python 3.4']

    @arigo
    Copy link
    Mannequin Author

    arigo mannequin commented Aug 24, 2010

    The attached example shows a case where the '_sre' module goes into an instantaneous infinite memory leak. The bug (and probably the fix too) is related to empty matches in the MIN_UNTIL operator ("+?", "*?"). It looks very similar to the bug and fix already checked in about the MAX_UNTIL operator ("+", "*").

    @arigo arigo mannequin added extension-modules C modules in the Modules dir type-crash A hard crash of the interpreter, possibly with a core dump labels Aug 24, 2010
    @mrabarnett
    Copy link
    Mannequin

    mrabarnett mannequin commented Jan 15, 2013

    I've attached my attempt at a patch.

    @serhiy-storchaka
    Copy link
    Member

    Can you please provide the tests?

    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented Feb 16, 2013

    New changeset dc8a11c16021 by Serhiy Storchaka in branch '2.7':
    Issue bpo-9669: Protect re against infinite loops on zero-width matching in
    http://hg.python.org/cpython/rev/dc8a11c16021

    New changeset d40afd489b6a by Serhiy Storchaka in branch '3.2':
    Issue bpo-9669: Protect re against infinite loops on zero-width matching in
    http://hg.python.org/cpython/rev/d40afd489b6a

    New changeset 8f9b628593db by Serhiy Storchaka in branch '3.3':
    Issue bpo-9669: Protect re against infinite loops on zero-width matching in
    http://hg.python.org/cpython/rev/8f9b628593db

    New changeset aa17a0dab86a by Serhiy Storchaka in branch 'default':
    Issue bpo-9669: Protect re against infinite loops on zero-width matching in
    http://hg.python.org/cpython/rev/aa17a0dab86a

    @serhiy-storchaka
    Copy link
    Member

    Committed with a test. Thank you, Matthew.

    @serhiy-storchaka serhiy-storchaka self-assigned this Feb 16, 2013
    @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
    extension-modules C modules in the Modules dir topic-regex type-crash A hard crash of the interpreter, possibly with a core dump
    Projects
    None yet
    Development

    No branches or pull requests

    1 participant