<?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>219591</bug_id>
          
          <creation_ts>2020-12-07 01:18:23 -0800</creation_ts>
          <short_desc>[WTF] RunLoop::dispatchAfter() leaks pending timers after thread termination</short_desc>
          <delta_ts>2021-01-20 07:39:11 -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>Web Template Framework</component>
          <version>WebKit Nightly Build</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          <see_also>https://bugs.webkit.org/show_bug.cgi?id=219232</see_also>
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Zan Dobersek">zan</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>ggaren</cc>
    
    <cc>mcatanzaro</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1712397</commentid>
    <comment_count>0</comment_count>
    <who name="Zan Dobersek">zan</who>
    <bug_when>2020-12-07 01:18:23 -0800</bug_when>
    <thetext>Spun from  bug #219232.

Any task queued via RunLoop::dispatchAfter() is leaked if the RunLoop thread terminates before the underlying DispatchTimer is fired because the DispatchTimer is only freed when it&apos;s fired, which doesn&apos;t happen after the RunLoop thread terminates.

Right now, the RunLoop reference taken via TimerBase (from which DispatchTimer derives) also blocks the RunLoop object to be destroyed once the thread is terminated. Bug #219232 doesn&apos;t help here because DispatchTimer instances are not stored in any containers that could be cleared at the point of termination.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1712398</commentid>
    <comment_count>1</comment_count>
      <attachid>415538</attachid>
    <who name="Zan Dobersek">zan</who>
    <bug_when>2020-12-07 01:19:24 -0800</bug_when>
    <thetext>Created attachment 415538
Unit test</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1714391</commentid>
    <comment_count>2</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2020-12-14 01:19:18 -0800</bug_when>
    <thetext>&lt;rdar://problem/72288000&gt;</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>415538</attachid>
            <date>2020-12-07 01:19:24 -0800</date>
            <delta_ts>2020-12-07 01:19:24 -0800</delta_ts>
            <desc>Unit test</desc>
            <filename>unittest.patch</filename>
            <type>text/plain</type>
            <size>779</size>
            <attacher name="Zan Dobersek">zan</attacher>
            
              <data encoding="base64">ZGlmZiAtLWdpdCBhL1Rvb2xzL1Rlc3RXZWJLaXRBUEkvVGVzdHMvV1RGL1J1bkxvb3AuY3BwIGIv
VG9vbHMvVGVzdFdlYktpdEFQSS9UZXN0cy9XVEYvUnVuTG9vcC5jcHAKaW5kZXggNTQxNjEwYTY4
MTkyLi4yNDAwOTJkOTliNTEgMTAwNjQ0Ci0tLSBhL1Rvb2xzL1Rlc3RXZWJLaXRBUEkvVGVzdHMv
V1RGL1J1bkxvb3AuY3BwCisrKyBiL1Rvb2xzL1Rlc3RXZWJLaXRBUEkvVGVzdHMvV1RGL1J1bkxv
b3AuY3BwCkBAIC0yMTUsNCArMjE1LDE4IEBAIFRFU1QoV1RGX1J1bkxvb3AsIE1hbnlUaW1lcykK
ICAgICB9KS0+d2FpdEZvckNvbXBsZXRpb24oKTsKIH0KIAorVEVTVChXVEZfUnVuTG9vcCwgVGhy
ZWFkVGVybWlu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