Bug 78958 - Sometimes WebKit hangs (e.g. "he's dead Jim" in Chromium) on a particular page
Summary: Sometimes WebKit hangs (e.g. "he's dead Jim" in Chromium) on a particular page
Status: RESOLVED WORKSFORME
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Major
Assignee: Nobody
URL: http://antipook.com/post/view/1082
Keywords:
Depends on:
Blocks:
 
Reported: 2012-02-18 02:00 PST by jorilx
Modified: 2012-10-10 13:50 PDT (History)
6 users (show)

See Also:


Attachments
Spin log of the stuck process (639.78 KB, application/zip)
2012-10-01 12:27 PDT, jorilx
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description jorilx 2012-02-18 02:00:40 PST
I'm seeing this on Chromium, Safari and other Webkit-based browsers like Midori and Epiphany, on Linux, OSX and Windows. It looks like this *doesn't* happen on FreeBSD. The problem is that sometimes the browser tab hangs, CPU shots to 100% and after a while the browser asks if it should kill the page.

This happens on a website I'm building with some friends. With other browsers everything is fine, while with Webkit-based ones sometimes the SAME page hangs. Other pages work fine. I tried narrowing down the problem:
- disabled javascript from the browser: nothing changes
- testing on a _local_ server (running the site at localhost): works everytime
- testing on a local server but going through the Internet (via a virtual server on the DSL router): problem gets back

So I *think* this is something related to the render-as-you-load system, maybe there's something that trips it when there's some lag loading the page?
I think this is also related to the number of nested divs on the page, since with simpler ones there's no problem.
Comment 1 Alexey Proskuryakov 2012-02-20 11:23:59 PST
I can not reproduce this with Safari 5.1.3 on Mac OS X.

Could you please attach a spin log for Safari or WebProcess (whichever is frozen)? To make one, please use /Applications/Utilities/Activity Monitor.app
Comment 2 jorilx 2012-10-01 12:27:09 PDT
Created attachment 166525 [details]
Spin log of the stuck process

I've finally managed to take hold of a Mac, here's the spin log, thanks!
Comment 3 Alexey Proskuryakov 2012-10-02 14:55:19 PDT
I don't see a complete hang in the stack trace, just being very busy laying out a super deep render tree.
Comment 4 Alexey Proskuryakov 2012-10-02 14:56:36 PDT
We'll probably need a reproducible case to make progress here, as the provided URL doesn't make WebProcess hang.
Comment 5 jorilx 2012-10-02 15:03:19 PDT
That is part of the problem, the process hangs only sometimes, even when just refreshing the same page :( Or do you mean that at your end it never hangs?
Comment 6 Eric Seidel (no email) 2012-10-02 15:09:04 PDT
I'm not able to repro the hang in Chromium Version 23.0.1271.1 dev.  Do I need to refresh the page or is there some set of steps to get it to hang reliably?
Comment 7 Eric Seidel (no email) 2012-10-02 15:11:09 PDT
Please re-open if you have additional information.  I'm happy to investigate further if there is a reliable reproduction.
Comment 8 Eric Seidel (no email) 2012-10-02 15:13:05 PDT
It's possible that somehow we're getitng into an infinite loop in layoutBlockChildren(), but that seems unlikely:

    +                                                                                                                                           2086 WebCore::RenderBlock::layoutBlockChildren(bool, int&)  (in WebCore) + 647  [0x10e5e8bc7]
    +                                                                                                                                             1811 WebCore::RenderBlock::layoutBlockChild(WebCore::RenderBox*, WebCore::RenderBlock::MarginInfo&, int&, int&)  (in 

is where the sample diverges.
Comment 10 Eric Seidel (no email) 2012-10-02 15:15:55 PDT
It's possible that handleSpecialChild() fails to actually handle the child, leaving us in an infinite loop. in some case.
Comment 11 Eric Seidel (no email) 2012-10-02 15:17:03 PDT
Nevermind.  What I proposed is impossible.  The loop can't be infinte that way.  It would have to have a box which pointed to itself to be infinite.
Comment 12 Alexey Proskuryakov 2012-10-02 15:18:44 PDT
I tried a little harder, and could reproduce the hang with Safari 6.0.1. But I couldn't reproduce with a recent WebKit build, so this seems fixed indeed.

Please test with a recent nightly from <http://nightly.webkit.org>.
Comment 13 jorilx 2012-10-03 03:07:01 PDT
I tried installing Safari 5.1.7 on Windows and running "WebKit.exe" from the nightly release, is this the right way to test a WebKit nightly?
Comment 14 Alexey Proskuryakov 2012-10-03 09:55:21 PDT
I think that nightlies still happen to work on Windows for now, so what you mentioned should do it. We don't put any effort in making nightlies work with anything but the latest Safari release however, which is currently 6.0.1.
Comment 15 jorilx 2012-10-03 12:47:39 PDT
I see... Well I've tested it on OSX too and it looks like it doesn't hang anymore, indeed :) A last question then: since in the meantime I had devised a workaround to provide Webkit browsers with "simplified" pages, how can I know that I'm talking to a fixed Webkit? Should I check the user agent for Webkit versions >= 537? (Safari 6.0 has Webkit 536)
Comment 16 Alexey Proskuryakov 2012-10-03 12:59:26 PDT
We never comment on future Apple releases.
Comment 17 Eric Seidel (no email) 2012-10-03 13:08:16 PDT
For Chromium you shouldn't need to check, since something like 99% of users will always be running the latest release.

The release schedule is public: http://www.chromium.org/developers/calendar if you need it.
Comment 18 jorilx 2012-10-04 00:21:20 PDT
Yes I think Chromium won't be a problem but I still need to handle other WebKit-based browsers like the ones on cell phones etc :) Anyway many thanks for your assistance on the whole issue!
Comment 19 jorilx 2012-10-10 13:50:54 PDT
For the record, Chrome 21 (WebKit 537.1) still hangs, while Chrome 22 (WebKit 537.4) looks ok.