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

Crash when calling Map clearData() from qml during application startup

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P1: Critical
    • 5.11.0
    • 5.10.1
    • None
    • Linux, KDE Neon 16.04

    Description

      I'm using the Map item and the MapboxGL plugin. If I call the Map clearData() function like this:

      import QtQuick 2.9
      import QtLocation 5.9
      
      Item {
          onVisibleChanged: {
              if(visible) {
                  theMap.clearData();
              }
          }
          Map {
              id: theMap
              plugin: Plugin {
                  name: "mapboxgl"
              }
          }
      }
      

      the application crashes during start up in the main/gui thread. Below is a backtrace.

      QDeclarativeGeoMap's m_map pointer is null at this point, so it crashes.

       

      Thread 1 (Thread 0x7ffff7e4c900 (LWP 8839)):
      #0  0x00007fffdd9bb48c in QDeclarativeGeoMap::clearData (this=<optimized out>) at /home/olathorsen/src/qt-everywhere-src-5.10.1/qtlocation/src/location/declarativemaps/qdeclarativegeomap.cpp:1535
      No locals.
      #1  0x00007fffdda0b665 in QDeclarativeGeoMap::qt_static_metacall (_o=_o@entry=0x257a880, _c=_c@entry=QMetaObject::InvokeMetaMethod, _id=_id@entry=47, _a=_a@entry=0x7fffffff9960) at .moc/moc_qdeclarativegeomap_p.cpp:418
              _t = 0x257a880
      #2  0x00007fffdda0c171 in QDeclarativeGeoMap::qt_metacall (this=0x257a880, _c=QMetaObject::InvokeMetaMethod, _id=47, _a=0x7fffffff9960) at .moc/moc_qdeclarativegeomap_p.cpp:751
      No locals.
      #3  0x00007ffff7a71c13 in QMetaObject::metacall (object=<optimized out>, cl=<optimized out>, idx=<optimized out>, argv=<optimized out>) at /home/olathorsen/src/qt-everywhere-src-5.10.1/qtbase/src/corelib/kernel/qmetaobject.cpp:301
      No locals.
      #4  0x00007ffff6c5bc23 in QQmlObjectOrGadget::metacall (this=this@entry=0x7fffffff9c40, type=type@entry=QMetaObject::InvokeMetaMethod, index=index@entry=93, argv=argv@entry=0x7fffffff9960) at /home/olathorsen/src/qt-everywhere-src-5.10.1/qtdeclarative/src/qml/qml/qqmlpropertycache.cpp:1732
      No locals.
      #5  0x00007ffff6bbf333 in CallMethod (object=..., index=93, returnType=returnType@entry=43, argCount=argCount@entry=0, argTypes=argTypes@entry=0x0, engine=engine@entry=0x148e660, callArgs=0x7fffde5f6a08, callType=QMetaObject::InvokeMetaMethod) at /home/olathorsen/src/qt-everywhere-src-5.10.1/qtdeclarative/src/qml/jsruntime/qv4qobjectwrapper.cpp:1180
              args = {0x0}
      #6  0x00007ffff6bbf60e in CallPrecise (object=..., data=..., engine=engine@entry=0x148e660, callArgs=callArgs@entry=0x7fffde5f6a08, callType=callType@entry=QMetaObject::InvokeMetaMethod) at /home/olathorsen/src/qt-everywhere-src-5.10.1/qtdeclarative/src/qml/jsruntime/qv4qobjectwrapper.cpp:1428
              unknownTypeError = {d = 0x7ffff7b75d00 <QArrayData::shared_null>}
              returnType = 43
      #7  0x00007ffff6bc00ea in QV4::QObjectMethod::callInternal (this=0x7fffde5f6a60, callData=0x7fffde5f6a08, scope=...) at /home/olathorsen/src/qt-everywhere-src-5.10.1/qtdeclarative/src/qml/jsruntime/qv4qobjectwrapper.cpp:1970
              context = <optimized out>
              object = {<QQmlMetaObject> = {_m = {ptr_value = 140736687118784, static FlagBit = <optimized out>, static Flag2Bit = <optimized out>, static FlagsMask = <optimized out>}}, ptr = {ptr_value = 39299200, static FlagBit = <optimized out>, static Flag2Bit = <optimized out>, static FlagsMask = <optimized out>}}
              method = {<QQmlPropertyRawData> = {_flags = {_otherBits = 0, isConstant = 0, isWritable = 0, isResettable = 0, isAlias = 0, isFinal = 0, isOverridden = 0, isDirect = 1, type = 1, isVMEFunction = 0, hasArguments = 0, isSignal = 0, isVMESignal = 0, isV4Function = 0, isSignalHandler = 0, isOverload = 0, isCloned = 0, isConstructor = 0, notFullyResolved = 0, overrideIndexIsProperty = 0}, _coreIndex = 93, _propType = 43, _notifyIndex = -1, _overrideIndex = -1, _revision = 0, _metaObjectOffset = 2, _arguments = 0x0, _staticMetaCallFunction = 0x0}, <No data fields>}
      #8  0x00007ffff6bc015e in QV4::QObjectMethod::call (m=<optimized out>, scope=..., callData=<optimized out>) at /home/olathorsen/src/qt-everywhere-src-5.10.1/qtdeclarative/src/qml/jsruntime/qv4qobjectwrapper.cpp:1899
              This = <optimized out>
      #9  0x00007ffff6be4c65 in QV4::Object::call (d=0x7fffde5f6a08, scope=..., this=<optimized out>) at /home/olathorsen/src/qt-everywhere-src-5.10.1/qtdeclarative/src/qml/jsruntime/qv4object_p.h:445
      No locals.
      #10 QV4::Runtime::method_callProperty (engine=engine@entry=0x148e660, nameIndex=<optimized out>, callData=0x7fffde5f6a08) at /home/olathorsen/src/qt-everywhere-src-5.10.1/qtdeclarative/src/qml/jsruntime/qv4runtime.cpp:1104
              scope = {engine = 0x148e660, mark = 0x7fffde5f6a48, result = @0x7fffde5f6a48}
              name = {ptr = 0x7fffde5f6a50}
      
      .......

      Attachments

        Activity

          People

            paangele Paolo Angelelli
            olathorsen Ola Røer Thorsen
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: