<?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>75064</bug_id>
          
          <creation_ts>2011-12-21 21:47:58 -0800</creation_ts>
          <short_desc>TestWebKitAPI: initialize the main thread before running tests</short_desc>
          <delta_ts>2012-01-04 11:26:25 -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>Tools / Tests</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>WONTFIX</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="David Kilzer (:ddkilzer)">ddkilzer</reporter>
          <assigned_to name="David Kilzer (:ddkilzer)">ddkilzer</assigned_to>
          <cc>aroben</cc>
    
    <cc>sam</cc>
    
    <cc>webkit.review.bot</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>525991</commentid>
    <comment_count>0</comment_count>
    <who name="David Kilzer (:ddkilzer)">ddkilzer</who>
    <bug_when>2011-12-21 21:47:58 -0800</bug_when>
    <thetext>Currently TestWebKitAPI doesn&apos;t initialize the main thread before running any tests.  This can lead to assertion failures in Debug builds when calling (for example) WebCore::UTF8Encoding() in a test.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>525996</commentid>
    <comment_count>1</comment_count>
      <attachid>120271</attachid>
    <who name="David Kilzer (:ddkilzer)">ddkilzer</who>
    <bug_when>2011-12-21 21:55:10 -0800</bug_when>
    <thetext>Created attachment 120271
Patch v1</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>526017</commentid>
    <comment_count>2</comment_count>
    <who name="David Kilzer (:ddkilzer)">ddkilzer</who>
    <bug_when>2011-12-21 22:27:31 -0800</bug_when>
    <thetext>Here&apos;s an example stack trace of such a crash:

Exception Type:  EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_INVALID_ADDRESS at 0x00000000bbadbeef

