<?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>115407</bug_id>
          
          <creation_ts>2013-04-30 01:30:58 -0700</creation_ts>
          <short_desc>REGRESION(r149338): WebKitTestRunner crashing on Qt WK2, EFL WK2</short_desc>
          <delta_ts>2013-04-30 04:18:01 -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>Tools / Tests</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>
          
          <blocked>115384</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="Zoltan Arvai">zarvai</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>allan.jensen</cc>
    
    <cc>andersca</cc>
    
    <cc>bw80.lee</cc>
    
    <cc>hausmann</cc>
    
    <cc>jturcotte</cc>
    
    <cc>kadam</cc>
    
    <cc>rakuco</cc>
    
    <cc>sam</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>882977</commentid>
    <comment_count>0</comment_count>
    <who name="Zoltan Arvai">zarvai</who>
    <bug_when>2013-04-30 01:30:58 -0700</bug_when>
    <thetext>All tests crashing after the patch, because platform specific RunLoop files not updated well.


17:45:53.357 19964 worker/0 http/tests/cache/cached-main-resource.html crashed, (no stderr)
17:45:53.358 19964 [1/28401] http/tests/cache/cached-main-resource.html failed unexpectedly (WebKitTestRunner crashed [pid=20217])
17:45:53.358 19964 worker/0 killing driver
17:45:53.358 19964 worker/0 http/tests/cache/cached-main-resource.html failed:
17:45:53.358 19964 worker/0  WebKitTestRunner crashed [pid=20217]
17:45:53.715 19964 worker/0 http/tests/cache/cancel-during-failure-crash.html crashed, (no stderr)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>882984</commentid>
    <comment_count>1</comment_count>
    <who name="Byungwoo Lee">bw80.lee</who>
    <bug_when>2013-04-30 01:47:12 -0700</bug_when>
    <thetext>RunLoop::current() returns 0 and below seems to make this problem.

 RunLoop* RunLoop::current()
 {
-    DEFINE_STATIC_LOCAL(WTF::ThreadSpecific&lt;RunLoop&gt;, runLoopData, ());
-    return &amp;*runLoopData;
+    DEFINE_STATIC_LOCAL(WTF::ThreadSpecific&lt;RefPtr&lt;RunLoop&gt; &gt;, runLoopData, ());
+    return runLoopData-&gt;get();
 }

RefPtr&lt;RunLoop&gt; will be empty because DEFINE_STATIC_LOCAL will not create RunLoop instance.

I made a change as following, and it works ok.
But I&apos;m not sure this is the right solution.

 RunLoop* RunLoop::current()
 {
-    DEFINE_STATIC_LOCAL(WTF::ThreadSpecific&lt;RefPtr&lt;RunLoop&gt; &gt;, runLoopData, ());
-    return runLoopData-&gt;get();
+    DEFINE_STATIC_LOCAL(WTF::ThreadSpecific&lt;RefPtr&lt;RunLoop&gt; &gt;, runLoopRefPtrData, ());
+    DEFINE_STATIC_LOCAL(WTF::ThreadSpecific&lt;RunLoop&gt;, runLoopData, ());
+    if (!runLoopRefPtrData.isSet())
+        *runLoopRefPtrData = adoptRef((RunLoop*)runLoopData);
+    return runLoopRefPtrData-&gt;get();
 }

is there any one who knows the clear point about this?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>882987</commentid>
    <comment_count>2</comment_count>
    <who name="Byungwoo Lee">bw80.lee</who>
    <bug_when>2013-04-30 01:56:51 -0700</bug_when>
    <thetext>checking isSet() seems incorrect.

 RunLoop* RunLoop::current()
 {
-    DEFINE_STATIC_LOCAL(WTF::ThreadSpecific&lt;RefPtr&lt;RunLoop&gt; &gt;, runLoopData, ());
-    return runLoopData-&gt;get();
+    DEFINE_STATIC_LOCAL(WTF::ThreadSpecific&lt;RefPtr&lt;RunLoop&gt; &gt;, runLoopRefPtrData, ());
+    DEFINE_STATIC_LOCAL(WTF::ThreadSpecific&lt;RunLoop&gt;, runLoopData, ());
+    if (!runLoopRefPtrData-&gt;get())
+        *runLoopRefPtrData = adoptRef((RunLoop*)runLoopData);
+    return runLoopRefPtrData-&gt;get();
 }</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>883014</commentid>
    <comment_count>3</comment_count>
    <who name="Zoltan Arvai">zarvai</who>
    <bug_when>2013-04-30 04:18:01 -0700</bug_when>
    <thetext>Closing. R149338 rolled out in http://trac.webkit.org/changeset/149358.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>