Bug 147780

Summary: [GTK] Crash when the web view is destroyed while the screensaver DBUs proxy is being created
Product: WebKit Reporter: Carlos Garcia Campos <cgarcia>
Component: WebKitGTKAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: berto, commit-queue, gustavo, mcatanzaro, mrobinson, pnormand, svillar, zan
Priority: P2 Keywords: Gtk
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch svillar: review+

Description Carlos Garcia Campos 2015-08-07 04:23:41 PDT
We should cancel the screenSaverInhibitCancellable on dispose. I also noticved that we are leaking the cancellable object because I forgot to use adoptGRef().
Comment 1 Carlos Garcia Campos 2015-08-07 04:25:45 PDT
Program received signal SIGSEGV, Segmentation fault.
0x00007ffff33f07d7 in screenSaverProxyCreatedCallback(_GObject*, _GAsyncResult*, _WebKitWebViewBase*) ()
   from /home/cgarcia/src/git/gnome/WebKit/WebKitBuild/Release/lib/libwebkit2gtk-4.0.so.37
(gdb) bt
#0  0x00007ffff33f07d7 in screenSaverProxyCreatedCallback(_GObject*, _GAsyncResult*, _WebKitWebViewBase*) ()
   from /home/cgarcia/src/git/gnome/WebKit/WebKitBuild/Release/lib/libwebkit2gtk-4.0.so.37
#1  0x00007ffff5923f89 in g_task_return_now (task=0x83e0d0) at gtask.c:1106
#2  0x00007ffff592478e in g_task_return (task=0x83e0d0, type=<optimized out>) at gtask.c:1164
#3  0x00007ffff597c90b in init_second_async_cb (source_object=0x6e8740, res=0x83e270, user_data=user_data@entry=0x83e0d0) at gdbusproxy.c:1807
#4  0x00007ffff5923f89 in g_task_return_now (task=0x83e270) at gtask.c:1106
#5  0x00007ffff592478e in g_task_return (task=0x83e270, type=<optimized out>) at gtask.c:1164
#6  0x00007ffff597c15e in async_init_start_service_by_name_cb (connection=<optimized out>, res=0x83e340, user_data=user_data@entry=0x83e270) at gdbusproxy.c:1645
#7  0x00007ffff5923f89 in g_task_return_now (task=0x83e340) at gtask.c:1106
#8  0x00007ffff592478e in g_task_return (task=0x83e340, type=<optimized out>) at gtask.c:1164
#9  0x00007ffff59716e8 in g_dbus_connection_call_done (source=<optimized out>, result=0x8d9000, user_data=user_data@entry=0x83e340) at gdbusconnection.c:5399
#10 0x00007ffff5923f89 in g_task_return_now (task=0x8d9000) at gtask.c:1106
#11 0x00007ffff5923fc9 in complete_in_idle_cb (task=0x8d9000) at gtask.c:1120
#12 0x00007ffff7675bdd in g_main_dispatch (context=0x678790) at gmain.c:3122
#13 g_main_context_dispatch (context=context@entry=0x678790) at gmain.c:3737
#14 0x00007ffff7675f78 in g_main_context_iterate (context=0x678790, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at gmain.c:3808
#15 0x00007ffff7676292 in g_main_loop_run (loop=0x7b4310) at gmain.c:4002
#16 0x0000000000408097 in testWebViewSubmitForm(FormClientTest*, void const*) ()
#17 0x00007ffff769a923 in test_case_run (tc=0x7ad190) at gtestutils.c:2124
#18 g_test_run_suite_internal (suite=suite@entry=0x7ada20, path=path@entry=0x7ffff771925e "") at gtestutils.c:2185
#19 0x00007ffff769aaf2 in g_test_run_suite_internal (suite=suite@entry=0x7ada00, path=<optimized out>, path@entry=0x7ffff771925e "") at gtestutils.c:2196
#20 0x00007ffff769aaf2 in g_test_run_suite_internal (suite=suite@entry=0x7ad9a0, path=<optimized out>, path@entry=0x7ffff771925e "") at gtestutils.c:2196
#21 0x00007ffff769ae3b in g_test_run_suite (suite=0x7ad9a0) at gtestutils.c:2249
#22 0x00007ffff769ae71 in g_test_run () at gtestutils.c:1553
#23 0x0000000000407a95 in main ()
Comment 2 Carlos Garcia Campos 2015-08-07 04:26:12 PDT
Created attachment 258482 [details]
Patch
Comment 3 Carlos Garcia Campos 2015-08-07 04:27:19 PDT
Btw, before you ask, it's safe to call g_cancellable_cancel with NULL or on an already cancelled cancellable, so we don't need any checks.
Comment 4 WebKit Commit Bot 2015-08-07 04:28:17 PDT
Thanks for the patch. If this patch contains new public API please make sure it follows the guidelines for new WebKit2 GTK+ API. See http://trac.webkit.org/wiki/WebKitGTK/AddingNewWebKit2API
Comment 5 Carlos Garcia Campos 2015-08-10 01:28:17 PDT
Committed r188208: <http://trac.webkit.org/changeset/188208>