<?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>127474</bug_id>
          
          <creation_ts>2014-01-23 03:36:38 -0800</creation_ts>
          <short_desc>[GTK] Loading page into WebView shows g_closure_unref warning</short_desc>
          <delta_ts>2015-03-14 02:10:03 -0700</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>528+ (Nightly 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></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Tomas Popela">tpopela</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>adamw</cc>
    
    <cc>cgarcia</cc>
    
    <cc>commit-queue</cc>
    
    <cc>gustavo</cc>
    
    <cc>jim</cc>
    
    <cc>mcrha</cc>
    
    <cc>mrobinson</cc>
    
    <cc>paulepanter</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>971098</commentid>
    <comment_count>0</comment_count>
    <who name="Tomas Popela">tpopela</who>
    <bug_when>2014-01-23 03:36:38 -0800</bug_when>
    <thetext>While loading email into WebView in Evolution with WK1 it&apos;s showing this warning. Everything loads and renders fine. I&apos;m on http://trac.webkit.org/changeset/162517  

(evolution:21890): GLib-GObject-CRITICAL **: g_closure_unref: assertion &apos;closure-&gt;ref_count &gt; 0&apos; failed
 
Breakpoint 1, 0x0000003761450220 in g_logv () from /lib64/libglib-2.0.so.0
#0  0x0000003761450220 in g_logv () from /lib64/libglib-2.0.so.0
#1  0x000000376145063f in g_log () from /lib64/libglib-2.0.so.0
#2  0x00007ffff124e50e in WTF::derefGPtr&lt;_GClosure&gt; (ptr=0x38e5200) at ../../Source/WTF/wtf/gobject/GRefPtr.cpp:159
#3  0x00007ffff44360b0 in WTF::GRefPtr&lt;_GClosure&gt;::operator= (this=0x385f330, optr=0x0) at ../../Source/WTF/wtf/gobject/GRefPtr.h:142
#4  0x00007ffff4435e16 in WebCore::GObjectEventListener::gobjectDestroyed (this=0x385f300)
    at ../../Source/WebCore/bindings/gobject/GObjectEventListener.cpp:61
#5  0x00007ffff4435fca in WebCore::GObjectEventListener::gobjectDestroyedCallback (listener=0x385f300)
    at ../../Source/WebCore/bindings/gobject/GObjectEventListener.h:50
#6  0x000000376181409f in weak_refs_notify () from /lib64/libgobject-2.0.so.0
#7  0x0000003761814ee8 in g_object_unref () from /lib64/libgobject-2.0.so.0
#8  0x00007ffff443323c in WebKit::DOMObjectCache::clearByFrame (frame=0x322beb0)
    at ../../Source/WebCore/bindings/gobject/DOMObjectCache.cpp:109
#9  0x00007ffff2fc9c04 in WebKit::FrameLoaderClient::setMainFrameDocumentReady (this=0x3227a90, ready=false)
    at ../../Source/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.cpp:583
#10 0x00007ffff3990384 in WebCore::FrameLoader::closeOldDataSources (this=0x322bf48)
    at ../../Source/WebCore/loader/FrameLoader.cpp:2062
#11 0x00007ffff398f4f0 in WebCore::FrameLoader::commitProvisionalLoad (this=0x322bf48)
    at ../../Source/WebCore/loader/FrameLoader.cpp:1812
#12 0x00007ffff3970fa7 in WebCore::DocumentLoader::commitIfReady (this=0x3949520) at ../../Source/WebCore/loader/DocumentLoader.cpp:354
#13 0x00007ffff3972e96 in WebCore::DocumentLoader::commitLoad (this=0x3949520,
    data=0x35916f0 &quot;&lt;!DOCTYPE HTML&gt;\n&lt;html&gt;\n&lt;head&gt;\n&lt;meta name=\&quot;generator\&quot; content=\&quot;Evolution Mail\&quot;/&gt;\n&lt;title&gt;Evolution Mail Display&lt;/title&gt;\n&lt;/head&gt;\n&lt;body class=\&quot;-e-web-view-background-color e-web-view-text-color\&quot;&gt;  &lt;style&gt;&quot;..., length=465)
    at ../../Source/WebCore/loader/DocumentLoader.cpp:765
