<?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>23960</bug_id>
          
          <creation_ts>2009-02-13 17:32:53 -0800</creation_ts>
          <short_desc>WTF::isMainThread relies on initializeThreading incorrectly</short_desc>
          <delta_ts>2009-02-13 17:53:48 -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>WebKit Qt</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>Other</rep_platform>
          <op_sys>All</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="Adam Treat">manyoso</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>hausmann</cc>
    
    <cc>staikos</cc>
    
    <cc>zimmermann</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>109763</commentid>
    <comment_count>0</comment_count>
    <who name="Adam Treat">manyoso</who>
    <bug_when>2009-02-13 17:32:53 -0800</bug_when>
    <thetext>Here is the stack trace of a crash I received with Arora using ToT:

#0  WTF::isMainThread () at ../../../../JavaScriptCore/wtf/ThreadingQt.cpp:194                                                                        
#1  0xb68d9cc8 in buildBaseTextCodecMaps () at ../../../../WebCore/platform/text/TextEncodingRegistry.cpp:172                                         
#2  0xb68da235 in WebCore::atomicCanonicalTextEncodingName (name=0xb717d552 &quot;UTF-8&quot;) at ../../../../WebCore/platform/text/TextEncodingRegistry.cpp:227
#3  0xb68d7563 in TextEncoding (this=0xb7ee0158, name=0xb717d552 &quot;UTF-8&quot;) at ../../../../WebCore/platform/text/TextEncoding.cpp:61                    
#4  0xb68d7678 in WebCore::UTF8Encoding () at ../../../../WebCore/platform/text/TextEncoding.cpp:231                                                  
#5  0xb6a83000 in KURL (this=0xbfe674a8, url=@0xbfe675c0) at ../../../../WebCore/platform/qt/KURLQt.cpp:40                                            
#6  0xb6abb70a in QWebSettings::iconForUrl (url=@0xbfe675c0) at ../../../../WebKit/qt/Api/qwebsettings.cpp:487                                        
#7  0x0807e0df in BrowserApplication::icon (url=@0xbfe675c0) at browserapplication.cpp:492                                                            
#8  0x080a6a63 in LocationBarSiteIcon::webViewSiteIconChanged (this=0x8341d68) at locationbar.cpp:57                                                  
#9  0x080a6bbc in LocationBarSiteIcon (this=0x8341d68, parent=0x8342a90) at locationbar.cpp:40
#10 0x080a6c94 in LocationBar (this=0x8342a90, parent=0x0) at locationbar.cpp:94
#11 0x080c74c9 in TabWidget::makeNewTab (this=0x81d7260, makeCurrent=true) at tabwidget.cpp:440
#12 0x080c7ef5 in TabWidget::newTab (this=0x81d7260) at tabwidget.cpp:417
#13 0x0808bdd4 in BrowserMainWindow (this=0x81ca830, parent=0x0, flags=@0xbfe678b8) at browsermainwindow.cpp:218
#14 0x0807e59c in BrowserApplication::newMainWindow (this=0xbfe678f8) at browserapplication.cpp:432
#15 0x080eda82 in main (argc=2, argv=0xbfe679b4) at main.cpp:36

The problem is that Arora calls QWebSettings::iconForUrl() before it constructs a QWebPage.  The QWebSettings::iconForUrl() call eventually causes an &apos;ASSERT(isMainThread())&apos; deep within WebCore.

The patch attached fixes this crash by making &apos;isMainThread()&apos; not rely upon &apos;initializeThreading&apos; being called first.

Cheers,
Adam</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>109764</commentid>
    <comment_count>1</comment_count>
      <attachid>27678</attachid>
    <who name="Adam Treat">manyoso</who>
    <bug_when>2009-02-13 17:33:35 -0800</bug_when>
    <thetext>Created attachment 27678
Fix for the crash</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>109765</commentid>
    <comment_count>2</comment_count>
    <who name="Adam Treat">manyoso</who>
    <bug_when>2009-02-13 17:51:21 -0800</bug_when>
    <thetext>Fixed with r41013 and reviewed by George Staikos over skype.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>109766</commentid>
    <comment_count>3</comment_count>
      <attachid>27678</attachid>
    <who name="Darin Adler">darin</who>
    <bug_when>2009-02-13 17:53:48 -0800</bug_when>
    <thetext>Comment on attachment 27678
Fix for the crash

Makes sense, r=me</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>27678</attachid>
            <date>2009-02-13 17:33:35 -0800</date>
            <delta_ts>2009-02-13 17:53:48 -0800</delta_ts>
            <desc>Fix for the crash</desc>
            <filename>isMainThread.patch</filename>
            <type>text/plain</type>
            <size>1295</size>
            <attacher name="Adam Treat">manyoso</attacher>
            
              <data encoding="base64">ZGlmZiAtLWdpdCBhL0phdmFTY3JpcHRDb3JlL0NoYW5nZUxvZyBiL0phdmFTY3JpcHRDb3JlL0No
YW5nZUxvZwppbmRleCAzOGExNmI5Li5iN2Y1NDk2IDEwMDY0NAotLS0gYS9KYXZhU2NyaXB0Q29y
ZS9DaGFuZ2VMb2cKKysrIGIvSmF2YVNjcmlwdENvcmUvQ2hhbmdlTG9nCkBAIC0xLDMgKzEsMTcg
QEAKKzIwMDktMDItMTMgIEFkYW0gVHJlYXQgIDxhZGFtLnRyZWF0QHRvcmNobW9iaWxlLmNvbT4K
KworICAgICAgICBSZXZpZXdlZCBieSBOT0JPRFkgKE9PUFMhKS4KKworICAgICAgICBEb24ndCBk
ZXBlbmQgb24gJ2luaXRpYWxpemVUaHJlYWRpbmcoKScgdG8gY29tZSBiZWZvcmUgYSBjYWxsIHRv
ICdpc01haW5UaHJlYWQoKScKKyAgICAgICAgYXMgUXRXZWJLaXQg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yZWFkSWRlbnRpZmllcjsKKyAg
ICByZXR1cm4gUVRocmVhZDo6Y3VycmVudFRocmVhZCgpID09IFFDb3JlQXBwbGljYXRpb246Omlu
c3RhbmNlKCktPnRocmVhZCgpOwogfQogCiBNdXRleDo6TXV0ZXgoKQo=
</data>
<flag name="review"
          id="13443"
          type_id="1"
          status="+"
          setter="darin"
    />
          </attachment>
      

    </bug>

</bugzilla>