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

Stackoverflow in QQmlTypePrivate::insertEnums when using fully qualified type of enum of class in namespace for Q_PROPERTY type

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P1: Critical
    • 5.2.0
    • 5.0.1, 5.1.0
    • None
    • qtbase: v5.1.0-388-g8c35db5
      linux, x86 64bit
    • 2bd40c53ef54ff2c11ddb3b3acbd443a6429a8db

    Description

      The attached project shows a crash due to inifinite recursion in QQmlTypePrivate::insertEnums as Test::MyObj is "related" to itself, i.e. see moc_myobj.cpp -> qt_meta_extradata_Test__MyObj it contains &Test::MyObj::staticMetaObject. This then is queried in insertEnums resulting in an infinite recursion.

      Moc is apparently confused by the fully qualified type given to Q_PROPERTY myEnum.

      #87240 0x00007ffff7702988 in QQmlTypePrivate::insertEnums (this=0x47ab20, metaObject=0x407820 <Test::MyObj::staticMetaObject>)
      at /ssd/milian/projects/qt5/qtdeclarative/src/qml/qml/qqmlmetatype.cpp:655
      #87241 0x00007ffff7702988 in QQmlTypePrivate::insertEnums (this=0x47ab20, metaObject=0x407820 <Test::MyObj::staticMetaObject>)
      at /ssd/milian/projects/qt5/qtdeclarative/src/qml/qml/qqmlmetatype.cpp:655
      #87242 0x00007ffff7702988 in QQmlTypePrivate::insertEnums (this=0x47ab20, metaObject=0x407820 <Test::MyObj::staticMetaObject>)
      at /ssd/milian/projects/qt5/qtdeclarative/src/qml/qml/qqmlmetatype.cpp:655
      #87243 0x00007ffff770290b in QQmlTypePrivate::initEnums (this=0x47ab20)
      at /ssd/milian/projects/qt5/qtdeclarative/src/qml/qml/qqmlmetatype.cpp:643
      #87244 0x00007ffff7703380 in QQmlType::enumValue (this=0x45a2b0, name=..., ok=0x7fffffffbcaf)
      at /ssd/milian/projects/qt5/qtdeclarative/src/qml/qml/qqmlmetatype.cpp:928
      #87245 0x00007ffff78063a4 in QV8TypeWrapper::Getter (property=..., info=...)
      at /ssd/milian/projects/qt5/qtdeclarative/src/qml/qml/v8/qv8typewrapper.cpp:211
      #87246 0x00007ffff563c290 in v8::internal::JSObject::GetPropertyWithInterceptor (this=0x31a74cf42259, receiver=0x31a74cf42259,
      name=0x24cf1051f931, attributes=0x7fffffffc228) at /ssd/milian/projects/qt5/qtjsbackend/src/3rdparty/v8/src/objects.cc:10904
      #87247 0x00007ffff5616897 in v8::internal::Object::GetProperty (this=0x31a74cf42259, receiver=0x31a74cf42259, result=0x7fffffffc1b0,
      name=0x24cf1051f931, attributes=0x7fffffffc228) at /ssd/milian/projects/qt5/qtjsbackend/src/3rdparty/v8/src/objects.cc:656
      #87248 0x00007ffff56161ce in v8::internal::Object::GetProperty (object=..., receiver=..., result=0x7fffffffc1b0, key=...,
      attributes=0x7fffffffc228) at /ssd/milian/projects/qt5/qtjsbackend/src/3rdparty/v8/src/objects.cc:583
      #87249 0x00007ffff55a9ae5 in v8::internal::LoadIC::Load (this=0x7fffffffc2a0, state=v8::internal::UNINITIALIZED, object=..., name=...)
      at /ssd/milian/projects/qt5/qtjsbackend/src/3rdparty/v8/src/ic.cc:923
      #87250 0x00007ffff55af2b4 in v8::internal::LoadIC_Miss (args=..., isolate=0x408070)
      at /ssd/milian/projects/qt5/qtjsbackend/src/3rdparty/v8/src/ic.cc:2100

      The infinite recursion only happens when one tries to access the enum in a JS function body, a direct QML property binding seems to work fine (see main.qml in the attached project).

      Attachments

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

        Activity

          People

            ogoffart Olivier Goffart (Woboq GmbH)
            milianw Milian Wolff
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes