<?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>102564</bug_id>
          
          <creation_ts>2012-11-16 15:00:25 -0800</creation_ts>
          <short_desc>[GTK] GtkSocket is leaked until webview is destroyed.</short_desc>
          <delta_ts>2012-11-26 14:01:45 -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>Plug-ins</component>
          <version>525.x (Safari 3.2)</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></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="arno.">a.renevier</reporter>
          <assigned_to name="arno.">a.renevier</assigned_to>
          <cc>dglazkov</cc>
    
    <cc>d-r</cc>
    
    <cc>mrobinson</cc>
    
    <cc>naginenis</cc>
    
    <cc>webkit.review.bot</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>769694</commentid>
    <comment_count>0</comment_count>
    <who name="arno.">a.renevier</who>
    <bug_when>2012-11-16 15:00:25 -0800</bug_when>
    <thetext>Hi,
in gtk PluginView::start, a GtkSocket is added to the webview.
But is not removed when pluginview in destroyed. Therefore, it stays a child of the webview until the webview is destroyed.
So, if user change pages, the GtkSocket, and possibly all its child widgets appended by the plugins are not freed.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>769705</commentid>
    <comment_count>1</comment_count>
      <attachid>174767</attachid>
    <who name="arno.">a.renevier</who>
    <bug_when>2012-11-16 15:12:22 -0800</bug_when>
    <thetext>Created attachment 174767
Patch

patch proposal</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>769711</commentid>
    <comment_count>2</comment_count>
      <attachid>174767</attachid>
    <who name="Martin Robinson">mrobinson</who>
    <bug_when>2012-11-16 15:21:13 -0800</bug_when>
    <thetext>Comment on attachment 174767
Patch

In the ~WigetGtk g_object_unref is called on the platform widget. Normally gtk_widget_destroy will remove a widget from its container. I&apos;m not sure if g_object_unref does the same here. Can you confirm?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>769804</commentid>
    <comment_count>3</comment_count>
      <attachid>174767</attachid>
    <who name="WebKit Review Bot">webkit.review.bot</who>
    <bug_when>2012-11-16 17:38:35 -0800</bug_when>
    <thetext>Comment on attachment 174767
Patch

Attachment 174767 did not pass chromium-ews (chromium-xvfb):
Output: http://queues.webkit.org/results/14859571

