Bug 19546 - [Gtk] Crasher when using file:// protocol
Summary: [Gtk] Crasher when using file:// protocol
Status: RESOLVED DUPLICATE of bug 19603
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKitGTK (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC All
: P2 Normal
Assignee: Nobody
URL:
Keywords: Gtk
Depends on:
Blocks:
 
Reported: 2008-06-14 01:37 PDT by Jan Alonzo
Modified: 2008-07-09 06:02 PDT (History)
0 users

See Also:


Attachments
sample html file (11.98 KB, text/html)
2008-06-14 01:38 PDT, Jan Alonzo
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jan Alonzo 2008-06-14 01:37:44 PDT
WebKit crashes when opening a file. 

Below is a trace:

#0  0x00007f1e7166286b in IA__g_input_stream_close_finish (stream=0x676f6f672e777777, result=0xc62c60, error=0x0) at /tmp/buildd/glib2.0-2.16.3/gio/ginputstream.c:824
824     /tmp/buildd/glib2.0-2.16.3/gio/ginputstream.c: No such file or directory.
        in /tmp/buildd/glib2.0-2.16.3/gio/ginputstream.c
(gdb) bt
#0  0x00007f1e7166286b in IA__g_input_stream_close_finish (stream=0x676f6f672e777777, result=0xc62c60, error=0x0) at /tmp/buildd/glib2.0-2.16.3/gio/ginputstream.c:824
#1  0x00007f1e7662e426 in closeCallback (source=<value optimized out>, res=0xc62c60, data=0xa79d40) at WebCore/platform/network/soup/ResourceHandleSoup.cpp:416
#2  0x00007f1e71662610 in async_ready_close_callback_wrapper (source_object=0xc49c00, res=0xc62c60, user_data=0xa79d40) at /tmp/buildd/glib2.0-2.16.3/gio/ginputstream.c:487
#3  0x00007f1e7166aea9 in complete_in_idle_cb (data=0x676f6f672e777777) at /tmp/buildd/glib2.0-2.16.3/gio/gsimpleasyncresult.c:563
#4  0x00007f1e74c800f2 in IA__g_main_context_dispatch (context=0x7b10a0) at /tmp/buildd/glib2.0-2.16.3/glib/gmain.c:2009
#5  0x00007f1e74c83396 in g_main_context_iterate (context=0x7b10a0, block=1, dispatch=1, self=<value optimized out>) at /tmp/buildd/glib2.0-2.16.3/glib/gmain.c:2642
#6  0x00007f1e74c83657 in IA__g_main_loop_run (loop=0x797c40) at /tmp/buildd/glib2.0-2.16.3/glib/gmain.c:2850
#7  0x00007f1e75298587 in gtk_main () from /usr/lib/libgtk-x11-2.0.so.0
#8  0x0000000000401f0b in main (argc=1, argv=0x7fff7f6e0838) at WebKitTools/GtkLauncher/main.c:200
Comment 1 Jan Alonzo 2008-06-14 01:38:53 PDT
Created attachment 21699 [details]
sample html file

Steps to reproduce:

1. Launch GtkLauncher
2. Open the file using file://path/to/file
Comment 2 Jan Alonzo 2008-06-15 02:01:35 PDT
Following is a fix from Alp (http://paste.lisp.org/display/61072). If you know GIO, please let us know if the fix is correct.

Index: WebCore/platform/network/soup/ResourceHandleSoup.cpp
===================================================================
--- WebCore/platform/network/soup/ResourceHandleSoup.cpp        (revision 33954)
+++ WebCore/platform/network/soup/ResourceHandleSoup.cpp        (working copy)
@@ -412,9 +412,11 @@
 {
     ResourceHandle* handle = static_cast<ResourceHandle*>(data);
     ResourceHandleInternal* d = handle->getInternal();
+    ResourceHandleClient* client = handle->client();
 
     g_input_stream_close_finish(d->m_input_stream, res, NULL);
     cleanupGioOperation(handle);
+    client->didFinishLoading(handle);
 }
 
 static void readCallback(GObject* source, GAsyncResult* res, gpointer data)
@@ -438,7 +440,6 @@
         client->didFinishLoading(handle);
         return;
     } else if (!nread) {
-        client->didFinishLoading(handle);
         g_input_stream_close_async(d->m_input_stream, G_PRIORITY_DEFAULT,
                                    NULL, closeCallback, handle);
         return;
Comment 3 Marco Barisione 2008-06-20 08:04:47 PDT
(In reply to comment #2)
> Following is a fix from Alp (http://paste.lisp.org/display/61072). If you know
> GIO, please let us know if the fix is correct.

I think that the patch is right (I wrote an identical patch for this bug) but it's not the only fix required for the soup/gio back-end as also the patch for bug #19603 is needed.

Can you mark this bug as a dup of #19603 (even if this is older) as it has the complete patch with a changelog entry?
Comment 4 Jan Alonzo 2008-06-20 13:32:02 PDT

*** This bug has been marked as a duplicate of 19603 ***