<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>151653</bug_id>
          
          <creation_ts>2015-11-30 00:51:01 -0800</creation_ts>
          <short_desc>[GTK] UI process crash when the screensaver DBus proxy is being created while the web view is destroyed</short_desc>
          <delta_ts>2015-11-30 01:40:07 -0800</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>WebKitGTK</component>
          <version>WebKit Local Build</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>Gtk</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Carlos Garcia Campos">cgarcia</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>berto</cc>
    
    <cc>bugs-noreply</cc>
    
    <cc>commit-queue</cc>
    
    <cc>gustavo</cc>
    
    <cc>mcatanzaro</cc>
    
    <cc>mrobinson</cc>
    
    <cc>svillar</cc>
    
    <cc>zan</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1144738</commentid>
    <comment_count>0</comment_count>
    <who name="Carlos Garcia Campos">cgarcia</who>
    <bug_when>2015-11-30 00:51:01 -0800</bug_when>
    <thetext>We correctly cancel the proxy creation, but when the async ready callback is called, the view could be destroyed already. In that case g_dbus_proxy_new_for_bus_finish() will return nullptr and fail with cancelled error, but we are using the passed web view without checking first if the creation failed or not.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1144739</commentid>
    <comment_count>1</comment_count>
    <who name="Carlos Garcia Campos">cgarcia</who>
    <bug_when>2015-11-30 00:53:31 -0800</bug_when>
    <thetext>Forgot the bt. This crash is what makes /webkit2/WebKitWebView/submit-form fail sometimes, because when /webkit2/WebKitWebView/fullscreen runs, the proxy creation starts, and in /webkit2/WebKitWebView/submit-form the callback is called, but the web view of that previous test has been destroyed.

Program received signal SIGSEGV, Segmentation fault.
0x00007ffff32c502b in screenSaverProxyCreatedCallback(_GObject*, _GAsyncResult*, _WebKitWebViewBase*) ()
   from /home/cgarcia/src/git/gnome/WebKit/WebKitBuild/Release/lib/libwebkit2gtk-4.0.so.37
(gdb) bt
#0  0x00007ffff32c502b in screenSaverProxyCreatedCallback(_GObject*, _GAsyncResult*, _WebKitWebViewBase*) ()
   from /home/cgarcia/src/git/gnome/WebKit/WebKitBuild/Release/lib/libwebkit2gtk-4.0.so.37
#1  0x00007ffff59861a3 in g_task_return_now (task=0x7cf8f0) at gtask.c:1104
#2  0x00007ffff598680e in g_task_return (task=0x7cf8f0, type=&lt;optimized out&gt;) at gtask.c:1162
#3  0x00007ffff59dbfac in init_second_async_cb (source_object=&lt;optimized out&gt;, res=&lt;optimized out&gt;, user_data=0x7cf8f0) at gdbusproxy.c:1807
#4  0x00007ffff59861a3 in g_task_return_now (task=0x7cfa90) at gtask.c:1104
#5  0x00007ffff598680e in g_task_return (task=0x7cfa90, type=&lt;optimized out&gt;) at gtask.c:1162
#6  0x00007ffff59dba1e in async_init_start_service_by_name_cb (connection=&lt;optimized out&gt;, res=0x7cfb60, user_data=0x7cfa90) at gdbusproxy.c:1645
#7  0x00007ffff59861a3 in g_task_return_now (task=0x7cfb60) at gtask.c:1104
#8  0x00007ffff598680e in g_task_return (task=0x7cfb60, type=&lt;optimized out&gt;) at gtask.c:1162
#9  0x00007ffff59d0d00 in g_dbus_connection_call_done (source=&lt;optimized out&gt;, result=0x87e850, user_data=0x7cfb60) at gdbusconnection.c:5702
#10 0x00007ffff59861a3 in g_task_return_now (task=0x87e850) at gtask.c:1104
#11 0x00007ffff59861d9 in complete_in_idle_cb (task=0x87e850) at gtask.c:1118
#12 0x00007ffff766fb4a in g_main_dispatch (context=0x656e30) at gmain.c:3154
#13 g_main_context_dispatch (context=context@entry=0x656e30) at gmain.c:3769
#14 0x00007ffff766fec8 in g_main_context_iterate (context=0x656e30, block=block@entry=1, dispatch=dispatch@entry=1, self=&lt;optimized out&gt;) at gmain.c:3840
#15 0x00007ffff76701e2 in g_main_loop_run (loop=0x740380) at gmain.c:4034
#16 0x0000000000408757 in testWebViewSubmitForm(FormClientTest*, void const*) ()
#17 0x00007ffff76943db in test_case_run (tc=0x6c8ca0) at gtestutils.c:2158
#18 g_test_run_suite_internal (suite=suite@entry=0x7a5060, path=path@entry=0x0) at gtestutils.c:2241
#19 0x00007ffff76945a3 in g_test_run_suite_internal (suite=suite@entry=0x7a5080, path=path@entry=0x0) at gtestutils.c:2253
#20 0x00007ffff76945a3 in g_test_run_suite_internal (suite=suite@entry=0x7a50a0, path=path@entry=0x0) at gtestutils.c:2253
#21 0x00007ffff769479e in g_test_run_suite (suite=0x7a50a0) at gtestutils.c:2328
#22 0x00007ffff76947c1 in g_test_run () at gtestutils.c:1596
#23 0x0000000000407a85 in main ()</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1144740</commentid>
    <comment_count>2</comment_count>
      <attachid>266242</attachid>
    <who name="Carlos Garcia Campos">cgarcia</who>
    <bug_when>2015-11-30 00:56:04 -0800</bug_when>
    <thetext>Created attachment 266242
Patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1144741</commentid>
    <comment_count>3</comment_count>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2015-11-30 00:57:07 -0800</bug_when>
    <thetext>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</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1144742</commentid>
    <comment_count>4</comment_count>
      <attachid>266242</attachid>
    <who name="Martin Robinson">mrobinson</who>
    <bug_when>2015-11-30 01:33:17 -0800</bug_when>
    <thetext>Comment on attachment 266242
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=266242&amp;action=review

&gt; Source/WebKit2/UIProcess/API/gtk/WebKitWebViewBase.cpp:1175
&gt; +    if (!proxy)
&gt;          return;

It might be a good idea to leave a comment here explaining the situation as well. I think that could be quite useful for people reading the code.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1144743</commentid>
    <comment_count>5</comment_count>
    <who name="Carlos Garcia Campos">cgarcia</who>
    <bug_when>2015-11-30 01:40:07 -0800</bug_when>
    <thetext>Committed r192792: &lt;http://trac.webkit.org/changeset/192792&gt;</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>266242</attachid>
            <date>2015-11-30 00:56:04 -0800</date>
            <delta_ts>2015-11-30 01:33:17 -0800</delta_ts>
            <desc>Patch</desc>
            <filename>wk2-screensaver-crash.diff</filename>
            <type>text/plain</type>
            <size>1957</size>
            <attacher name="Carlos Garcia Campos">cgarcia</attacher>
            
              <data encoding="base64">ZGlmZiAtLWdpdCBhL1NvdXJjZS9XZWJLaXQyL0NoYW5nZUxvZyBiL1NvdXJjZS9XZWJLaXQyL0No
YW5nZUxvZwppbmRleCAyOGU3NzNkLi5iN2IxMmY5IDEwMDY0NAotLS0gYS9Tb3VyY2UvV2ViS2l0
Mi9DaGFuZ2VMb2cKKysrIGIvU291cmNlL1dlYktpdDIvQ2hhbmdlTG9nCkBAIC0xLDMgKzEsMTkg
QEAKKzIwMTUtMTEtMzAgIENhcmxvcyBHYXJjaWEgQ2FtcG9zICA8Y2dhcmNpYUBpZ2FsaWEuY29t
PgorCisgICAgICAgIFtHVEtdIFVJIHByb2Nlc3MgY3Jhc2ggd2hlbiB0aGUgc2Ny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dmVyUHJveHkgPSBwcm94
eTsKICAgICB3ZWJraXRXZWJWaWV3QmFzZVNlbmRJbmhpYml0TWVzc2FnZVRvU2NyZWVuU2F2ZXIo
d2ViVmlld0Jhc2UpOwogfQogCg==
</data>
<flag name="review"
          id="291254"
          type_id="1"
          status="+"
          setter="mrobinson"
    />
          </attachment>
      

    </bug>

</bugzilla>