New failing tests:
inspector-protocol/debugger-terminate-dedicated-worker-while-paused.html</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>769805</commentid>
    <comment_count>4</comment_count>
    <who name="arno.">a.renevier</who>
    <bug_when>2012-11-16 17:46:11 -0800</bug_when>
    <thetext>(In reply to comment #2)
&gt; (From update of attachment 174767 [details])
&gt; In the ~WigetGtk g_object_unref is called on the platform widget. Normally gtk_widget_destroy will remove a widget from its container. I&apos;m not sure if g_object_unref does the same here. Can you confirm?

Actually, WidgetGtk has g_object_ref the platform widget before. So, after ~WidgetGtk, the refcount will be 1, and the object will not be disposed.
I tried to just use g_object_unref in platformDestroy.
But then gtk_container_remove is called from the dispose callbacks, which itselfs calls g_object_unref. This is one too much and results in a gobject assertion.
So, I think, as pluginView has gtk_container_add(ed) the socket, it is reasonable to perform the opposite operation and use gtk_container_remove</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>769806</commentid>
    <comment_count>5</comment_count>
    <who name="arno.">a.renevier</who>
    <bug_when>2012-11-16 17:47:08 -0800</bug_when>
    <thetext>(In reply to comment #3)
&gt; (From update of attachment 174767 [details])
&gt; Attachment 174767 [details] did not pass chromium-ews (chromium-xvfb):
&gt; Output: http://queues.webkit.org/results/14859571
&gt; 
&gt; New failing tests:
&gt; inspector-protocol/debugger-terminate-dedicated-worker-while-paused.html

I don&apos;t really understand why this happens</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>771081</commentid>
    <comment_count>6</comment_count>
      <attachid>174767</attachid>
    <who name="Martin Robinson">mrobinson</who>
    <bug_when>2012-11-19 15:09:53 -0800</bug_when>
    <thetext>Comment on attachment 174767
Patch

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

&gt; Source/WebCore/plugins/gtk/PluginViewGtk.cpp:889
&gt;          XFreePixmap(GDK_DISPLAY_XDISPLAY(gdk_display_get_default()), m_drawable);
&gt;          m_drawable = 0;
&gt;      }
&gt; +    GtkWidget* widget = platformWidget();
&gt; +    GtkWidget* parent = gtk_widget_get_parent(widget);
&gt; +    ASSERT(parent);
&gt; +    gtk_container_remove(GTK_CONTAINER(parent), widget);

Is platformDestroy also called for windowless plugins? Windowless plugins do not have platform widgets.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>773433</commentid>
    <comment_count>7</comment_count>
      <attachid>175549</attachid>
    <who name="arno.">a.renevier</who>
    <bug_when>2012-11-21 17:12:49 -0800</bug_when>
    <thetext>Created attachment 175549
Indeed. The updated patch checks if widget is null before going on

updated patch: check if widget is null</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>773489</commentid>
    <comment_count>8</comment_count>
      <attachid>175549</attachid>
    <who name="WebKit Review Bot">webkit.review.bot</who>
    <bug_when>2012-11-21 19:07:51 -0800</bug_when>
    <thetext>Comment on attachment 175549
Indeed. The updated patch checks if widget is null before going on

Attachment 175549 did not pass chromium-ews (chromium-xvfb):
Output: http://queues.webkit.org/results/14959162

New failing tests:
platform/chromium-linux/fast/text/international/complex-joining-using-gpos.html</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>775581</commentid>
    <comment_count>9</comment_count>
      <attachid>175549</attachid>
    <who name="WebKit Review Bot">webkit.review.bot</who>
    <bug_when>2012-11-26 09:52:23 -0800</bug_when>
    <thetext>Comment on attachment 175549
Indeed. The updated patch checks if widget is null before going on

Rejecting attachment 175549 from commit-queue.

New failing tests:
inspector-protocol/debugger-terminate-dedicated-worker-while-paused.html
fast/text/atsui-small-caps-punctuation-size.html
Full output: http://queues.webkit.org/results/14990703</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>775643</commentid>
    <comment_count>10</comment_count>
    <who name="Martin Robinson">mrobinson</who>
    <bug_when>2012-11-26 10:44:32 -0800</bug_when>
    <thetext>(In reply to comment #9)
&gt; (From update of attachment 175549 [details])
&gt; Rejecting attachment 175549 [details] from commit-queue.
&gt; 
&gt; New failing tests:
&gt; inspector-protocol/debugger-terminate-dedicated-worker-while-paused.html
&gt; fast/text/atsui-small-caps-punctuation-size.html
&gt; Full output: http://queues.webkit.org/results/14990703

It&apos;s pretty sad that flaky tests pretty much break the commit queue. :(</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>775864</commentid>
    <comment_count>11</comment_count>
      <attachid>175549</attachid>
    <who name="Martin Robinson">mrobinson</who>
    <bug_when>2012-11-26 14:01:41 -0800</bug_when>
    <thetext>Comment on attachment 175549
Indeed. The updated patch checks if widget is null before going on

Clearing flags on attachment: 175549

Committed r135762: &lt;http://trac.webkit.org/changeset/135762&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>775865</commentid>
    <comment_count>12</comment_count>
    <who name="Martin Robinson">mrobinson</who>
    <bug_when>2012-11-26 14:01:45 -0800</bug_when>
    <thetext>All reviewed patches have been landed.  Closing bug.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="1"
              ispatch="1"
              isprivate="0"
          >
            <attachid>174767</attachid>
            <date>2012-11-16 15:12:22 -0800</date>
            <delta_ts>2012-11-21 17:12:46 -0800</delta_ts>
            <desc>Patch</desc>
            <filename>bug-102564-20121116151015.patch</filename>
            <type>text/plain</type>
            <size>1609</size>
            <attacher name="arno.">a.renevier</attacher>
            
              <data encoding="base64">U3VidmVyc2lvbiBSZXZpc2lvbjogMTM0MTA1CmRpZmYgLS1naXQgYS9Tb3VyY2UvV2ViQ29yZS9D
aGFuZ2VMb2cgYi9Tb3VyY2UvV2ViQ29yZS9DaGFuZ2VMb2cKaW5kZXggN2MxZjI0OWExYjIwMDUz
NmEwZDI4OTgzZTJlNTRlYTZhNTE1YzU2YS4uYWQyMTM5NjYxYzJhMTU0MjY3ZTQ4NDk0N2E1YmMw
YTEyZDVmYTg2ZSAxMDA2NDQKLS0tIGEvU291cmNlL1dlYkNvcmUvQ2hhbmdlTG9nCisrKyBiL1Nv
dXJjZS9XZWJDb3JlL0NoYW5nZUxvZwpAQCAtMSwzICsxLDE5IEBACisyMDEyLTExLTE2ICBBcm5h
dWQgUmVuZXZpZXIgIDxhLnJlbmV2aWVyQHNpc2Euc2Ftc3VuZy5jb20+CisKKyAgICAgICAgW0dU
S10gR3RrU29ja2V0IGlzIGxlYWtlZCB1bnRpbCB3ZWJ2aWV3IGlzIGRlc3Ryb3llZC4KKyAgICAg
ICAgaHR0cHM6Ly9idWdzLndlYmtpdC5vcmcvc2hvd19idWcuY2dpP2lkPTEwMjU2NAorCisgICAg
ICAgIFJldmlld2VkIGJ5IE5PQk9EWSAoT09QUyEpLgorCisgICAgICAgIFJlbW92ZSBHdGtTb2Nr
ZXQgZnJvbSBpdHMgcGFyZW50IHdoZW4gcGx1Z2ludmlldyBpcyBkZXN0cm95ZWQuIFRoZW4sCisg
ICAgICAgIHRoZSBHdGtTb2NrZXQgYW5kIGl0J3MgcG9zc2libGUgY2hpbGQgd2lkZ2V0cyBhcmUg
cmVhbGVhc2VkIHdoZW4gaXQgaXMKKyAgICAgICAgbm8gbW9yZSBuZWVkZWQuCisKKyAgICAgICAg
Tm8gbmV3IHRlc3RzLCBhbHJlYWR5IGNvdmVyZWQgYn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ICAgQVNTRVJUKHBhcmVudCk7CisgICAgZ3RrX2NvbnRhaW5l
cl9yZW1vdmUoR1RLX0NPTlRBSU5FUihwYXJlbnQpLCB3aWRnZXQpOwogfQogCiB9IC8vIG5hbWVz
cGFjZSBXZWJDb3JlCg==
</data>

          </attachment>
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>175549</attachid>
            <date>2012-11-21 17:12:49 -0800</date>
            <delta_ts>2012-11-26 14:01:41 -0800</delta_ts>
            <desc>Indeed. The updated patch checks if widget is null before going on</desc>
            <filename>bug-102564-20121121171033.patch</filename>
            <type>text/plain</type>
            <size>1649</size>
            <attacher name="arno.">a.renevier</attacher>
            
              <data encoding="base64">U3VidmVyc2lvbiBSZXZpc2lvbjogMTM0MTA1CmRpZmYgLS1naXQgYS9Tb3VyY2UvV2ViQ29yZS9D
aGFuZ2VMb2cgYi9Tb3VyY2UvV2ViQ29yZS9DaGFuZ2VMb2cKaW5kZXggN2MxZjI0OWExYjIwMDUz
NmEwZDI4OTgzZTJlNTRlYTZhNTE1YzU2YS4uYWQyMTM5NjYxYzJhMTU0MjY3ZTQ4NDk0N2E1YmMw
YTEyZDVmYTg2ZSAxMDA2NDQKLS0tIGEvU291cmNlL1dlYkNvcmUvQ2hhbmdlTG9nCisrKyBiL1Nv
dXJjZS9XZWJDb3JlL0NoYW5nZUxvZwpAQCAtMSwzICsxLDE5IEBACisyMDEyLTExLTE2ICBBcm5h
dWQgUmVuZXZpZXIgIDxhLnJlbmV2aWVyQHNpc2Euc2Ftc3VuZy5jb20+CisKKyAgICAgICAgW0dU
S10gR3RrU29ja2V0IGlzIGxlYWtlZCB1bnRpbCB3ZWJ2aWV3IGlzIGRlc3Ryb3llZC4KKyAgICAg
ICAgaHR0cHM6Ly9idWdzLndlYmtpdC5vcmcvc2hvd19idWcuY2dpP2lkPTEwMjU2NAorCisgICAg
ICAgIFJldmlld2VkIGJ5IE5PQk9EWSAoT09QUyEpLgorCisgICAgICAgIFJ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