Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-37734

Crash when using variables from ListModel in Loader

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P2: Important
    • Resolution: Duplicate
    • Affects Version/s: 5.2.0, 5.2.1, 5.3.0 Alpha
    • Fix Version/s: 5.3.0 Beta1
    • Labels:
      None
    • Environment:
      Mac OS X 10.9.2, Windows 8.1
    • Commits:
      dc9bf8ecdcc2ee59006c7ce2d57faadd755e9557 (qtdeclarative)

      Description

      Passing ListModel variables to Loader results in crash.

      import QtQuick 2.0
      
      Rectangle {
          width: 320; height: 480; 
          
          property int count : 6;
      
          ListModel {
              id: testModel        
          }
      
          Timer {
              interval: 500; running: true; repeat: true
              onTriggered: {
                  testModel.append({"name" : "test " + count});
                  count = count + 1;
                  if (count%10 == 0) {
                      testModel.clear();
                  }
              }
          }
          
          Component {
              id: menuItem
              Rectangle {
                  width: 5
                  height: 5
                  color: "blue"
                  Text {
                      text: modelData.name + " is " + modelIndex                
                  }
              }
          }
      
          GridView {
                  
              anchors {
                  fill: parent
              }
              
              model: testModel
              
              delegate: Rectangle {
                  width: 10;
                  height: 10;
                  Loader {
                      id: loader
                      property var modelData: model
                      property var modelIndex: index
                      sourceComponent: menuItem
                  }
                  Text {
                      text: name                
                  }
              }    
          }
      }
      

      Call stack:

       	testApp.exe!qt_assert(const char * assertion=0x04a59d98, const char * file=0x04a59ce0, int line=497) Line 2124	C++
       	testApp.exe!QQmlEnginePrivate::get(QQmlEngine * e=0x00000000) Line 497	C++
       	testApp.exe!QQmlVMEMetaObject::readVarProperty(int id=0) Line 1001	C++
       	testApp.exe!QQmlVMEMetaObject::vmeProperty(int index=50) Line 1204	C++
       	testApp.exe!QV4::QObjectWrapper::getProperty(QObject * object=0x0abf3698, QV4::ExecutionContext * ctx=0x0036bb38, QQmlPropertyData * property=0x0aafaae8, bool captureRequired=true) Line 393	C++
       	testApp.exe!QV4::QObjectWrapper::getQmlProperty(QV4::ExecutionContext * ctx=0x0036bb38, QQmlContextData * qmlContext=0x0abf5ef0, QV4::String * n=0x00d7c000, QV4::QObjectWrapper::RevisionMode revisionMode=CheckRevision, bool * hasProperty=0x0036b9bb, bool includeImports=false) Line 333	C++
       	testApp.exe!QV4::QObjectWrapper::getQmlProperty(QV4::ExecutionContext * ctx=0x0036bb38, QQmlContextData * qmlContext=0x0abf5ef0, QObject * object=0x0abf3698, QV4::String * name=0x00d7c000, QV4::QObjectWrapper::RevisionMode revisionMode=CheckRevision, bool * hasProperty=0x0036b9bb) Line 422	C++
       	testApp.exe!QV4::QmlContextWrapper::get(QV4::Managed * m=0x01101f00, const QV4::StringRef name={...}, bool * hasProperty=0x0036baaa) Line 263	C++
       	testApp.exe!QV4::Object::get(const QV4::StringRef name={...}, bool * hasProperty=0x0036baaa) Line 247	C++
       	testApp.exe!QV4::ExecutionContext::getProperty(const QV4::StringRef name={...}) Line 390	C++
       	testApp.exe!QV4::__qmljs_get_activation_property(QV4::ExecutionContext * ctx=0x0036bb38, const QV4::StringRef name={...}) Line 679	C++
       	085f0480()	Unknown
       	[Frames below may be incorrect and/or missing]	
       	testApp.exe!QV4::SimpleScriptFunction::call(QV4::Managed * that=0x00ef1560, QV4::CallData * callData=0x08e00008) Line 585	C++
       	testApp.exe!QV4::Object::call(QV4::CallData * d=0x08e00008) Line 273	C++
       	testApp.exe!QQmlJavaScriptExpression::evaluate(QQmlContextData * context=0x0abf6288, const QV4::ValueRef function={...}, QV4::CallData * callData=0x08e00008, bool * isUndefined=0x0036bdad) Line 166	C++
       	testApp.exe!QQmlJavaScriptExpression::evaluate(QQmlContextData * context=0x0abf6288, const QV4::ValueRef function={...}, bool * isUndefined=0x0036bdad) Line 123	C++
       	testApp.exe!QQmlBinding::update(QFlags<enum QQmlPropertyPrivate::WriteFlag> flags={...}) Line 253	C++
       	testApp.exe!QQmlBinding::update() Line 106	C++
       	testApp.exe!QQmlBinding::expressionChanged(QQmlJavaScriptExpression * e=0x0abf69a8) Line 313	C++
       	testApp.exe!QQmlJavaScriptExpressionGuard_callback(QQmlNotifierEndpoint * e=0x0a993ff0, void * * __formal=0x00000000) Line 372	C++
       	testApp.exe!QQmlNotifier::emitNotify(QQmlNotifierEndpoint * endpoint=0x0a993ff0, void * * a=0x00000000) Line 81	C++
       	testApp.exe!QQmlData::signalEmitted(QAbstractDeclarativeData * __formal=0x0abf36a8, QObject * object=0x0abf3698, int index=39, void * * a=0x00000000) Line 721	C++
       	testApp.exe!QMetaObject::activate(QObject * sender=0x0abf3698, int signalOffset=39, int local_signal_index=0, void * * argv=0x00000000) Line 3569	C++
       	testApp.exe!QQmlVMEMetaObject::activate(QObject * object=0x0abf3698, int index=54, void * * args=0x00000000) Line 1332	C++
       	testApp.exe!QQmlVMEVariantQObjectPtr::objectDestroyed(QObject * __formal=0x0aaeac18) Line 88	C++
       	testApp.exe!QQmlData::destroyed(QObject * object=0x0aaeac18) Line 1659	C++
       	testApp.exe!QQmlData::destroyed(QAbstractDeclarativeData * d=0x0ab03bf8, QObject * o=0x0aaeac18) Line 633	C++
       	testApp.exe!QObject::~QObject() Line 916	C++
       	testApp.exe!QQmlDelegateModelItem::~QQmlDelegateModelItem() Line 1843	C++
       	testApp.exe!QQmlDMCachedModelData::~QQmlDMCachedModelData()	C++
       	testApp.exe!QQmlDMAbstractItemModelData::~QQmlDMAbstractItemModelData()	C++
       	testApp.exe!QQmlDMAbstractItemModelData::`scalar deleting destructor'(unsigned int)	C++
       	testApp.exe!QQmlDelegateModelItem::Dispose() Line 1855	C++
       	testApp.exe!QQmlDelegateModelPrivate::release(QObject * object=0x0abf34d0) Line 521	C++
       	testApp.exe!QQmlDelegateModel::release(QObject * item=0x0abf34d0) Line 537	C++
       	testApp.exe!QQuickItemViewPrivate::releaseItem(FxViewItem * item=0x0abf70a8) Line 2341	C++
       	testApp.exe!QQuickItemViewPrivate::applyModelChanges(QQuickItemViewPrivate::ChangeResult * totalInsertionResult=0x0036c3dc, QQuickItemViewPrivate::ChangeResult * totalRemovalResult=0x0036c40c) Line 2025	C++
       	testApp.exe!QQuickItemViewPrivate::layout() Line 1830	C++
       	testApp.exe!QQuickItemView::updatePolish() Line 1440	C++
       	testApp.exe!QQuickWindowPrivate::polishItems() Line 269	C++
       	testApp.exe!QSGWindowsRenderLoop::renderWindow(QQuickWindow * window=0x0843f6c0) Line 474	C++
       	testApp.exe!QSGWindowsRenderLoop::render() Line 425	C++
       	testApp.exe!QSGWindowsRenderLoop::event(QEvent * event=0x0036cc60) Line 405	C++
       	testApp.exe!QApplicationPrivate::notify_helper(QObject * receiver=0x0044d788, QEvent * e=0x0036cc60) Line 3520	C++
       	testApp.exe!QApplication::notify(QObject * receiver=0x0044d788, QEvent * e=0x0036cc60) Line 2940	C++
       	testApp.exe!QCoreApplication::notifyInternal(QObject * receiver=0x0044d788, QEvent * event=0x0036cc60) Line 937	C++
       	testApp.exe!QCoreApplication::sendEvent(QObject * receiver=0x0044d788, QEvent * event=0x0036cc60) Line 237	C++
       	testApp.exe!QEventDispatcherWin32Private::sendTimerEvent(int timerId=2) Line 585	C++
       	testApp.exe!QEventDispatcherWin32::event(QEvent * e=0x0ab55258) Line 1137	C++
       	testApp.exe!QApplicationPrivate::notify_helper(QObject * receiver=0x003f19f0, QEvent * e=0x0ab55258) Line 3520	C++
       	testApp.exe!QApplication::notify(QObject * receiver=0x003f19f0, QEvent * e=0x0ab55258) Line 2940	C++
       	testApp.exe!QCoreApplication::notifyInternal(QObject * receiver=0x003f19f0, QEvent * event=0x0ab55258) Line 937	C++
       	testApp.exe!QCoreApplication::sendEvent(QObject * receiver=0x003f19f0, QEvent * event=0x0ab55258) Line 237	C++
       	testApp.exe!QCoreApplicationPrivate::sendPostedEvents(QObject * receiver=0x00000000, int event_type=0, QThreadData * data=0x003eeaf0) Line 1541	C++
       	testApp.exe!QCoreApplication::sendPostedEvents(QObject * receiver=0x00000000, int event_type=0) Line 1399	C++
       	testApp.exe!QWindowsGuiEventDispatcher::sendPostedEvents() Line 88	C++
       	testApp.exe!qt_internal_proc(HWND__ * hwnd=0x007d0e06, unsigned int message=1025, unsigned int wp=0, long lp=0) Line 423	C++
       	user32.dll!_InternalCallWinProc@20()	Unknown
       	user32.dll!_UserCallWinProcCheckWow@32()	Unknown
       	user32.dll!_DispatchMessageWorker@8()	Unknown
       	user32.dll!_DispatchMessageW@4()	Unknown
       	testApp.exe!QEventDispatcherWin32::processEvents(QFlags<enum QEventLoop::ProcessEventsFlag> flags={...}) Line 757	C++
       	testApp.exe!QWindowsGuiEventDispatcher::processEvents(QFlags<enum QEventLoop::ProcessEventsFlag> flags={...}) Line 80	C++
       	testApp.exe!QEventLoop::processEvents(QFlags<enum QEventLoop::ProcessEventsFlag> flags={...}) Line 137	C++
       	testApp.exe!QEventLoop::exec(QFlags<enum QEventLoop::ProcessEventsFlag> flags={...}) Line 212	C++
      

        Attachments

          Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            Activity

              People

              Assignee:
              shausman Simon Hausmann
              Reporter:
              butalc Gasper Lah
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Gerrit Reviews

                  There are no open Gerrit changes