Bug 143745 - Regression(r180020): Web Inspector crashes on pages that have a stylesheet with an invalid MIME type
Summary: Regression(r180020): Web Inspector crashes on pages that have a stylesheet wi...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: CSS (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Chris Dumez
URL:
Keywords: InRadar
Depends on:
Blocks: 141501
  Show dependency treegraph
 
Reported: 2015-04-14 17:29 PDT by Chris Dumez
Modified: 2015-04-14 21:25 PDT (History)
3 users (show)

See Also:


Attachments
Patch (8.87 KB, patch)
2015-04-14 17:39 PDT, Chris Dumez
joepeck: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Dumez 2015-04-14 17:29:04 PDT
Web Inspector crashes on pages that have a stylesheet with an invalid MIME type:
0   com.apple.JavaScriptCore      	0x00007fff8f0a9feb JSC::Yarr::interpret(JSC::Yarr::BytecodePattern*, WTF::String const&, unsigned int, unsigned int*) + 11
1   com.apple.JavaScriptCore      	0x00007fff8f220e39 Inspector::ContentSearchUtilities::findMagicComment(WTF::String const&, WTF::String const&) + 153
2   com.apple.JavaScriptCore      	0x00007fff8f221336 Inspector::ContentSearchUtilities::findStylesheetSourceMapURL(WTF::String const&) + 278
3   com.apple.WebCore             	0x00007fff8d3c4784 WebCore::InspectorPageAgent::sourceMapURLForResource(WebCore::CachedResource*) + 372
4   com.apple.WebCore             	0x00007fff8d3c6235 WebCore::InspectorPageAgent::buildObjectForFrameTree(WebCore::Frame*) + 805
5   com.apple.WebCore             	0x00007fff8d3c65ae non-virtual thunk to WebCore::InspectorPageAgent::getResourceTree(WTF::String&, WTF::RefPtr<Inspector::Protocol::Page::FrameResourceTree>&) + 30
6   com.apple.JavaScriptCore      	0x00007fff8f3e5ffd Inspector::PageBackendDispatcher::getResourceTree(long, Inspector::InspectorObject const&) + 93
7   com.apple.JavaScriptCore      	0x00007fff8f3e4c5a Inspector::PageBackendDispatcher::dispatch(long, WTF::String const&, WTF::Ref<Inspector::InspectorObject>&&) + 570
8   com.apple.JavaScriptCore      	0x00007fff8f3bcf2a Inspector::BackendDispatcher::dispatch(WTF::String const&) + 1722
9   com.apple.WebKit              	0x00007fff89110800 void IPC::handleMessage<Messages::WebInspector::SendMessageToBackend, WebKit::WebInspector, void (WebKit::WebInspector::*)(WTF::String const&)>(IPC::MessageDecoder&, WebKit::WebInspector*, void (WebKit::WebInspector::*)(WTF::String const&)) + 67
10  com.apple.WebKit              	0x00007fff88ffcbb2 IPC::Connection::dispatchMessage(std::__1::unique_ptr<IPC::MessageDecoder, std::__1::default_delete<IPC::MessageDecoder> >) + 102

Radar: <rdar://problem/20243916>
Comment 1 Chris Dumez 2015-04-14 17:39:52 PDT
Created attachment 250767 [details]
Patch
Comment 2 Joseph Pecoraro 2015-04-14 17:46:12 PDT
Comment on attachment 250767 [details]
Patch

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

r=me!

> Source/WebCore/ChangeLog:10
> +        are not served with a CSS MIME type. Showing the Web inspector on a

Nit: "Showing the Web inspector" => "Showing Web Inspector"

> Source/WebCore/inspector/InspectorPageAgent.cpp:159
> +            // This can return a null String if the MIME type is invalid.

This comment should be on the line above. "This" is sheetText.

> LayoutTests/http/tests/inspector/css/bad-mime-type-expected.txt:1
> +Tests showing the Web Inspector on a page that has a stylesheet with an invalid MIME type.

Grammar: How about: "Tests that showing Web Inspector on a page that has a stylesheet with an invalid MIME type does not crash."
Comment 3 Chris Dumez 2015-04-14 18:40:10 PDT
Committed r182829: <http://trac.webkit.org/changeset/182829>
Comment 5 Chris Dumez 2015-04-14 21:15:06 PDT
> FAIL: Timed out waiting for notifyDone to be called

Joe, do I need to do anything special for Windows?
Comment 6 Chris Dumez 2015-04-14 21:25:00 PDT
Comment on attachment 250767 [details]
Patch

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

> LayoutTests/http/tests/inspector/css/bad-mime-type.html:12
> +    InspectorTest.completeTest();

This test cannot get much simpler than this. I don't know why Windows would time out. Maybe completeTest() needs to be called in a setTimeout() for some reason?