PDA

View Full Version : ASSERT: "w->testAttribute(Qt::WA_WState_Created)"



majcia
16th December 2010, 09:07
I've recently started to get this error 2 out of 3 times I start my Qt 4.6 application. Does anybody know why this could happen?

The callstack:


> QtCored4.dll!qt_message_output(QtMsgType msgType=QtFatalMsg, const char * buf=0x1679ef70) Line 2254 C++
QtCored4.dll!qt_message(QtMsgType msgType=QtFatalMsg, const char * msg=0x672893cc, char * ap=0x0388a7dc) Line 2312 + 0x12 bytes C++
QtCored4.dll!qFatal(const char * msg=0x672893cc, ...) Line 2495 + 0xf bytes C++
QtCored4.dll!qt_assert(const char * assertion=0x65a46cc4, const char * file=0x65a46c9c, int line=377) Line 2011 + 0x16 bytes C++
QtGuid4.dll!QWinInputContext::update() Line 377 + 0x26 bytes C++
QtGuid4.dll!QWinInputContext::setFocusWidget(QWidg et * w=0x16613390) Line 765 C++
QtGuid4.dll!QWidget::setAttribute(Qt::WidgetAttrib ute attribute=WA_NativeWindow, bool on=true) Line 10443 C++
QtGuid4.dll!QWidget::winId() Line 2306 C++
QtWebKitd4.dll!windowHandleForPageClient(QWebPageC lient * client=0x1660ebe0) Line 90 + 0x9 bytes C++
QtWebKitd4.dll!WebCore::PluginView::platformStart( ) Line 988 + 0x31 bytes C++
QtWebKitd4.dll!WebCore::PluginView::start() Line 241 + 0xb bytes C++
QtWebKitd4.dll!WebCore::PluginView::startOrAddToUn startedList() Line 199 C++
QtWebKitd4.dll!WebCore::PluginView::init() Line 179 + 0x8 bytes C++
QtWebKitd4.dll!WebCore::PluginView::setParent(WebC ore::ScrollView * parent=0x1bcccd70) Line 730 C++
QtWebKitd4.dll!WebCore::ScrollView::addChild(WTF:: PassRefPtr<WebCore::Widget> prpChild={...}) Line 66 C++
QtWebKitd4.dll!WebCore::RenderWidget::setWidget(WT F::PassRefPtr<WebCore::Widget> widget={...}) Line 158 C++
QtWebKitd4.dll!WebCore::RenderPart::setWidget(WTF: :PassRefPtr<WebCore::Widget> widget={...}) Line 53 C++
QtWebKitd4.dll!WebCore::FrameLoader::loadPlugin(We bCore::RenderPart * renderer=0x1b689608, const WebCore::KURL & url={...}, const WebCore::String & mimeType={...}, const WTF::Vector<WebCore::String,0> & paramNames={...}, const WTF::Vector<WebCore::String,0> & paramValues={...}, bool useFallback=false) Line 1354 C++
QtWebKitd4.dll!WebCore::FrameLoader::requestObject (WebCore::RenderPart * renderer=0x1b689608, const WebCore::String & url={...}, const WebCore::AtomicString & frameName={...}, const WebCore::String & mimeType={...}, const WTF::Vector<WebCore::String,0> & paramNames={...}, const WTF::Vector<WebCore::String,0> & paramValues={...}) Line 1258 + 0x20 bytes C++
QtWebKitd4.dll!WebCore::RenderPartObject::updateWi dget(bool onlyCreateNonNetscapePlugins=false) Line 253 + 0x47 bytes C++
QtWebKitd4.dll!WebCore::FrameView::updateWidgets() Line 1380 C++
QtWebKitd4.dll!WebCore::FrameView::performPostLayo utTasks() Line 1406 + 0x8 bytes C++
QtWebKitd4.dll!WebCore::FrameView::layout(bool allowSubtree=true) Line 686 C++
QtWebKitd4.dll!WebCore::Document::updateLayout() Line 1358 C++
QtWebKitd4.dll!WebCore::Document::updateLayoutIgno rePendingStylesheets() Line 1390 C++
QtWebKitd4.dll!WebCore::Element::scrollWidth() Line 419 C++
QtWebKitd4.dll!WebCore::jsElementScrollWidth(JSC:: ExecState * exec=0x1a6705d8, const JSC::Identifier & __formal={...}, const JSC::PropertySlot & slot={...}) Line 355 + 0x10 bytes C++
QtWebKitd4.dll!JSC::PropertySlot::getValue(JSC::Ex ecState * exec=0x1a6705d8, const JSC::Identifier & propertyName={...}) Line 62 + 0x17 bytes C++
QtWebKitd4.dll!JSC::JSValue::get(JSC::ExecState * exec=0x1a6705d8, const JSC::Identifier & propertyName={...}, JSC::PropertySlot & slot={...}) Line 612 + 0x14 bytes C++
QtWebKitd4.dll!JSC::Interpreter::privateExecute(JS C::Interpreter::ExecutionFlag flag=Normal, JSC::RegisterFile * registerFile=0x1315bbd4, JSC::ExecState * callFrame=0x1a6705d8, JSC::JSValue * exception=0x1323fb88) Line 2081 C++
QtWebKitd4.dll!JSC::Interpreter::execute(JSC::Func tionExecutable * functionExecutable=0x1bb920d0, JSC::ExecState * callFrame=0x1b6b59d0, JSC::JSFunction * function=0x0b8b5c40, JSC::JSObject * thisObj=0x19548140, const JSC::ArgList & args={...}, JSC::ScopeChainNode * scopeChain=0x261cf120, JSC::JSValue * exception=0x1323fb88) Line 681 + 0x26 bytes C++
QtWebKitd4.dll!JSC::JSFunction::call(JSC::ExecStat e * exec=0x1b6b59d0, JSC::JSValue thisValue={...}, const JSC::ArgList & args={...}) Line 120 + 0x4e bytes C++
QtWebKitd4.dll!JSC::call(JSC::ExecState * exec=0x1b6b59d0, JSC::JSValue functionObject={...}, JSC::CallType callType=CallTypeJS, const JSC::CallData & callData={...}, JSC::JSValue thisValue={...}, const JSC::ArgList & args={...}) Line 39 + 0x2b bytes C++
QtWebKitd4.dll!WebCore::callInWorld(JSC::ExecState * exec=0x1b6b59d0, JSC::JSValue function={...}, JSC::CallType callType=CallTypeJS, const JSC::CallData & callData={...}, JSC::JSValue thisValue={...}, const JSC::ArgList & args={...}, WebCore::DOMWrapperWorld * isolatedWorld=0x16702ec0) Line 822 + 0x29 bytes C++
QtWebKitd4.dll!WebCore::ScheduledAction::executeFu nctionInContext(JSC::JSGlobalObject * globalObject=0x19557a40, JSC::JSValue thisValue={...}) Line 106 + 0x5b bytes C++
QtWebKitd4.dll!WebCore::ScheduledAction::execute(W ebCore::Document * document=0x1b62ba28) Line 127 C++
QtWebKitd4.dll!WebCore::ScheduledAction::execute(W ebCore::ScriptExecutionContext * context=0x1b62ba58) Line 79 C++
QtWebKitd4.dll!WebCore::DOMTimer::fired() Line 152 C++
QtWebKitd4.dll!WebCore::ThreadTimers::sharedTimerF iredInternal() Line 115 C++
QtWebKitd4.dll!WebCore::ThreadTimers::sharedTimerF ired() Line 91 C++
QtWebKitd4.dll!WebCore::SharedTimerQt::timerEvent( QTimerEvent * ev=0x0388cff4) Line 106 C++
QtCored4.dll!QObject::event(QEvent * e=0x0388cff4) Line 1205 C++
QtGuid4.dll!QApplicationPrivate::notify_helper(QOb ject * receiver=0x12bfcc88, QEvent * e=0x0388cff4) Line 4302 + 0x11 bytes C++
QtGuid4.dll!QApplication::notify(QObject * receiver=0x12bfcc88, QEvent * e=0x0388cff4) Line 3706 + 0x10 bytes C++

wysota
16th December 2010, 11:43
Are you using threads?

majcia
16th December 2010, 14:04
Yes.
.

wysota
16th December 2010, 14:28
You're probably accessing some QObject derived object from a worker thread. Don't do that.

majcia
16th December 2010, 15:24
The assertion appears in the main thread and the QWidget from the top of the callstack is also in the main thread.

The full callstack:


> QtCored4.dll!qt_message_output(QtMsgType msgType=QtFatalMsg, const char * buf=0x1679ef70) Line 2254 C++
QtCored4.dll!qt_message(QtMsgType msgType=QtFatalMsg, const char * msg=0x672893cc, char * ap=0x0388a7dc) Line 2312 + 0x12 bytes C++
QtCored4.dll!qFatal(const char * msg=0x672893cc, ...) Line 2495 + 0xf bytes C++
QtCored4.dll!qt_assert(const char * assertion=0x65a46cc4, const char * file=0x65a46c9c, int line=377) Line 2011 + 0x16 bytes C++
QtGuid4.dll!QWinInputContext::update() Line 377 + 0x26 bytes C++
QtGuid4.dll!QWinInputContext::setFocusWidget(QWidg et * w=0x16613390) Line 765 C++
QtGuid4.dll!QWidget::setAttribute(Qt::WidgetAttrib ute attribute=WA_NativeWindow, bool on=true) Line 10443 C++
QtGuid4.dll!QWidget::winId() Line 2306 C++
QtWebKitd4.dll!windowHandleForPageClient(QWebPageC lient * client=0x1660ebe0) Line 90 + 0x9 bytes C++
QtWebKitd4.dll!WebCore::PluginView::platformStart( ) Line 988 + 0x31 bytes C++
QtWebKitd4.dll!WebCore::PluginView::start() Line 241 + 0xb bytes C++
QtWebKitd4.dll!WebCore::PluginView::startOrAddToUn startedList() Line 199 C++
QtWebKitd4.dll!WebCore::PluginView::init() Line 179 + 0x8 bytes C++
QtWebKitd4.dll!WebCore::PluginView::setParent(WebC ore::ScrollView * parent=0x1bcccd70) Line 730 C++
QtWebKitd4.dll!WebCore::ScrollView::addChild(WTF:: PassRefPtr<WebCore::Widget> prpChild={...}) Line 66 C++
QtWebKitd4.dll!WebCore::RenderWidget::setWidget(WT F::PassRefPtr<WebCore::Widget> widget={...}) Line 158 C++
QtWebKitd4.dll!WebCore::RenderPart::setWidget(WTF: :PassRefPtr<WebCore::Widget> widget={...}) Line 53 C++
QtWebKitd4.dll!WebCore::FrameLoader::loadPlugin(We bCore::RenderPart * renderer=0x1b689608, const WebCore::KURL & url={...}, const WebCore::String & mimeType={...}, const WTF::Vector<WebCore::String,0> & paramNames={...}, const WTF::Vector<WebCore::String,0> & paramValues={...}, bool useFallback=false) Line 1354 C++
QtWebKitd4.dll!WebCore::FrameLoader::requestObject (WebCore::RenderPart * renderer=0x1b689608, const WebCore::String & url={...}, const WebCore::AtomicString & frameName={...}, const WebCore::String & mimeType={...}, const WTF::Vector<WebCore::String,0> & paramNames={...}, const WTF::Vector<WebCore::String,0> & paramValues={...}) Line 1258 + 0x20 bytes C++
QtWebKitd4.dll!WebCore::RenderPartObject::updateWi dget(bool onlyCreateNonNetscapePlugins=false) Line 253 + 0x47 bytes C++
QtWebKitd4.dll!WebCore::FrameView::updateWidgets() Line 1380 C++
QtWebKitd4.dll!WebCore::FrameView::performPostLayo utTasks() Line 1406 + 0x8 bytes C++
QtWebKitd4.dll!WebCore::FrameView::layout(bool allowSubtree=true) Line 686 C++
QtWebKitd4.dll!WebCore::Document::updateLayout() Line 1358 C++
QtWebKitd4.dll!WebCore::Document::updateLayoutIgno rePendingStylesheets() Line 1390 C++
QtWebKitd4.dll!WebCore::Element::scrollWidth() Line 419 C++
QtWebKitd4.dll!WebCore::jsElementScrollWidth(JSC:: ExecState * exec=0x1a6705d8, const JSC::Identifier & __formal={...}, const JSC::PropertySlot & slot={...}) Line 355 + 0x10 bytes C++
QtWebKitd4.dll!JSC::PropertySlot::getValue(JSC::Ex ecState * exec=0x1a6705d8, const JSC::Identifier & propertyName={...}) Line 62 + 0x17 bytes C++
QtWebKitd4.dll!JSC::JSValue::get(JSC::ExecState * exec=0x1a6705d8, const JSC::Identifier & propertyName={...}, JSC::PropertySlot & slot={...}) Line 612 + 0x14 bytes C++
QtWebKitd4.dll!JSC::Interpreter::privateExecute(JS C::Interpreter::ExecutionFlag flag=Normal, JSC::RegisterFile * registerFile=0x1315bbd4, JSC::ExecState * callFrame=0x1a6705d8, JSC::JSValue * exception=0x1323fb88) Line 2081 C++
QtWebKitd4.dll!JSC::Interpreter::execute(JSC::Func tionExecutable * functionExecutable=0x1bb920d0, JSC::ExecState * callFrame=0x1b6b59d0, JSC::JSFunction * function=0x0b8b5c40, JSC::JSObject * thisObj=0x19548140, const JSC::ArgList & args={...}, JSC::ScopeChainNode * scopeChain=0x261cf120, JSC::JSValue * exception=0x1323fb88) Line 681 + 0x26 bytes C++
QtWebKitd4.dll!JSC::JSFunction::call(JSC::ExecStat e * exec=0x1b6b59d0, JSC::JSValue thisValue={...}, const JSC::ArgList & args={...}) Line 120 + 0x4e bytes C++
QtWebKitd4.dll!JSC::call(JSC::ExecState * exec=0x1b6b59d0, JSC::JSValue functionObject={...}, JSC::CallType callType=CallTypeJS, const JSC::CallData & callData={...}, JSC::JSValue thisValue={...}, const JSC::ArgList & args={...}) Line 39 + 0x2b bytes C++
QtWebKitd4.dll!WebCore::callInWorld(JSC::ExecState * exec=0x1b6b59d0, JSC::JSValue function={...}, JSC::CallType callType=CallTypeJS, const JSC::CallData & callData={...}, JSC::JSValue thisValue={...}, const JSC::ArgList & args={...}, WebCore::DOMWrapperWorld * isolatedWorld=0x16702ec0) Line 822 + 0x29 bytes C++
QtWebKitd4.dll!WebCore::ScheduledAction::executeFu nctionInContext(JSC::JSGlobalObject * globalObject=0x19557a40, JSC::JSValue thisValue={...}) Line 106 + 0x5b bytes C++
QtWebKitd4.dll!WebCore::ScheduledAction::execute(W ebCore::Document * document=0x1b62ba28) Line 127 C++
QtWebKitd4.dll!WebCore::ScheduledAction::execute(W ebCore::ScriptExecutionContext * context=0x1b62ba58) Line 79 C++
QtWebKitd4.dll!WebCore::DOMTimer::fired() Line 152 C++
QtWebKitd4.dll!WebCore::ThreadTimers::sharedTimerF iredInternal() Line 115 C++
QtWebKitd4.dll!WebCore::ThreadTimers::sharedTimerF ired() Line 91 C++
QtWebKitd4.dll!WebCore::SharedTimerQt::timerEvent( QTimerEvent * ev=0x0388cff4) Line 106 C++
QtCored4.dll!QObject::event(QEvent * e=0x0388cff4) Line 1205 C++
QtGuid4.dll!QApplicationPrivate::notify_helper(QOb ject * receiver=0x12bfcc88, QEvent * e=0x0388cff4) Line 4302 + 0x11 bytes C++
QtGuid4.dll!QApplication::notify(QObject * receiver=0x12bfcc88, QEvent * e=0x0388cff4) Line 3706 + 0x10 bytes C++
majcia.exe!MajciaApplication::notify(QObject * receiver=0x12bfcc88, QEvent * event=0x0388cff4) Line 205 + 0x13 bytes C++
QtCored4.dll!QCoreApplication::notifyInternal(QObj ect * receiver=0x12bfcc88, QEvent * event=0x0388cff4) Line 726 + 0x15 bytes C++
QtCored4.dll!QCoreApplication::sendEvent(QObject * receiver=0x12bfcc88, QEvent * event=0x0388cff4) Line 215 + 0x39 bytes C++
QtCored4.dll!QEventDispatcherWin32::event(QEvent * e=0x261b7cd8) Line 1107 + 0x10 bytes C++
QtGuid4.dll!QApplicationPrivate::notify_helper(QOb ject * receiver=0x07ace288, QEvent * e=0x261b7cd8) Line 4302 + 0x11 bytes C++
QtGuid4.dll!QApplication::notify(QObject * receiver=0x07ace288, QEvent * e=0x261b7cd8) Line 3706 + 0x10 bytes C++
majcia.exe!MajciaApplication::notify(QObject * receiver=0x07ace288, QEvent * event=0x261b7cd8) Line 205 + 0x13 bytes C++
QtCored4.dll!QCoreApplication::notifyInternal(QObj ect * receiver=0x07ace288, QEvent * event=0x261b7cd8) Line 726 + 0x15 bytes C++
QtCored4.dll!QCoreApplication::sendEvent(QObject * receiver=0x07ace288, QEvent * event=0x261b7cd8) Line 215 + 0x39 bytes C++
QtCored4.dll!QCoreApplicationPrivate::sendPostedEv ents(QObject * receiver=0x00000000, int event_type=0, QThreadData * data=0x06b95880) Line 1367 + 0xd bytes C++
QtCored4.dll!qt_internal_proc(HWND__ * hwnd=0x000711e8, unsigned int message=1025, unsigned int wp=0, long lp=0) Line 490 + 0x10 bytes C++
user32.dll!_InternalCallWinProc@20() + 0x23 bytes
user32.dll!_UserCallWinProcCheckWow@32() + 0xd3 bytes
user32.dll!_DispatchMessageWorker@8() + 0xee bytes
user32.dll!_DispatchMessageW@4() + 0xf bytes
QtCored4.dll!QEventDispatcherWin32::processEvents( QFlags<enum QEventLoop::ProcessEventsFlag> flags={...}) Line 781 C++
QtGuid4.dll!QGuiEventDispatcherWin32::processEvent s(QFlags<enum QEventLoop::ProcessEventsFlag> flags={...}) Line 1145 + 0x15 bytes C++
QtCored4.dll!QEventLoop::processEvents(QFlags<enum QEventLoop::ProcessEventsFlag> flags={...}) Line 150 C++
QtCored4.dll!QEventLoop::exec(QFlags<enum QEventLoop::ProcessEventsFlag> flags={...}) Line 201 + 0x2d bytes C++
QtCored4.dll!QCoreApplication::exec() Line 1003 + 0x15 bytes C++
QtGuid4.dll!QApplication::exec() Line 3582 C++
majcia.exe!ApplicationBuilder::Start() Line 231 + 0x8 bytes C++
majcia.exe!runMajcia(int argc=1, char * * args=0x079af4d0) Line 123 + 0x8 bytes C++
majcia.exe!main(int argc=1, char * * args=0x079af4d0) Line 348 + 0xd bytes C++
majcia.exe!_WinMain@16() + 0x7a bytes
majcia.exe!__tmainCRTStartup() Line 589 + 0x35 bytes C
majcia.exe!WinMainCRTStartup() Line 414 C
kernel32.dll!@BaseThreadInitThunk@12() + 0xe bytes
ntdll.dll!___RtlUserThreadStart@8() + 0x23 bytes
ntdll.dll!__RtlUserThreadStart@8() + 0x1b bytes

wysota
16th December 2010, 15:42
The assertion appears in the main thread and the QWidget from the top of the callstack is also in the main thread.
That's where the fault manifests itself in a form of malfunction. The error itself can (and does) happen earlier so the stack trace is meaningless.