Bug 127034 - Suspend resource requests during computedStyle
Summary: Suspend resource requests during computedStyle
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Page Loading (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2014-01-15 01:25 PST by Antti Koivisto
Modified: 2014-01-15 02:25 PST (History)
4 users (show)

See Also:


Attachments
patch (3.41 KB, patch)
2014-01-15 01:30 PST, Antti Koivisto
kling: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Antti Koivisto 2014-01-15 01:25:07 PST
We have some cases where getting computed style leads to crashes in loadPendingImages. This is probably caused by load callbacks triggering re-entering webkit and killing the StyleResolver. 

(lldb) bt
* thread #5: tid = 0x2403, 0x00720078 UIKit`.str44 + 636054, stop reason = EXC_BAD_ACCESS (code=13, address=0x0)
    frame #0: 0x00720078 UIKit`.str44 + 636054
    frame #1: 0x03400532 WebCore`WebCore::StyleResolver::loadPendingImages() + 802
    frame #2: 0x033f80f9 WebCore`WebCore::StyleResolver::applyMatchedProperties(WebCore::StyleResolver::MatchResult const&) + 1097
    frame #3: 0x033f2bf1 WebCore`WebCore::StyleResolver::styleForElement(WebCore::Element*, WebCore::RenderStyle*, WebCore::StyleSharingBehavior, WebCore::RuleMatchingBehavior, WebCore::RenderRegion*) + 3489
    frame #4: 0x02a3b180 WebCore`WebCore::Document::styleForElementIgnoringPendingStylesheets(WebCore::Element*) + 144
    frame #5: 0x02b141b9 WebCore`WebCore::Element::computedStyle(WebCore::PseudoId) + 121
    frame #6: 0x0296e14f WebCore`WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue(WebCore::CSSPropertyID, WebCore::EUpdateLayout) const + 479    
    frame #7: 0x0296dc1f WebCore`WebCore::CSSComputedStyleDeclaration::getPropertyValue(WebCore::CSSPropertyID) const + 47
    frame #8: 0x02986a88 WebCore`WebCore::CSSComputedStyleDeclaration::getPropertyValue(WTF::String const&) + 56
    frame #9: 0x02e0e997
Comment 1 Antti Koivisto 2014-01-15 01:25:49 PST
<rdar://problem/12369267>
Comment 2 Antti Koivisto 2014-01-15 01:30:39 PST
Created attachment 221240 [details]
patch
Comment 3 WebKit Commit Bot 2014-01-15 01:32:22 PST
Attachment 221240 [details] did not pass style-queue:

Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/WebCore/ChangeLog', u'Source/WebCore/dom/Document.cpp', u'Source/WebCore/loader/ResourceLoadScheduler.h', '--commit-queue']" exit_code: 1
ERROR: Source/WebCore/loader/ResourceLoadScheduler.h:67:  Should be indented on a separate line, with the colon or comma first on that line.  [whitespace/indent] [4]
Total errors found: 1 in 3 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 4 Andreas Kling 2014-01-15 01:36:28 PST
Comment on attachment 221240 [details]
patch

View in context: https://bugs.webkit.org/attachment.cgi?id=221240&action=review

r=me..

> Source/WebCore/loader/ResourceLoadScheduler.h:65
> +    class Suspend {

This name feels a bit off. "Suspender"?

> Source/WebCore/loader/ResourceLoadScheduler.h:67
> +        Suspend(ResourceLoadScheduler& scheduler) : m_scheduler(scheduler) { m_scheduler.suspendPendingRequests(); }

explicit
Comment 5 Antti Koivisto 2014-01-15 02:25:02 PST
https://trac.webkit.org/r162063