This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author benspiller
Recipients benspiller, ezio.melotti, mrabarnett
Date 2019-02-06.16:17:37
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1549469857.93.0.911634458861.issue35915@roundup.psfhosted.org>
In-reply-to
Content
These work fine and return instantly:
python -c "import re;  re.compile('.*x').match('y'*(1000*100))"
python -c "import re;  re.compile('x').search('y'*(1000*100))"
python -c "import re;  re.compile('.*x').search('y'*(1000*10))"

This hangs / freezes / livelocks indefinitely, with lots of CPU usage:
python -c "import re;  re.compile('.*x').search('y'*(1000*100))"

Admittedly performing a search() with a pattern starting .* isn't useful, however it's worth fixing as:
- it's easily done by inexperienced developers, or users interacting with code that's far removed from the actual regex call
- the failure mode of hanging forever (with the GIL held, of course) is quite severe (took us a lot of debugging with gdb before we figured out where our complex multi-threaded python program was hanging!), and 
- the fact that the behaviour is different based on the length of the string being matched suggests there is some kind of underlying bug in how the buffer is handled whcih might also affect other, more reasonable regex use cases
History
Date User Action Args
2019-02-06 16:17:40benspillersetrecipients: + benspiller, ezio.melotti, mrabarnett
2019-02-06 16:17:37benspillersetmessageid: <1549469857.93.0.911634458861.issue35915@roundup.psfhosted.org>
2019-02-06 16:17:37benspillerlinkissue35915 messages
2019-02-06 16:17:37benspillercreate