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

sre bug: lastmark_save/restore #53380

Closed
arigo mannequin opened this issue Jun 30, 2010 · 5 comments
Closed

sre bug: lastmark_save/restore #53380

arigo mannequin opened this issue Jun 30, 2010 · 5 comments
Assignees
Labels
3.11 only security fixes extension-modules C modules in the Modules dir topic-regex type-bug An unexpected behavior, bug, or error

Comments

@arigo
Copy link
Mannequin

arigo mannequin commented Jun 30, 2010

BPO 9134
Nosy @ezio-melotti, @serhiy-storchaka, @animalize, @tirkarthi
Files
  • x.py: Bug case
  • 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 2022-03-29.15:30:16.865>
    created_at = <Date 2010-06-30.21:18:56.596>
    labels = ['extension-modules', 'expert-regex', 'type-bug', '3.11']
    title = 'sre bug: lastmark_save/restore'
    updated_at = <Date 2022-03-29.15:30:16.864>
    user = 'https://github.com/arigo'

    bugs.python.org fields:

    activity = <Date 2022-03-29.15:30:16.864>
    actor = 'serhiy.storchaka'
    assignee = 'serhiy.storchaka'
    closed = True
    closed_date = <Date 2022-03-29.15:30:16.865>
    closer = 'serhiy.storchaka'
    components = ['Extension Modules', 'Regular Expressions']
    creation = <Date 2010-06-30.21:18:56.596>
    creator = 'arigo'
    dependencies = []
    files = ['17822']
    hgrepos = []
    issue_num = 9134
    keywords = []
    message_count = 5.0
    messages = ['109019', '109034', '224499', '224502', '416267']
    nosy_count = 5.0
    nosy_names = ['ezio.melotti', 'abacabadabacaba', 'serhiy.storchaka', 'malin', 'xtreak']
    pr_nums = []
    priority = 'normal'
    resolution = 'out of date'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue9134'
    versions = ['Python 3.11']

    @arigo
    Copy link
    Mannequin Author

    arigo mannequin commented Jun 30, 2010

    The re module is buggy is rare cases; see attached example script.

    The bug is caused by the macros LASTMARK_SAVE and LASTMARK_RESTORE which are sometimes used without the extra code that does if (state->repeat) {mark_save()/mark_restore()}.

    The bug appears by mis-reporting the position of groups within a repeated match (with * or +), notably the position of some groups that matched in older repetitions but (after some backtracking) not in newer ones.

    @arigo arigo mannequin added the extension-modules C modules in the Modules dir label Jun 30, 2010
    @ezio-melotti ezio-melotti added topic-regex type-bug An unexpected behavior, bug, or error labels Jun 30, 2010
    @arigo
    Copy link
    Mannequin Author

    arigo mannequin commented Jul 1, 2010

    It's pretty trivial to turn my x.py into a unit test, of course.

    @serhiy-storchaka
    Copy link
    Member

    It looks as the nature of this bug is clear to you, Armin. Do you want to write a patch?

    @arigo
    Copy link
    Mannequin Author

    arigo mannequin commented Aug 1, 2014

    It was clear to me four years ago. Now I'd have to dig again as much as you do.

    @serhiy-storchaka serhiy-storchaka added the 3.7 (EOL) end of life label Nov 16, 2017
    @serhiy-storchaka serhiy-storchaka self-assigned this Nov 16, 2017
    @serhiy-storchaka serhiy-storchaka added the 3.8 only security fixes label Feb 18, 2019
    @serhiy-storchaka
    Copy link
    Member

    Fixed in bpo-35859 together with other bugs, but the fix was only applied to 3.11, because that bug is old and the old behavior matches the behavior in some other engines (Perl and Java).

    @serhiy-storchaka serhiy-storchaka added 3.11 only security fixes and removed 3.7 (EOL) end of life 3.8 only security fixes labels Mar 29, 2022
    @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
    3.11 only security fixes extension-modules C modules in the Modules dir topic-regex type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants