classification
Title: regexp: zero-width matches in MIN_UNTIL
Type: crash Stage: resolved
Components: Extension Modules, Regular Expressions Versions: Python 3.4, Python 3.2, Python 3.3, Python 2.7
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: serhiy.storchaka Nosy List: arigo, ezio.melotti, mrabarnett, pitrou, python-dev, serhiy.storchaka
Priority: normal Keywords: patch

Created on 2010-08-24 13:12 by arigo, last changed 2013-02-16 21:59 by serhiy.storchaka. This issue is now closed.

Files
File name Uploaded Description Edit
empty_minuntil.py arigo, 2010-08-24 13:12 Instantaneous infinite memory leaker
issue9669.patch mrabarnett, 2013-01-15 21:08
Messages (5)
msg114785 - (view) Author: Armin Rigo (arigo) * (Python committer) Date: 2010-08-24 13:12
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 ("+", "*").
msg180051 - (view) Author: Matthew Barnett (mrabarnett) * Date: 2013-01-15 21:08
I've attached my attempt at a patch.
msg180519 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2013-01-24 11:32
Can you please provide the tests?
msg182237 - (view) Author: Roundup Robot (python-dev) Date: 2013-02-16 19:28
New changeset dc8a11c16021 by Serhiy Storchaka in branch '2.7':
Issue #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 #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 #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 #9669: Protect re against infinite loops on zero-width matching in
http://hg.python.org/cpython/rev/aa17a0dab86a
msg182243 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2013-02-16 21:58
Committed with a test. Thank you, Matthew.
History
Date User Action Args
2013-02-16 21:59:22serhiy.storchakasetstatus: open -> closed
assignee: serhiy.storchaka
resolution: fixed
stage: patch review -> resolved
2013-02-16 21:58:55serhiy.storchakasetmessages: + msg182243
2013-02-16 19:28:50python-devsetnosy: + python-dev
messages: + msg182237
2013-02-05 17:31:08serhiy.storchakalinkissue12177 superseder
2013-01-24 11:32:05serhiy.storchakasetnosy: + serhiy.storchaka
messages: + msg180519
2013-01-15 21:46:48serhiy.storchakasetstage: needs patch -> patch review
2013-01-15 21:08:26mrabarnettsetfiles: + issue9669.patch
keywords: + patch
messages: + msg180051
2013-01-15 19:27:24serhiy.storchakasetcomponents: + Regular Expressions
2013-01-15 19:26:56serhiy.storchakasetstage: needs patch
versions: + Python 3.2, Python 3.3, Python 3.4
2010-11-01 15:17:20ezio.melottisetnosy: + mrabarnett
2010-08-27 18:46:24terry.reedysetnosy: + pitrou, ezio.melotti
2010-08-24 13:12:03arigocreate