Bug 12637
Summary: | Long-running regular expressions should be interruptible | ||
---|---|---|---|
Product: | WebKit | Reporter: | David Smith <catfish.man> |
Component: | JavaScriptCore | Assignee: | Nobody <webkit-unassigned> |
Status: | RESOLVED WORKSFORME | ||
Severity: | Normal | CC: | barraclough |
Priority: | P2 | ||
Version: | 420+ | ||
Hardware: | Mac | ||
OS: | OS X 10.4 | ||
URL: | http://www.dscoder.com/regex.html |
David Smith
Regular expressions can take arbitrarily long to match, but cannot currently be interrupted. This can lead to hangs of arbitrary length, which is probably a bad thing. The test URL will cause a fairly long pause (in the Feb. 5th nightly build), but it will eventually recover.
Attachments | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
David Smith
This is no longer nearly as serious after some regex speedups shortly after the nightly I tested with. It still causes very high cpu usage and pauses, but it doesn't freeze the browser for more than a second or so on my Core 2 Duo 2GHz machine, and the freeze time is bounded (i.e. increasing the regex size beyond a certain point doesn't increase the time).
Gavin Barraclough
The old timeout mechanism has now been deprecated, and this is handled by webkit2 - if a script runs for too long, the browser can just shoot down the webprocess.