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

Crash/Assert because object that i being created is garbage collected

    XMLWordPrintable

Details

    • 14bc8dc3f3016889cfcbdbe7309b09be7687ebe0

    Description

      After upgrading to Qt 5.3.0 we are facing a crash (assert if compiled with debug) in one of our QML programs.

      The assert is
      ASSERT: "context() && engine()" in file qml/qqmlboundsignal.cpp, line 190

      I think i have traced it to the fact that the object that is being created gets garbage collected, here a stack trace i think shows the problem

      #0 QV4::QObjectWrapper::destroy (that=<optimized out>) at jsruntime/qv4qobjectwrapper.cpp:1040
      #1 0x00007ffff572de64 in QV4::MemoryManager::sweep (this=this@entry=0x7635d0, chunkStart=<optimized out>, chunkSize=<optimized out>, size=48) at jsruntime/qv4mm.cpp:404
      #2 0x00007ffff572e688 in QV4::MemoryManager::sweep (this=this@entry=0x7635d0, lastSweep=lastSweep@entry=false) at jsruntime/qv4mm.cpp:349
      #3 0x00007ffff572f7cf in QV4::MemoryManager::runGC (this=this@entry=0x7635d0) at jsruntime/qv4mm.cpp:440
      #4 0x00007ffff572fd5f in QV4::MemoryManager::alloc (this=0x7635d0, size=size@entry=64) at jsruntime/qv4mm.cpp:206
      #5 0x00007ffff5766627 in allocManaged (size=<optimized out>, this=<optimized out>) at jsruntime/qv4mm_p.h:102
      #6 QV4::Members::ensureIndex (this=0x7fffe8162fd0, e=0x708070, idx=<optimized out>) at jsruntime/qv4memberdata.cpp:78
      #7 0x00007ffff5768b6d in QV4::Object::Object (this=<optimized out>, ic=<optimized out>) at jsruntime/qv4object.cpp:87
      #8 0x00007ffff5758736 in QV4::FunctionObject::FunctionObject (this=0x7fffe8162fc0, scope=0x7ffff7ec1000, name=..., createProto=<optimized out>) at jsruntime/qv4functionobject.cpp:80
      #9 0x00007ffff577e9d7 in QV4::QmlBindingWrapper::QmlBindingWrapper (this=0x7fffe8162fc0, scope=0x7ffff7ec1000, qml=...) at jsruntime/qv4script.cpp:89
      #10 0x00007ffff585691d in QQmlObjectCreator::createInstance (this=this@entry=0x7fffffffcc00, index=7, parent=<optimized out>, isContextObject=isContextObject@entry=false) at qml/qqmlobjectcreator.cpp:1157
      #11 0x00007ffff5857845 in QQmlObjectCreator::setPropertyBinding (this=this@entry=0x7fffffffcc00, property=property@entry=0x7fffd006c1d8, binding=binding@entry=0x7fffd024df3c) at qml/qqmlobjectcreator.cpp:769
      #12 0x00007ffff585876e in QQmlObjectCreator::setupBindings (this=this@entry=0x7fffffffcc00, bindingsToSkip=...) at qml/qqmlobjectcreator.cpp:728
      #13 0x00007ffff585933a in QQmlObjectCreator::populateInstance (this=this@entry=0x7fffffffcc00, index=index@entry=0, instance=0x0, instance@entry=0x846b20, bindingTarget=0x845f70, bindingTarget@entry=0x846b20, valueTypeProperty=valueTypeProperty@entry=0x0,
      bindingsToSkip=...) at qml/qqmlobjectcreator.cpp:1323
      #14 0x00007ffff5856961 in QQmlObjectCreator::createInstance (this=this@entry=0x7fffffffcc00, index=index@entry=0, parent=parent@entry=0x0, isContextObject=isContextObject@entry=true) at qml/qqmlobjectcreator.cpp:1162
      #15 0x00007ffff5855a22 in QQmlObjectCreator::create (this=this@entry=0x7fffffffcc00, subComponentIndex=subComponentIndex@entry=-1, parent=parent@entry=0x0, interrupt=interrupt@entry=0x0) at qml/qqmlobjectcreator.cpp:223
      #16 0x00007ffff5856e6a in QQmlObjectCreator::createInstance (this=this@entry=0x7816b0, index=2, parent=0x836cc0, isContextObject=isContextObject@entry=false) at qml/qqmlobjectcreator.cpp:1079
      #17 0x00007ffff5857845 in QQmlObjectCreator::setPropertyBinding (this=this@entry=0x7816b0, property=property@entry=0x7fffd006c1d8, binding=binding@entry=0x7fffd00d7ec0) at qml/qqmlobjectcreator.cpp:769
      #18 0x00007ffff585876e in QQmlObjectCreator::setupBindings (this=this@entry=0x7816b0, bindingsToSkip=...) at qml/qqmlobjectcreator.cpp:728
      #19 0x00007ffff585933a in QQmlObjectCreator::populateInstance (this=this@entry=0x7816b0, index=index@entry=0, instance=0x0, instance@entry=0x836cc0, bindingTarget=0x7fffd001ffe0, bindingTarget@entry=0x836cc0, valueTypeProperty=valueTypeProperty@entry=0x0,
      bindingsToSkip=...) at qml/qqmlobjectcreator.cpp:1323
      #20 0x00007ffff5856961 in QQmlObjectCreator::createInstance (this=this@entry=0x7816b0, index=index@entry=0, parent=parent@entry=0x0, isContextObject=isContextObject@entry=true) at qml/qqmlobjectcreator.cpp:1162
      #21 0x00007ffff5855a22 in QQmlObjectCreator::create (this=this@entry=0x7816b0, subComponentIndex=-1, parent=parent@entry=0x0, interrupt=interrupt@entry=0x0) at qml/qqmlobjectcreator.cpp:223

      In #0 I have
      (gdb) print object
      $9 = {wp = {d = 0x846da0, value = 0x846b20}}

      In #14 i have
      (gdb) print instance
      $14 = (QObject *) 0x846b20

      Attachments

        Issue Links

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

          Activity

            People

              shausman Simon Hausmann
              tsdgeos_canonical Albert Astals Cid (Canonical) (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes