Bug 23960 - WTF::isMainThread relies on initializeThreading incorrectly
Summary: WTF::isMainThread relies on initializeThreading incorrectly
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit Qt (show other bugs)
Version: 528+ (Nightly build)
Hardware: Other All
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-02-13 17:32 PST by Adam Treat
Modified: 2009-02-13 17:53 PST (History)
3 users (show)

See Also:


Attachments
Fix for the crash (1.26 KB, patch)
2009-02-13 17:33 PST, Adam Treat
darin: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Adam Treat 2009-02-13 17:32:53 PST
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 "UTF-8") at ../../../../WebCore/platform/text/TextEncodingRegistry.cpp:227
#3  0xb68d7563 in TextEncoding (this=0xb7ee0158, name=0xb717d552 "UTF-8") 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 'ASSERT(isMainThread())' deep within WebCore.

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

Cheers,
Adam
Comment 1 Adam Treat 2009-02-13 17:33:35 PST
Created attachment 27678 [details]
Fix for the crash
Comment 2 Adam Treat 2009-02-13 17:51:21 PST
Fixed with r41013 and reviewed by George Staikos over skype.
Comment 3 Darin Adler 2009-02-13 17:53:48 PST
Comment on attachment 27678 [details]
Fix for the crash

Makes sense, r=me