[Webkit-unassigned] [Bug 25071] New: Certain regular expressions fail with large strings

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Apr 6 22:16:54 PDT 2009


https://bugs.webkit.org/show_bug.cgi?id=25071

           Summary: Certain regular expressions fail with large strings
           Product: WebKit
           Version: 528+ (Nightly build)
          Platform: All
        OS/Version: All
            Status: UNCONFIRMED
          Severity: Normal
          Priority: P2
         Component: JavaScriptCore
        AssignedTo: webkit-unassigned at lists.webkit.org
        ReportedBy: paul.n at cabbagetree.co.nz


When running the "test" function on certain regular expressions against large
strings, there is a tipping point at which it will fail silently (return false
when it should return true).

The tipping point may vary from system to system - not 100% sure - but the code
below assumes a tipping point of 25000 (25000 returns true, 25001 returns
false).  If both return true for you, increase the upper limit in the second
for loop to add more "a" characters to the middle of the string.

Tested in Safari 4 public beta (528.16) on 32-bit Windows Vista Business,
running on a Core2 Duo E8300 (2.83GHz) with 3GB of RAM.

Sample code to reproduce (regular expression tailored to test data and reduced
as much as possible while still being affected):

r=/("(z|a)*?"|.)+/;
s='{"';
for(i=0;i<24996;i++) s+='a';
s+='"}';
l='{"';
for(i=0;i<24997;i++) l+='a';
l+='"}';
document.getElementById('cfsavecontent').value=l;
alert(r.test(s));
alert(r.test(l));


-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.



More information about the webkit-unassigned mailing list