VM Regions Near 0xbbadbeef:
--&gt; 
    __TEXT                 0000000105fe7000-00000001060fd000 [ 1112K] r-x/rwx SM=COW  /Volumes/VOLUME/*

Application Specific Information:
objc[49579]: garbage collection is OFF

Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0   com.apple.JavaScriptCore            0x000000010792e203 WTF::isMainThread() + 195 (MainThreadMac.mm:144)
1   com.apple.WebCore                   0x00000001098a3efd _ZN7WebCoreL22buildBaseTextCodecMapsEv + 13 (TextEncodingRegistry.cpp:213)
2   com.apple.WebCore                   0x00000001098a3e2a WebCore::atomicCanonicalTextEncodingName(char const*) + 74 (TextEncodingRegistry.cpp:338)
3   com.apple.WebCore                   0x00000001098a2c21 WebCore::TextEncoding::TextEncoding(char const*) + 33 (TextEncoding.cpp:55)
4   com.apple.WebCore                   0x00000001098a2bed WebCore::TextEncoding::TextEncoding(char const*) + 29 (TextEncoding.cpp:58)
5   com.apple.WebCore                   0x00000001098a3598 WebCore::UTF8Encoding() + 40 (TextEncoding.cpp:250)
6   com.apple.WebCore                   0x000000010928e7b4 WebCore::decodeURLEscapeSequences(WTF::String const&amp;) + 36 (KURL.cpp:919)
7   com.apple.WebCore                   0x000000010928e77a WebCore::KURL::host() const + 90 (KURL.cpp:586)
8   TestWebKitAPI                       0x0000000106073fbf TestWebKitAPI::WebCore_KURLConstCharConstructor_Test::TestBody() + 2015 (KURL.cpp:54)
9   TestWebKitAPI                       0x000000010607e7ca testing::Test::Run() + 154
10  TestWebKitAPI                       0x000000010607f0cd testing::internal::TestInfoImpl::Run() + 189
11  TestWebKitAPI                       0x000000010607f8fd testing::TestCase::Run() + 205
12  TestWebKitAPI                       0x00000001060849e9 testing::internal::UnitTestImpl::RunAllTests() + 793
13  TestWebKitAPI                       0x00000001060846c9 testing::UnitTest::Run() + 25
14  TestWebKitAPI                       0x0000000105fe9870 TestWebKitAPI::TestsController::run(int, char**) + 48 (TestsController.cpp:51)
15  TestWebKitAPI                       0x0000000105fe96e9 main + 121 (main.mm:35)
16  TestWebKitAPI                       0x0000000105fe8ca4 start + 52</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>526275</commentid>
    <comment_count>3</comment_count>
      <attachid>120271</attachid>
    <who name="WebKit Review Bot">webkit.review.bot</who>
    <bug_when>2011-12-22 08:41:42 -0800</bug_when>
    <thetext>Comment on attachment 120271
Patch v1

Clearing flags on attachment: 120271

Committed r103546: &lt;http://trac.webkit.org/changeset/103546&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>526276</commentid>
    <comment_count>4</comment_count>
    <who name="WebKit Review Bot">webkit.review.bot</who>
    <bug_when>2011-12-22 08:41:46 -0800</bug_when>
    <thetext>All reviewed patches have been landed.  Closing bug.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>527073</commentid>
    <comment_count>5</comment_count>
    <who name="Sam Weinig">sam</who>
    <bug_when>2011-12-25 12:31:38 -0800</bug_when>
    <thetext>I am not sure I like this solution. Since one of the goals of this test runner is to test that the API works (and you wouldn&apos;t use this internal method when using API) this won&apos;t be testing if we forget to initialize threading for some API calls. 

Perhaps we can install some sort of helper for WebCore / JavaScriptCore internals tests that does the initialization only for them.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>529616</commentid>
    <comment_count>6</comment_count>
    <who name="David Kilzer (:ddkilzer)">ddkilzer</who>
    <bug_when>2012-01-04 11:02:01 -0800</bug_when>
    <thetext>(In reply to comment #5)
&gt; I am not sure I like this solution. Since one of the goals of this test runner is to test that the API works (and you wouldn&apos;t use this internal method when using API) this won&apos;t be testing if we forget to initialize threading for some API calls. 
&gt; 
&gt; Perhaps we can install some sort of helper for WebCore / JavaScriptCore internals tests that does the initialization only for them.

That&apos;s a great point.  I will back out this change and use a setup/helper function for the WebCore tests I&apos;m writing.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>529635</commentid>
    <comment_count>7</comment_count>
    <who name="David Kilzer (:ddkilzer)">ddkilzer</who>
    <bug_when>2012-01-04 11:26:25 -0800</bug_when>
    <thetext>(In reply to comment #6)
&gt; (In reply to comment #5)
&gt; &gt; I am not sure I like this solution. Since one of the goals of this test runner is to test that the API works (and you wouldn&apos;t use this internal method when using API) this won&apos;t be testing if we forget to initialize threading for some API calls. 
&gt; &gt; 
&gt; &gt; Perhaps we can install some sort of helper for WebCore / JavaScriptCore internals tests that does the initialization only for them.
&gt; 
&gt; That&apos;s a great point.  I will back out this change and use a setup/helper function for the WebCore tests I&apos;m writing.

Backed out in r104050:  &lt;http://trac.webkit.org/changeset/104050&gt;

Marking this bug as RESOLVED/WONTFIX.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>120271</attachid>
            <date>2011-12-21 21:55:10 -0800</date>
            <delta_ts>2011-12-22 08:41:42 -0800</delta_ts>
            <desc>Patch v1</desc>
            <filename>bug-75064-20111221215509.patch</filename>
            <type>text/plain</type>
            <size>1592</size>
            <attacher name="David Kilzer (:ddkilzer)">ddkilzer</attacher>
            
              <data encoding="base64">U3VidmVyc2lvbiBSZXZpc2lvbjogMTAyMzQzCmRpZmYgLS1naXQgYS9Ub29scy9DaGFuZ2VMb2cg
Yi9Ub29scy9DaGFuZ2VMb2cKaW5kZXggOGY3M2Q2MDM2MDkwYjExNjE5YmZiZDY4MWE4YWM5ODc2
ZTAxYWE1Zi4uZDE5MGZmNzQ2ZjJhZmExODk2MzBlZDFmMTZjMzI4OTIyODlkZmUzNCAxMDA2NDQK
LS0tIGEvVG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