Bug 129606
Summary: | [GTK][WK2] ASSERTION FAILED: url == m_string using MiniBrowser (from webkit_web_view_load_uri) | ||
---|---|---|---|
Product: | WebKit | Reporter: | Fabien Vallée <fvallee> |
Component: | WebKit2 | Assignee: | Nobody <webkit-unassigned> |
Status: | CLOSED DUPLICATE | ||
Severity: | Minor | CC: | cgarcia, gustavo, mario, mrobinson, zan |
Priority: | P2 | ||
Version: | 528+ (Nightly build) | ||
Hardware: | PC | ||
OS: | Linux |
Fabien Vallée
Using webkit gtk (changeset 164977), built with cmake (default options, i.e. cmake ../.. && make MiniBrowser), Linux x86_64 platform
Minibrowser crashes due to assert ( ASSERTION FAILED: url == m_string ) in Source/WebCore/platform/URL.cpp WebCore::URL::URL(WebCore::ParsedURLStringTag, const WTF::String&) if the command line url doesnt finish with a slash (/)
e.g.:
./bin/MiniBrowser http://www.google.com -> ASSERTION FAILED: url == m_string
./bin/MiniBrowser http://www.webkit.org -> ASSERTION FAILED: url == m_string
./bin/MiniBrowser http://www.google.com/ --> OK
./bin/MiniBrowser http://www.webkit.org/ --> OK
The assert fails because url and m_string are indeed different (url = http:://xxxx and m_string = http://xxx/ ).
The extra / in m_string comes from :
void URL::parse(const char* url, const String* originalString)
// For canonicalization, ensure we have a '/' for no path.
// Do this only for URL with protocol file, http or https.
if ((m_protocolIsInHTTPFamily || isFile) && pathEnd == pathStart) {
GtkLauncher (WK1) create the URL with :
Source/WebKit/gtk/webkit/webkitwebframe.cpp:677
URL(URL(), String::fromUTF8(uri)))
and doesn't ASSERT.
MiniBrowser is using WK2, URL is created in webkit_web_view_load_uri ( WebKit2/UIProcess/API/gtk/WebKitWebView.cpp )
getPage(webView)->loadRequest(String::fromUTF8(uri));
is creating a ResourceRequest
ResourceRequest(const String& url)
: ResourceRequestBase(URL(ParsedURLString, url), UseProtocolCachePolicy)
(from WebCore/platform/network/soup/ResourceRequest.h)
I guess URL(ParsedURLString, url) constructor should not be used here as the url string has not been parsed.
The following patch fixes the issue:
--- /tmp/ZygO6I_WebKitWebView.cpp
+++ /Source/WebKit2/UIProcess/API/gtk/WebKitWebView.cpp
@@ -1996,13 +1996,13 @@
*/
void webkit_web_view_load_uri(WebKitWebView* webView, const gchar* uri)
{
g_return_if_fail(WEBKIT_IS_WEB_VIEW(webView));
g_return_if_fail(uri);
- getPage(webView)->loadRequest(String::fromUTF8(uri));
+ getPage(webView)->loadRequest(URL(URL(), String::fromUTF8(uri)));
}
Please let me know if the change make sense or if any extra information is needed. thanks
Attachments | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
Mario Sanchez Prada
I believe this is the same issue than bug 130492
*** This bug has been marked as a duplicate of bug 130492 ***
Fabien Vallée
yes, it's a duplicate and the issue is fixed. thanks a lot!