Bug 109987 - [JSC]: ASSERT in KURL(ParsedURLStringTag) under sourceMapURLForScript
Summary: [JSC]: ASSERT in KURL(ParsedURLStringTag) under sourceMapURLForScript
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (Deprecated) (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Joseph Pecoraro
Keywords: InRadar
Depends on:
Reported: 2013-02-15 16:45 PST by Joseph Pecoraro
Modified: 2013-02-18 10:34 PST (History)
12 users (show)

See Also:

[PATCH] Proposed fix and test (4.53 KB, patch)
2013-02-15 17:11 PST, Joseph Pecoraro
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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.