Bug 109987

Summary: [JSC]: ASSERT in KURL(ParsedURLStringTag) under sourceMapURLForScript
Product: WebKit Reporter: Joseph Pecoraro <joepeck>
Component: Web Inspector (Deprecated)Assignee: Joseph Pecoraro <joepeck>
Severity: Normal CC: apavlov, joepeck, keishi, loislo, pfeldman, pmuellr, simon.fraser, timothy, vsevik, web-inspector-bugs, webkit.review.bot, yurys
Priority: P2 Keywords: InRadar
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Description Flags
[PATCH] Proposed fix and test none

Description Joseph Pecoraro 2013-02-15 16:45:07 PST
1. Load a page with <script src="foo.js"></script> and the script has "//@ sourceURL=/one/two"
2. Open the inspector for the page
3. Reload the page

ASSERTION FAILED: url.isEmpty() || isSchemeFirstChar(url[0])
/Volumes/SSData/Development/OSX/webkit/OpenSource/Source/WebCore/platform/KURL.cpp(317) : void WebCore::checkEncodedString(const WTF::String &)
1   0x1040b4825 WebCore::checkEncodedString(WTF::String const&)
2   0x1040af60a WebCore::KURL::parse(WTF::String const&)
3   0x1040af580 WebCore::KURL::KURL(WebCore::ParsedURLStringTag, WTF::String const&)
4   0x1040af543 WebCore::KURL::KURL(WebCore::ParsedURLStringTag, WTF::String const&)
5   0x103a30e16 WebCore::InspectorDebuggerAgent::sourceMapURLForScript(WebCore::ScriptDebugListener::Script const&)
6   0x103a30f3e WebCore::InspectorDebuggerAgent::didParseSource(WTF::String const&, WebCore::ScriptDebugListener::Script const&)
7   0x103a31627 non-virtual thunk to WebCore::InspectorDebuggerAgent::didParseSource(WTF::String const&, WebCore::ScriptDebugListener::Script const&)
8   0x1045abd36 WebCore::ScriptDebugServer::dispatchDidParseSource(WTF::HashSet<WebCore::ScriptDebugListener*, WTF::PtrHash<WebCore::ScriptDebugListener*>, WTF::HashTraits<WebCore::ScriptDebugListener*> > const&, JSC::SourceProvider*, bool)
9   0x1045ac078 WebCore::ScriptDebugServer::sourceParsed(JSC::ExecState*, JSC::SourceProvider*, int, WTF::String const&)
10  0x102212835 (anonymous namespace)::Recompiler::~Recompiler()
11  0x102212265 (anonymous namespace)::Recompiler::~Recompiler()
12  0x102212131 JSC::Debugger::recompileAllJSFunctions(JSC::JSGlobalData*)
13  0x1042038c9 WebCore::PageScriptDebugServer::recompileAllJSFunctions(WebCore::Timer<WebCore::ScriptDebugServer>*)
14  0x1045b4ad3 WebCore::Timer<WebCore::ScriptDebugServer>::fired()
Comment 1 Joseph Pecoraro 2013-02-15 16:46:34 PST
Looks like there was duplicate sourceURL parsing on the JSC side. This caused use to override the real Script.url with the sourceURL before its expected. So in sourceMapURLForScript, JSC was working with the sourceURL url, instead of the real script url.
Comment 2 Joseph Pecoraro 2013-02-15 16:46:47 PST
Comment 3 Joseph Pecoraro 2013-02-15 16:50:58 PST
I'll try to write a test for this to see if this hits the v8 side as well.
Comment 4 Joseph Pecoraro 2013-02-15 16:54:06 PST
Easier way to test this. Just eval the following in the console:

    js> //@ sourceURL=/one/two
Comment 5 Joseph Pecoraro 2013-02-15 17:11:56 PST
Created attachment 188670 [details]
[PATCH] Proposed fix and test
Comment 6 WebKit Review Bot 2013-02-18 10:34:45 PST
Comment on attachment 188670 [details]
[PATCH] Proposed fix and test

Clearing flags on attachment: 188670

Committed r143240: <http://trac.webkit.org/changeset/143240>
Comment 7 WebKit Review Bot 2013-02-18 10:34:50 PST
All reviewed patches have been landed.  Closing bug.