Bug 52540 - Regression: Some text-only e-mails causes 100% cpu load
Summary: Regression: Some text-only e-mails causes 100% cpu load
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: 528+ (Nightly build)
Hardware: Macintosh Intel OS X 10.6
: P1 Normal
Assignee: Michael Saboff
URL:
Keywords: InRadar, Regression
: 52662 (view as bug list)
Depends on:
Blocks:
 
Reported: 2011-01-16 11:46 PST by Alexander Zautke
Modified: 2011-01-18 15:31 PST (History)
5 users (show)

See Also:


Attachments
Screenshot of a top command in terminal (14.55 KB, image/png)
2011-01-16 11:46 PST, Alexander Zautke
no flags Details
Sample of MiniBrowser taken with Activity Monitor (23.87 KB, text/plain)
2011-01-17 05:03 PST, Alexander Zautke
no flags Details
Sample of WebProcess taken with Activity Monitor (26.05 KB, text/plain)
2011-01-17 05:03 PST, Alexander Zautke
no flags Details
Sample of WebKit taken with Activity Monitor (36.27 KB, text/plain)
2011-01-17 09:18 PST, Alexander Zautke
no flags Details
Patch to attach nested sub parens to outer non-capturing parens (6.40 KB, patch)
2011-01-18 15:16 PST, Michael Saboff
oliver: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Alexander Zautke 2011-01-16 11:46:22 PST
Created attachment 79105 [details]
Screenshot of a top command in terminal

1. I opened a text-only,not a html-email, in MobileMe.
2. WebKit locks down completly (100% cpu).
3. If you try it in the MiniBrowser for WebKit2,WebProcess caues the 100% cpu load (see attachment).
Comment 1 Alexey Proskuryakov 2011-01-16 22:12:41 PST
Could you please attach a sample of both MiniBrowser and WebProcess processes, taken with Activity Monitor application?

Without a reproducible case or at least samples, there is nothing we can do here.
Comment 2 Alexander Zautke 2011-01-17 05:03:00 PST
Created attachment 79156 [details]
Sample of MiniBrowser taken with Activity Monitor
Comment 3 Alexander Zautke 2011-01-17 05:03:54 PST
Created attachment 79157 [details]
Sample of WebProcess taken with Activity Monitor
Comment 4 Alexey Proskuryakov 2011-01-17 08:48:03 PST
In JSC::RegExp::match(). It's strange if this doesn't happen in WebKit nightlies, there shouldn't be any difference in  JavaScriptCore behavior in WebKit2.
Comment 5 Alexander Zautke 2011-01-17 09:18:56 PST
Created attachment 79181 [details]
Sample of WebKit taken with Activity Monitor
Comment 6 Geoffrey Garen 2011-01-17 14:43:54 PST
<rdar://problem/8875432>
Comment 7 Michael Saboff 2011-01-17 17:07:29 PST
I am unable to reproduce with either ToT or nightly build with Safari.  Please provide a sample email that will cause the problem.
Comment 8 Alexander Zautke 2011-01-18 07:17:34 PST
For example, I can not open the e-mail you get from bugzilla, if someone comment on this bug.
Comment 9 Alexey Proskuryakov 2011-01-18 09:05:10 PST
Confirmed with r75891! I forwarded this e-mail to my MobileMe account with Mail.app's Message->Redirect menu item.
Comment 10 Michael Saboff 2011-01-18 10:25:37 PST
Got it!.  The problem RE is /(([\w\-]+:\/\/?|www[.])[^\s()<>]+(?:([\w\d]+)|([^\[:punct:\]\s()<>\W]|\/)))/.

I have reduced it to: /([^\s]+(?:([\w]+)|([^\W])))/ with the input of:
    "https://bugs.webkit.org/show_bug.cgi?id=52540\n"

The trailing 'n' is needed for the hang.

Debugging now.....
Comment 11 Michael Saboff 2011-01-18 15:16:35 PST
Created attachment 79342 [details]
Patch to attach nested sub parens to outer non-capturing parens

Directly use backtrack label with parentheses nested under a non-capturing parentheses.  Also linked current parentheses tail code object for possible parens nested within a non-capturing parentheses.
Comment 12 Oliver Hunt 2011-01-18 15:22:06 PST
*** Bug 52662 has been marked as a duplicate of this bug. ***
Comment 13 Michael Saboff 2011-01-18 15:31:56 PST
Committed r76076: <http://trac.webkit.org/changeset/76076>