Bug 14981 - DEBUG builds of WebKit hang viewing Yahoo! Mail message with ~5 MB text attachment
Summary: DEBUG builds of WebKit hang viewing Yahoo! Mail message with ~5 MB text attac...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 523.x (Safari 3)
Hardware: Macintosh OS X 10.4
: P2 Normal
Assignee: Darin Adler
URL:
Keywords: InRadar, NeedsReduction
Depends on:
Blocks:
 
Reported: 2007-08-15 17:33 PDT by David Kilzer (:ddkilzer)
Modified: 2007-08-30 11:12 PDT (History)
1 user (show)

See Also:


Attachments
Test case (.tar.bz2) (256.33 KB, application/x-bzip2)
2007-08-15 17:35 PDT, David Kilzer (:ddkilzer)
no flags Details
Sample of the hang (25.25 KB, text/plain)
2007-08-15 17:35 PDT, David Kilzer (:ddkilzer)
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description David Kilzer (:ddkilzer) 2007-08-15 17:33:03 PDT
* SUMMARY
When viewing a Yahoo! Mail message with a ~5 MB text attachment, a debug build of ToT WebKit hangs rendering the page.  It seems to be an infinite loop as I waited 5-10 minutes on a Quad G5 for the page to finish, but never did.

* STEPS TO REPRODUCE
1. Launch Safari with debug build of WebKit.
2. Open test case.

* RESULTS
WebKit hangs rendering the page.

* REGRESSION
Unknown.  Tested with a local debug build of WebKit r25099 with Safari 3 Public Beta v. 3.0.3 (522.12.1) on Mac OS X 10.4.10 (8R218) on a Quad G5 2.5 Mhz.

Also tested with a local debug build of WebKit r25090 with Safari 3 Public Beta v. 3.0.3 (522.12.1) on Mac OS X 10.4.10 (8R218) on a PowerBook G4 1.5 MHz.
Comment 1 David Kilzer (:ddkilzer) 2007-08-15 17:35:02 PDT
Created attachment 15989 [details]
Test case (.tar.bz2)

This is the test case.  Unarchive it and open long-message.html.

$ tar xjvf long-message.tar.bz2
Comment 2 David Kilzer (:ddkilzer) 2007-08-15 17:35:50 PDT
Created attachment 15990 [details]
Sample of the hang

Sample taken of the hang:

$ sample Safari 10 10
Comment 3 David Kilzer (:ddkilzer) 2007-08-15 17:40:08 PDT
<rdar://problem/5414480>
Comment 4 Adam Roben (:aroben) 2007-08-15 17:52:13 PDT
I see the same issue on Windows Server 2003 R2. Debug build hangs forever in layout, and Release build doesn't break a sweat.
Comment 5 Geoffrey Garen 2007-08-15 19:46:07 PDT
From the sample, it looks like the hang is in the new RenderFlow::checkConsistency (a debug-only function). This might indicate a problem in the way that function was written, or a real bug in the render tree that just happens to escape crashing in release builds.
Comment 6 Darin Adler 2007-08-19 16:23:59 PDT
(In reply to comment #5)
> From the sample, it looks like the hang is in the new
> RenderFlow::checkConsistency (a debug-only function). This might indicate a
> problem in the way that function was written, or a real bug in the render tree
> that just happens to escape crashing in release builds.

Or the consistency check might just have bad performance. If it has a poorer complexity curve than the real code, then we might get hangs due to the consistency check that don't reflect any real problem at all.
Comment 7 Darin Adler 2007-08-19 16:25:24 PDT
Seems fine to turn off the consistency checks and use a macro to turn them on when needed.

As with the hash table consistency checks, they're valuable, but by their nature can be slow on pages where the real algorithm is still quite fast.
Comment 8 Antti Koivisto 2007-08-20 15:54:25 PDT
RenderFlow::checkConsistency() just makes this case O(n^2) by iterating over all line boxes for each line box created. Might make debugging some real performance problems with debug build harder, otherwise not a big deal.
Comment 9 Darin Adler 2007-08-20 16:03:00 PDT
I think we should turn off the consistency checks by default and add an easy way to turn them back on.
Comment 10 Darin Adler 2007-08-30 11:12:19 PDT
Committed revision 25319.