#14 0x00007ffff397349f in WebCore::DocumentLoader::dataReceived (this=0x3949520, resource=0x0,
    data=0x35916f0 &quot;&lt;!DOCTYPE HTML&gt;\n&lt;html&gt;\n&lt;head&gt;\n&lt;meta name=\&quot;generator\&quot; content=\&quot;Evolution Mail\&quot;/&gt;\n&lt;title&gt;Evolution Mail Display&lt;/title&gt;\n&lt;/head&gt;\n&lt;body class=\&quot;-e-web-view-background-color e-web-view-text-color\&quot;&gt;  &lt;style&gt;&quot;..., length=465)
    at ../../Source/WebCore/loader/DocumentLoader.cpp:892
#15 0x00007ffff3972dff in WebCore::DocumentLoader::continueAfterContentPolicy (this=0x3949520, policy=WebCore::PolicyUse)
    at ../../Source/WebCore/loader/DocumentLoader.cpp:752
#16 0x00007ffff397269f in WebCore::DocumentLoader::responseReceived (this=0x3949520, resource=0x0, response=...)
    at ../../Source/WebCore/loader/DocumentLoader.cpp:655
#17 0x00007ffff397169d in WebCore::DocumentLoader::handleSubstituteDataLoadNow (this=0x3949520)
    at ../../Source/WebCore/loader/DocumentLoader.cpp:475
#18 0x00007ffff397e9a4 in std::_Mem_fn&lt;void (WebCore::DocumentLoader::*)(WebCore::Timer&lt;WebCore::DocumentLoader&gt;*)&gt;::operator()&lt;WebCore::Timer&lt;WebCore::DocumentLoader&gt;*&amp;, void&gt; (this=0x393bee0, __object=0x3949520) at /usr/include/c++/4.8.2/functional:601
#19 0x00007ffff397e2d3 in std::_Bind&lt;std::_Mem_fn&lt;void (WebCore::DocumentLoader::*)(WebCore::Timer&lt;WebCore::DocumentLoader&gt;*)&gt; (WebCore::DocumentLoader*, WebCore::Timer&lt;WebCore::DocumentLoader&gt;*)&gt;::__call&lt;void, , 0ul, 1ul&gt;(std::tuple&lt;&gt;&amp;&amp;, std::_Index_tuple&lt;0ul, 1ul&gt;) (
    this=0x393bee0, __args=&lt;unknown type in /usr/local/lib/libwebkitgtk-3.0.so.0, CU 0x14f45aaa, DIE 0x1506fb7f&gt;)
    at /usr/include/c++/4.8.2/functional:1296
#20 0x00007ffff397d3c2 in std::_Bind&lt;std::_Mem_fn&lt;void (WebCore::DocumentLoader::*)(WebCore::Timer&lt;WebCore::DocumentLoader&gt;*)&gt; (WebCore::DocumentLoader*, WebCore::Timer&lt;WebCore::DocumentLoader&gt;*)&gt;::operator()&lt;, void&gt;() (this=0x393bee0)
    at /usr/include/c++/4.8.2/functional:1355
#21 0x00007ffff397bb9f in std::_Function_handler&lt;void (), std::_Bind&lt;std::_Mem_fn&lt;void (WebCore::DocumentLoader::*)(WebCore::Timer&lt;WebCore::DocumentLoader&gt;*)&gt; (WebCore::DocumentLoader*, WebCore::Timer&lt;WebCore::DocumentLoader&gt;*)&gt; &gt;::_M_invoke(std::_Any_data const&amp;) (
    __functor=...) at /usr/include/c++/4.8.2/functional:2071
#22 0x00007ffff2fba9e6 in std::function&lt;void ()&gt;::operator()() const (this=0x3949d60) at /usr/include/c++/4.8.2/functional:2464
#23 0x00007ffff397f212 in WebCore::Timer&lt;WebCore::DocumentLoader&gt;::fired (this=0x3949d28) at ../../Source/WebCore/platform/Timer.h:130
#24 0x00007ffff31758d3 in WebCore::ThreadTimers::sharedTimerFiredInternal (this=0x3207ac0)
    at ../../Source/WebCore/platform/ThreadTimers.cpp:132
#25 0x00007ffff3175781 in WebCore::ThreadTimers::sharedTimerFired () at ../../Source/WebCore/platform/ThreadTimers.cpp:107
#26 0x00007ffff319b08e in WebCore::sharedTimerTimeoutCallback () at ../../Source/WebCore/platform/gtk/SharedTimerGtk.cpp:49
#27 0x0000003761449e43 in g_timeout_dispatch () from /lib64/libglib-2.0.so.0
#28 0x00000037614492a6 in g_main_context_dispatch () from /lib64/libglib-2.0.so.0
#29 0x0000003761449628 in g_main_context_iterate.isra.24 () from /lib64/libglib-2.0.so.0
#30 0x0000003761449a3a in g_main_loop_run () from /lib64/libglib-2.0.so.0
#31 0x000000324f9aa355 in gtk_main () from /lib64/libgtk-3.so.0
#32 0x0000000000404b5e in main (argc=1, argv=0x7fffffffd888) at main.c:680</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1005396</commentid>
    <comment_count>1</comment_count>
    <who name="Adam Williamson">adamw</who>
    <bug_when>2014-04-30 09:47:52 -0700</bug_when>
    <thetext>Just to note that this is affecting Fedora Rawhide, I&apos;ve been seeing it for a while.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1059364</commentid>
    <comment_count>2</comment_count>
    <who name="Milan Crha">mcrha</who>
    <bug_when>2015-01-07 03:28:55 -0800</bug_when>
    <thetext>Still there with WebkitGTK 2.4.7</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1068891</commentid>
    <comment_count>3</comment_count>
    <who name="Milan Crha">mcrha</who>
    <bug_when>2015-02-13 05:18:54 -0800</bug_when>
    <thetext>Valgrind report for the warning from WebKitGTK+ 2.4.8:

