Summary: | Sub optimal regular expressions makes JMeter freeze (catastrophic backtracking regex) | ||
---|---|---|---|
Product: | JMeter - Now in Github | Reporter: | chamath <chamath.allneeds> |
Component: | Main | Assignee: | JMeter issues mailing list <issues> |
Status: | NEEDINFO --- | ||
Severity: | enhancement | CC: | p.mouawad |
Priority: | P2 | ||
Version: | 2.9 | ||
Target Milestone: | --- | ||
Hardware: | All | ||
OS: | All | ||
Attachments: | RegExp that got stuck. |
Hello, Could you provide the HTML code (as a text file) that is shown in screenshot and the regexp as text (not image) ? Thank you The used regex is badly composed and will take a long time on moderately long inputs. The important pieces here are, that the matching is done in the awt thread and thus blocking the GUI. Secondly Java has no standard way to interrupt regex matches. On http://stackoverflow.com/questions/910740/cancelling-a-long-running-regex-match Is a nice wrapper for charsequence, which in combination with a thread can be used to make the matching interruptible. I think I can produce a patch, but it will probably take a few days. (In reply to Felix Schumacher from comment #2) > The used regex is badly composed and will take a long time on moderately > long inputs. > > The important pieces here are, that the matching is done in the awt thread > and thus blocking the GUI. Secondly Java has no standard way to interrupt > regex matches. > > On > http://stackoverflow.com/questions/910740/cancelling-a-long-running-regex- > match > Is a nice wrapper for charsequence, which in combination with a thread can > be used to make the matching interruptible. > > I think I can produce a patch, but it will probably take a few days. Hi Felix, Do you think it's worth the work ? Badly built Regex can lead to catastrophic backtracking that would kill performance of Load Test anyway. Regards The use case is about testing a regex in the GUI. Not about using it in the tests. It would probably help to indicate, that a regex takes too long, even when used in the GUI. But I think this is more a minor bug. This issue has been migrated to GitHub: https://github.com/apache/jmeter/issues/4256 |
Created attachment 34695 [details] RegExp that got stuck. Every time I provide a invalid symbol to a regExp Tester, jmeter tool gets stuck and I will have to close the application and start the recording from the beginning. attached is a screen shot of the invalid RegExp that got stuck.