Bug 122993 - Web Inspector: [CSS Regions] Crash when highlighting a node of a flow with no regions
Summary: Web Inspector: [CSS Regions] Crash when highlighting a node of a flow with no...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Alexandru Chiculita
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2013-10-17 14:01 PDT by Alexandru Chiculita
Modified: 2013-10-17 15:06 PDT (History)
6 users (show)

See Also:


Attachments
Patch V1 (5.85 KB, patch)
2013-10-17 14:19 PDT, Alexandru Chiculita
joepeck: review+
joepeck: commit-queue-
Details | Formatted Diff | Diff
Patch V2 (5.62 KB, patch)
2013-10-17 14:35 PDT, Alexandru Chiculita
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Alexandru Chiculita 2013-10-17 14:01:08 PDT
When a node inside a flow thread with no regions is highlighted, WebCore crashes.

0   com.apple.JavaScriptCore      	0x0000000107c3dfaa WTFCrash + 42
1   com.apple.WebCore             	0x0000000109faf8f4 WebCore::buildObjectForRendererFragments(WebCore::RenderObject*, WebCore::HighlightConfig const&) + 324
2   com.apple.WebCore             	0x0000000109faf5be WebCore::InspectorOverlay::buildObjectForHighlightedNode() const + 494
3   com.apple.WebCore             	0x0000000109faefe4 WebCore::InspectorOverlay::drawNodeHighlight() + 36
4   com.apple.WebCore             	0x0000000109faeabe WebCore::InspectorOverlay::update() + 558
5   com.apple.WebCore             	0x0000000109faecba WebCore::InspectorOverlay::highlightNode(WebCore::Node*, WebCore::HighlightConfig const&) + 106
6   com.apple.WebCore             	0x0000000109f5af65 WebCore::InspectorDOMAgent::highlightNode(WTF::String*, WTF::RefPtr<WebCore::InspectorObject> const&, int const*, WTF::String const*) + 485
7   com.apple.WebCore             	0x0000000109f5aff2 non-virtual thunk to WebCore::InspectorDOMAgent::highlightNode(WTF::String*, WTF::RefPtr<WebCore::InspectorObject> const&, int const*, WTF::String const*) + 82
8   com.apple.WebCore             	0x0000000109ee13c1 WebCore::InspectorBackendDispatcherImpl::DOM_highlightNode(long, WebCore::InspectorObject*) + 785
9   com.apple.WebCore             	0x0000000109ef6c7e WebCore::InspectorBackendDispatcherImpl::dispatch(WTF::String const&) + 1838
10  com.apple.WebCore             	0x0000000109f0feb0 WebCore::InspectorController::dispatchMessageFromFrontend(WTF::String const&) + 96
11  com.apple.WebCore             	0x0000000109f88afe WebCore::InspectorBackendDispatchTask::onTimer(WebCore::Timer<WebCore::InspectorBackendDispatchTask>*) + 110
12  com.apple.WebCore             	0x0000000109f88ee3 WebCore::Timer<WebCore::InspectorBackendDispatchTask>::fired() + 115
13  com.apple.WebCore             	0x000000010add4f13 WebCore::ThreadTimers::sharedTimerFiredInternal() + 307
14  com.apple.WebCore             	0x000000010add4c29 WebCore::ThreadTimers::sharedTimerFired() + 25
15  com.apple.WebCore             	0x000000010ab6f463 WebCore::timerFired(__CFRunLoopTimer*, void*) + 67
16  com.apple.CoreFoundation      	0x00007fff894db804 __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ + 20
17  com.apple.CoreFoundation      	0x00007fff894db31d __CFRunLoopDoTimer + 557
18  com.apple.CoreFoundation      	0x00007fff894c0ad9 __CFRunLoopRun + 1529
19  com.apple.CoreFoundation      	0x00007fff894c00e2 CFRunLoopRunSpecific + 290
20  DumpRenderTree                	0x000000010750a0c0 runTest(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) + 4912 (DumpRenderTree.mm:1415)
21  DumpRenderTree                	0x0000000107508d1a runTestingServerLoop() + 282 (DumpRenderTree.mm:861)
22  DumpRenderTree                	0x0000000107508705 dumpRenderTree(int, char const**) + 405 (DumpRenderTree.mm:916)
23  DumpRenderTree                	0x000000010750a978 main + 296 (DumpRenderTree.mm:959)
24  libdyld.dylib                 	0x00007fff8c0347e1 start + 1
Comment 1 Radar WebKit Bug Importer 2013-10-17 14:02:19 PDT
<rdar://problem/15255110>
Comment 2 Alexandru Chiculita 2013-10-17 14:19:47 PDT
Created attachment 214510 [details]
Patch V1
Comment 3 Joseph Pecoraro 2013-10-17 14:28:59 PDT
Comment on attachment 214510 [details]
Patch V1

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

r=me

> LayoutTests/inspector-protocol/dom/highlight-flow-with-no-region.html:19
> +        if (msg.error) {
> +            InspectorTest.log(msg.error.message);
> +            InspectorTest.completeTest();
> +            return;
> +        }

I created a helper for this in LayoutTests/http/tests/inspector-protocol/resources/InspectorTest.js named InspectorTest.checkForError:

    InspectorTest.checkForError = function(responseObject)
    {
        if (responseObject.error) {
            InspectorTest.log("PROTOCOL ERROR: " + responseObject.error.message);
            InspectorTest.completeTest();
            throw "PROTOCOL ERROR";
        }
    }

So instead of these if blocks you can just do:

    InspectorTest.checkForError(msg);
Comment 4 Alexandru Chiculita 2013-10-17 14:35:44 PDT
Created attachment 214514 [details]
Patch V2

Thanks!
Comment 5 WebKit Commit Bot 2013-10-17 15:06:42 PDT
Comment on attachment 214514 [details]
Patch V2

Clearing flags on attachment: 214514

Committed r157605: <http://trac.webkit.org/changeset/157605>
Comment 6 WebKit Commit Bot 2013-10-17 15:06:44 PDT
All reviewed patches have been landed.  Closing bug.