Invalid read of size 8
    at 0x3A8020F529: g_closure_unref (gclosure.c:581)
    by 0xA7EBEF2: void WTF::derefGPtr&lt;_GClosure&gt;(_GClosure*) (GRefPtr.cpp:159)
    by 0x8663B0D: WTF::GRefPtr&lt;_GClosure&gt;::operator=(_GClosure*) (GRefPtr.h:142)
    by 0x8663872: WebCore::GObjectEventListener::gobjectDestroyed() (GObjectEventListener.cpp:61)
    by 0x8663A27: WebCore::GObjectEventListener::gobjectDestroyedCallback(WebCore::GObjectEventListener*, _GObject*) (GObjectEventListener.h:50)
    by 0x3A80213BDE: weak_refs_notify (gobject.c:2630)
    by 0x3A80214CBB: g_object_unref (gobject.c:3133)
    by 0x86619C6: WebKit::DOMObjectCache::clearByFrame(WebCore::Frame*) (DOMObjectCache.cpp:109)
    by 0x742980B: WebKit::FrameLoaderClient::setMainFrameDocumentReady(bool) (FrameLoaderClientGtk.cpp:583)
    by 0x7D29833: WebCore::FrameLoader::closeOldDataSources() (FrameLoader.cpp:2067)
    by 0x7D28B34: WebCore::FrameLoader::commitProvisionalLoad() (FrameLoader.cpp:1817)
    by 0x7D0A8BA: WebCore::DocumentLoader::commitIfReady() (DocumentLoader.cpp:354)
    by 0x7D0C4FC: WebCore::DocumentLoader::commitLoad(char const*, int) (DocumentLoader.cpp:765)
    by 0x7D0CA2C: WebCore::DocumentLoader::dataReceived(WebCore::CachedResource*, char const*, int) (DocumentLoader.cpp:892)
    by 0x7D0C440: WebCore::DocumentLoader::continueAfterContentPolicy(WebCore::PolicyAction) (DocumentLoader.cpp:752)
    by 0x7D0BD9F: WebCore::DocumentLoader::responseReceived(WebCore::CachedResource*, WebCore::ResourceResponse const&amp;) (DocumentLoader.cpp:655)
    by 0x7D0AEEC: WebCore::DocumentLoader::handleSubstituteDataLoadNow(WebCore::Timer&lt;WebCore::DocumentLoader&gt;*) (DocumentLoader.cpp:475)
    by 0x7D16E7F: void std::_Mem_fn&lt;void (WebCore::DocumentLoader::*)(WebCore::Timer&lt;WebCore::DocumentLoader&gt;*)&gt;::operator()&lt;WebCore::Timer&lt;WebCore::DocumentLoader&gt;*&amp;, void&gt;(WebCore::DocumentLoader*, WebCore::Timer&lt;WebCore::DocumentLoader&gt;*&amp;) const (in /build/local/lib/libwebkitgtk-3.0.so.0.22.14)
    by 0x7D16738: void std::_Bind&lt;std::_Mem_fn&lt;void (WebCore::DocumentLoader::*)(WebCore::Timer&lt;WebCore::DocumentLoader&gt;*)&gt; (WebCore::DocumentLoader*, WebCore::Timer&lt;WebCore::DocumentLoader&gt;*)&gt;::__call&lt;void, , 0ul, 1ul&gt;(std::tuple&lt;&gt;&amp;&amp;, std::_Index_tuple&lt;0ul, 1ul&gt;) (functional:1264)
    by 0x7D1590B: void std::_Bind&lt;std::_Mem_fn&lt;void (WebCore::DocumentLoader::*)(WebCore::Timer&lt;WebCore::DocumentLoader&gt;*)&gt; (WebCore::DocumentLoader*, WebCore::Timer&lt;WebCore::DocumentLoader&gt;*)&gt;::operator()&lt;, void&gt;() (functional:1323)
    by 0x7D145A6: std::_Function_handler&lt;void (), std::_Bind&lt;std::_Mem_fn&lt;void (WebCore::DocumentLoader::*)(WebCore::Timer&lt;WebCore::DocumentLoader&gt;*)&gt; (WebCore::DocumentLoader*, WebCore::Timer&lt;WebCore::DocumentLoader&gt;*)&gt; &gt;::_M_invoke(std::_Any_data const&amp;) (functional:2039)
    by 0x741B7DB: std::function&lt;void ()&gt;::operator()() const (functional:2439)
    by 0x7D17623: WebCore::Timer&lt;WebCore::DocumentLoader&gt;::fired() (Timer.h:132)
    by 0x75A9892: WebCore::ThreadTimers::sharedTimerFiredInternal() (ThreadTimers.cpp:132)
    by 0x75A978A: WebCore::ThreadTimers::sharedTimerFired() (ThreadTimers.cpp:107)
    by 0x75D67BA: WebCore::sharedTimerTimeoutCallback(void*) (SharedTimerGtk.cpp:49)
    by 0x3A7F64A552: g_timeout_dispatch (gmain.c:4520)
    by 0x3A7F649AEA: g_main_dispatch (gmain.c:3111)
    by 0x3A7F649AEA: g_main_context_dispatch (gmain.c:3710)
    by 0x3A7F649E87: g_main_context_iterate.isra.29 (gmain.c:3781)
    by 0x3A7F64A1B1: g_main_loop_run (gmain.c:3975)
    by 0x319E9EBE84: gtk_main (gtkmain.c:1207)
    by 0x404B7F: main (main.c:629)
  Address 0x13bf5480 is 32 bytes inside a block of size 72 free&apos;d
    at 0x4A07CE9: free (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
    by 0x3A7F64F7FE: g_free (gmem.c:190)
    by 0xA7EBEF2: void WTF::derefGPtr&lt;_GClosure&gt;(_GClosure*) (GRefPtr.cpp:159)
    by 0x8663AAD: WTF::GRefPtr&lt;_GClosure&gt;::~GRefPtr() (GRefPtr.h:70)
    by 0x866374E: WebCore::GObjectEventListener::~GObjectEventListener() (GObjectEventListener.cpp:44)
    by 0x86637C7: WebCore::GObjectEventListener::~GObjectEventListener() (GObjectEventListener.cpp:49)
    by 0x7649707: WTF::RefCounted&lt;WebCore::EventListener&gt;::deref() (RefCounted.h:147)
    by 0x7649BA4: derefIfNotNull&lt;WebCore::EventListener&gt; (PassRefPtr.h:39)
    by 0x7649BA4: ~RefPtr (RefPtr.h:55)
    by 0x7649BA4: WebCore::RegisteredEventListener::~RegisteredEventListener() (RegisteredEventListener.h:32)
    by 0x78F199E: WebCore::removeListenerFromVector(WTF::Vector&lt;WebCore::RegisteredEventListener, 1ul, WTF::CrashOnOverflow&gt;*, WebCore::EventListener*, bool, unsigned long&amp;) (EventListenerMap.cpp:144)
    by 0x78F1A3F: WebCore::EventListenerMap::remove(WTF::AtomicString const&amp;, WebCore::EventListener*, bool, unsigned long&amp;) (EventListenerMap.cpp:153)
    by 0x78FA475: WebCore::EventTarget::removeEventListener(WTF::AtomicString const&amp;, WebCore::EventListener*, bool) (EventTarget.cpp:88)
    by 0x791FC50: WebCore::tryRemoveEventListener(WebCore::Node*, WTF::AtomicString const&amp;, WebCore::EventListener*, bool) (Node.cpp:1832)
    by 0x791FD36: WebCore::Node::removeEventListener(WTF::AtomicString const&amp;, WebCore::EventListener*, bool) (Node.cpp:1868)
    by 0x8663851: WebCore::GObjectEventListener::gobjectDestroyed() (GObjectEventListener.cpp:60)
    by 0x8663A27: WebCore::GObjectEventListener::gobjectDestroyedCallback(WebCore::GObjectEventListener*, _GObject*) (GObjectEventListener.h:50)
    by 0x3A80213BDE: weak_refs_notify (gobject.c:2630)
    by 0x3A80214CBB: g_object_unref (gobject.c:3133)
    by 0x86619C6: WebKit::DOMObjectCache::clearByFrame(WebCore::Frame*) (DOMObjectCache.cpp:109)
    by 0x742980B: WebKit::FrameLoaderClient::setMainFrameDocumentReady(bool) (FrameLoaderClientGtk.cpp:583)
    by 0x7D29833: WebCore::FrameLoader::closeOldDataSources() (FrameLoader.cpp:2067)
    by 0x7D28B34: WebCore::FrameLoader::commitProvisionalLoad() (FrameLoader.cpp:1817)
    by 0x7D0A8BA: WebCore::DocumentLoader::commitIfReady() (DocumentLoader.cpp:354)
    by 0x7D0C4FC: WebCore::DocumentLoader::commitLoad(char const*, int) (DocumentLoader.cpp:765)
    by 0x7D0CA2C: WebCore::DocumentLoader::dataReceived(WebCore::CachedResource*, char const*, int) (DocumentLoader.cpp:892)
    by 0x7D0C440: WebCore::DocumentLoader::continueAfterContentPolicy(WebCore::PolicyAction) (DocumentLoader.cpp:752)
    by 0x7D0BD9F: WebCore::DocumentLoader::responseReceived(WebCore::CachedResource*, WebCore::ResourceResponse const&amp;) (DocumentLoader.cpp:655)
    by 0x7D0AEEC: WebCore::DocumentLoader::handleSubstituteDataLoadNow(WebCore::Timer&lt;WebCore::DocumentLoader&gt;*) (DocumentLoader.cpp:475)
    by 0x7D16E7F: void std::_Mem_fn&lt;void (WebCore::DocumentLoader::*)(WebCore::Timer&lt;WebCore::DocumentLoader&gt;*)&gt;::operator()&lt;WebCore::Timer&lt;WebCore::DocumentLoader&gt;*&amp;, void&gt;(WebCore::DocumentLoader*, WebCore::Timer&lt;WebCore::DocumentLoader&gt;*&amp;) const (in /build/local/lib/libwebkitgtk-3.0.so.0.22.14)
    by 0x7D16738: void std::_Bind&lt;std::_Mem_fn&lt;void (WebCore::DocumentLoader::*)(WebCore::Timer&lt;WebCore::DocumentLoader&gt;*)&gt; (WebCore::DocumentLoader*, WebCore::Timer&lt;WebCore::DocumentLoader&gt;*)&gt;::__call&lt;void, , 0ul, 1ul&gt;(std::tuple&lt;&gt;&amp;&amp;, std::_Index_tuple&lt;0ul, 1ul&gt;) (functional:1264)
    by 0x7D1590B: void std::_Bind&lt;std::_Mem_fn&lt;void (WebCore::DocumentLoader::*)(WebCore::Timer&lt;WebCore::DocumentLoader&gt;*)&gt; (WebCore::DocumentLoader*, WebCore::Timer&lt;WebCore::DocumentLoader&gt;*)&gt;::operator()&lt;, void&gt;() (functional:1323)
    by 0x7D145A6: std::_Function_handler&lt;void (), std::_Bind&lt;std::_Mem_fn&lt;void (WebCore::DocumentLoader::*)(WebCore::Timer&lt;WebCore::DocumentLoader&gt;*)&gt; (WebCore::DocumentLoader*, WebCore::Timer&lt;WebCore::DocumentLoader&gt;*)&gt; &gt;::_M_invoke(std::_Any_data const&amp;) (functional:2039)
    by 0x741B7DB: std::function&lt;void ()&gt;::operator()() const (functional:2439)
    by 0x7D17623: WebCore::Timer&lt;WebCore::DocumentLoader&gt;::fired() (Timer.h:132)
    by 0x75A9892: WebCore::ThreadTimers::sharedTimerFiredInternal() (ThreadTimers.cpp:132)
    by 0x75A978A: WebCore::ThreadTimers::sharedTimerFired() (ThreadTimers.cpp:107)
    by 0x75D67BA: WebCore::sharedTimerTimeoutCallback(void*) (SharedTimerGtk.cpp:49)
    by 0x3A7F64A552: g_timeout_dispatch (gmain.c:4520)
    by 0x3A7F649AEA: g_main_dispatch (gmain.c:3111)
    by 0x3A7F649AEA: g_main_context_dispatch (gmain.c:3710)
    by 0x3A7F649E87: g_main_context_iterate.isra.29 (gmain.c:3781)
    by 0x3A7F64A1B1: g_main_loop_run (gmain.c:3975)
    by 0x319E9EBE84: gtk_main (gtkmain.c:1207)
    by 0x404B7F: main (main.c:629)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1068916</commentid>
    <comment_count>4</comment_count>
      <attachid>246524</attachid>
    <who name="Milan Crha">mcrha</who>
    <bug_when>2015-02-13 07:35:55 -0800</bug_when>
    <thetext>Created attachment 246524
proposed patch

This was a use-after-free in case when the target had the last reference to the object, then the call to target-&gt;removeEventListener() caused the object&apos;s destruction, thus the assignment after the call, m_handler = 0;, was done on an already freed object.

Adding a temporary reference and dereference it at the very end, as the last thing in the function, fixed the runtime warning and the invalid memory usage.

Please include it in the webkit1 release too.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1068917</commentid>
    <comment_count>5</comment_count>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2015-02-13 07:37:12 -0800</bug_when>
    <thetext>Attachment 246524 did not pass style-queue:


ERROR: Source/WebCore/ChangeLog:8:  You should remove the &apos;No new tests&apos; and either add and list tests, or explain why no new tests were possible.  [changelog/nonewtests] [5]
Total errors found: 1 in 2 files


If any of these errors are false positives, please file a bug against check-webkit-style.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1068947</commentid>
    <comment_count>6</comment_count>
      <attachid>246524</attachid>
    <who name="Anders Carlsson">andersca</who>
    <bug_when>2015-02-13 10:32:02 -0800</bug_when>
    <thetext>Comment on attachment 246524
proposed patch

This looks good conceptually, but please use a Ref protector instead of calling ref/deref explicitly!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1068954</commentid>
    <comment_count>7</comment_count>
      <attachid>246524</attachid>
    <who name="Carlos Garcia Campos">cgarcia</who>
    <bug_when>2015-02-13 10:42:06 -0800</bug_when>
    <thetext>Comment on attachment 246524
proposed patch

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

Do we have a simple test case or any other way to reproduce this? If we could add at least a unit test it would be perfect.

&gt; Source/WebCore/bindings/gobject/GObjectEventListener.cpp:58
&gt; +    // Add one reference in case the &apos;target&apos; holds the last reference,
&gt; +    // which may cause, inside removeEventListener(), free of this object
&gt; +    // and later use-after-free with the m_handler = 0; assignment.
&gt; +    ref();

As Anders suggests, you could do something like RefPtr&lt;GObjectEventListener&gt; protect(this); instead of calling ref/deref.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1069380</commentid>
    <comment_count>8</comment_count>
    <who name="Milan Crha">mcrha</who>
    <bug_when>2015-02-15 23:13:47 -0800</bug_when>
    <thetext>(In reply to comment #7)
&gt; Do we have a simple test case or any other way to reproduce this? If we
&gt; could add at least a unit test it would be perfect.

I didn&apos;t try it, but I suppose this is related to GTK+ widgets/plugins, which Evolution uses, thus a dead end in case of WebKit2.

&gt; As Anders suggests, you could do something like RefPtr&lt;GObjectEventListener&gt;
&gt; protect(this); instead of calling ref/deref.

This is a mater of taste. I do not like to rely on compiler optimizations of an auto_pointer-like classes and their freeing in the right time, thus calling ref/defer &quot;directly&quot; ensures that the call is done always in the right time, instead of in the time when the compiler decides it&apos;s the best time for it.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1069381</commentid>
    <comment_count>9</comment_count>
    <who name="Carlos Garcia Campos">cgarcia</who>
    <bug_when>2015-02-15 23:29:31 -0800</bug_when>
    <thetext>(In reply to comment #8)
&gt; (In reply to comment #7)
&gt; &gt; Do we have a simple test case or any other way to reproduce this? If we
&gt; &gt; could add at least a unit test it would be perfect.
&gt; 
&gt; I didn&apos;t try it, but I suppose this is related to GTK+ widgets/plugins,
&gt; which Evolution uses, thus a dead end in case of WebKit2.
&gt; 
&gt; &gt; As Anders suggests, you could do something like RefPtr&lt;GObjectEventListener&gt;
&gt; &gt; protect(this); instead of calling ref/deref.
&gt; 
&gt; This is a mater of taste. I do not like to rely on compiler optimizations of
&gt; an auto_pointer-like classes and their freeing in the right time, thus
&gt; calling ref/defer &quot;directly&quot; ensures that the call is done always in the
&gt; right time, instead of in the time when the compiler decides it&apos;s the best
&gt; time for it.

WebKit uses RefPtr everywhere and the implicit ref/deref is the preferred way.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1069389</commentid>
    <comment_count>10</comment_count>
      <attachid>246638</attachid>
    <who name="Milan Crha">mcrha</who>
    <bug_when>2015-02-16 00:35:54 -0800</bug_when>
    <thetext>Created attachment 246638
proposed patch ][

Uses RefPtr template now, also done a littel cleanup in the function. No unit tests added, though.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1069393</commentid>
    <comment_count>11</comment_count>
      <attachid>246638</attachid>
    <who name="Carlos Garcia Campos">cgarcia</who>
    <bug_when>2015-02-16 01:39:27 -0800</bug_when>
    <thetext>Comment on attachment 246638
proposed patch ][

Perfect, thanks!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1069396</commentid>
    <comment_count>12</comment_count>
      <attachid>246638</attachid>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2015-02-16 02:24:19 -0800</bug_when>
    <thetext>Comment on attachment 246638
proposed patch ][

Clearing flags on attachment: 246638

Committed r180141: &lt;http://trac.webkit.org/changeset/180141&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1069397</commentid>
    <comment_count>13</comment_count>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2015-02-16 02:24:24 -0800</bug_when>
    <thetext>All reviewed patches have been landed.  Closing bug.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1077140</commentid>
    <comment_count>14</comment_count>
    <who name="Paul Menzel">paulepanter</who>
    <bug_when>2015-03-14 02:10:03 -0700</bug_when>
    <thetext>This is report #780444 [1] in the Debian bug tracking system.

[1] https://bugs.debian.org/780444</thetext>
  </long_desc>
      
          <attachment
              isobsolete="1"
              ispatch="1"
              isprivate="0"
          >
            <attachid>246524</attachid>
            <date>2015-02-13 07:35:55 -0800</date>
            <delta_ts>2015-02-16 00:35:54 -0800</delta_ts>
            <desc>proposed patch</desc>
            <filename>wk.patch</filename>
            <type>text/plain</type>
            <size>1764</size>
            <attacher name="Milan Crha">mcrha</attacher>
            
              <data encoding="base64">ZGlmZiAtLWdpdCBhL1NvdXJjZS9XZWJDb3JlL0NoYW5nZUxvZyBiL1NvdXJjZS9XZWJDb3JlL0No
YW5nZUxvZwppbmRleCBlNTY1MjNlLi5kYTRlOTVjIDEwMDY0NAotLS0gYS9Tb3VyY2UvV2ViQ29y
ZS9DaGFuZ2VMb2cKKysrIGIvU291cmNlL1dlYkNvcmUvQ2hhbmdlTG9nCkBAIC0xLDMgKzEsMTUg
QEAKKzIwMTUtMDItMTMgIE1pbGFuIENyaGEgIDxtY3JoYUByZWRoYXQuY29tPgorCisgICAgICAg
IFtHVEtdIExvYWRpbmcgcGFnZSBpbnRvIFdlYlZpZXcgc2hvd3MgZ19jbG9zdXJlX3VucmVmIHdh
cm5pbm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dGhlICd0YXJnZXQnIGhvbGRzIHRoZSBsYXN0IHJlZmVyZW5jZSwKKyAgICAvLyB3
aGljaCBtYXkgY2F1c2UsIGluc2lkZSByZW1vdmVFdmVudExpc3RlbmVyKCksIGZyZWUgb2YgdGhp
cyBvYmplY3QKKyAgICAvLyBhbmQgbGF0ZXIgdXNlLWFmdGVyLWZyZWUgd2l0aCB0aGUgbV9oYW5k
bGVyID0gMDsgYXNzaWdubWVudC4KKyAgICByZWYoKTsKKwogICAgIC8vIFdlIG11c3Qgc2V0IG1f
Y29yZVRhcmdldCB0byBudWxsLCBiZWNhdXNlIHJlbW92ZUV2ZW50TGlzdGVuZXIKICAgICAvLyBt
YXkgY2FsbCB0aGUgZGVzdHJ1Y3RvciBhcyBhIHNpZGUgZWZmZWN0IGFuZCB3ZSBtdXN0IGJlIGlu
IHRoZQogICAgIC8vIHByb3BlciBzdGF0ZSB0byBwcmV2ZW50IGdfb2JqZWN0X3dlYWtfdW5yZWYu
CkBAIC01OSw2ICs2NCw4IEBAIHZvaWQgR09iamVjdEV2ZW50TGlzdGVuZXI6OmdvYmplY3REZXN0
cm95ZWQoKQogICAgIG1fY29yZVRhcmdldCA9IDA7CiAgICAgdGFyZ2V0LT5yZW1vdmVFdmVudExp
c3RlbmVyKG1fZG9tRXZlbnROYW1lLmRhdGEoKSwgdGhpcywgbV9jYXB0dXJlKTsKICAgICBtX2hh
bmRsZXIgPSAwOworCisgICAgZGVyZWYoKTsKIH0KIAogdm9pZCBHT2JqZWN0RXZlbnRMaXN0ZW5l
cjo6aGFuZGxlRXZlbnQoU2NyaXB0RXhlY3V0aW9uQ29udGV4dCosIEV2ZW50KiBldmVudCkK
</data>
<flag name="review"
          id="271464"
          type_id="1"
          status="-"
          setter="andersca"
    />
    <flag name="commit-queue"
          id="271465"
          type_id="3"
          status="-"
          setter="andersca"
    />
          </attachment>
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>246638</attachid>
            <date>2015-02-16 00:35:54 -0800</date>
            <delta_ts>2015-02-16 02:24:19 -0800</delta_ts>
            <desc>proposed patch ][</desc>
            <filename>wk.patch</filename>
            <type>text/plain</type>
            <size>1748</size>
            <attacher name="Milan Crha">mcrha</attacher>
            
              <data encoding="base64">ZGlmZiAtLWdpdCBhL1NvdXJjZS9XZWJDb3JlL0NoYW5nZUxvZyBiL1NvdXJjZS9XZWJDb3JlL0No
YW5nZUxvZwppbmRleCAwMDMyODk1Li5kYTVjODE3IDEwMDY0NAotLS0gYS9Tb3VyY2UvV2ViQ29y
ZS9DaGFuZ2VMb2cKKysrIGIvU291cmNlL1dlYkNvcmUvQ2hhbmdlTG9nCkBAIC0xLDMgKzEsMTMg
QEAKKzIwMTUtMDItMTYgIE1pbGFuIENyaGEgIDxtY3JoYUByZWRoYXQuY29tPgorCisgICAgICAg
IFtHVEtdIExvYWRpbmcgcGFnZSBpbnRvIFdlYlZpZXcgc2hvd3MgZ19jbG9zdXJlX3VucmVmIHdh
cm5pbmcKKyAgICAgICAgaHR0cHM6Ly9idWdzLndlYmtpdC5vcmcvc2hvd19idWcuY2dpP2lkPTEy
NzQ3NAorCisgICAgICAgIFJldmlld2VkIGJ5IE5PQk9EWSAoT09QUyEpLgorCisgICAgICAgICog
YmluZGluZ3MvZ29iamVjdC9HT2JqZWN0RXZlbnRMaXN0ZW5lci5jcHA6CisgICAgICAgIChXZWJD
b3JlOjpHT2JqZWN0RXZlbnRMaXN0ZW5lcjo6Z29iamVjdERlc3Ryb3llZCk6CisKIDIwMTUtMDIt
MTUgIERhdmlkIEtpbHplciAgPGRka2lsemVyQGFwcGxlLmNvbT4KIAogICAgICAgICBSRUdSRVNT
SU9OIChyMTgwMDgyKTogV2ViQ29yZSBEZWJ1ZyBidWlsZHMgZmFpbCBvbiBNYXZlcmlja3MgZHVl
IHRvIHdlYWsgZXhwb3J0IHN5bWJvbHMKZGlmZiAtLWdpdCBhL1NvdXJjZS9XZWJDb3JlL2JpbmRp
bmdzL2dvYmplY3QvR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