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

QQmlComponent::setInitialProperties: crash with gcc




      i'm currently seeing a weird crash happening inside QQmlComponent::setInitialProperties:

      to quote address sanitizer

      ==280167==ERROR: AddressSanitizer: SEGV on unknown address (pc 0x7f3f3b543487 bp 0x7ffeb86f2910 sp 0x7ffeb86f2690 T0)
      ==280167==The signal is caused by a READ memory access.
      ==280167==Hint: this fault was caused by a dereference of a high value address (see register values below).  Dissassemble the provided pc to learn which register was used.
          #0 0x7f3f3b543487 in QString::size() const /home/tim/dev/qt6/build_debug_asan/qtbase/include/QtCore/../../../../qtbase/src/corelib/text/qstring.h:413
          #1 0x7f3f3b543487 in splitString<QList<QString>, QString> /home/tim/dev/qt6/qtbase/src/corelib/text/qstring.cpp:7629
          #2 0x7f3f3b544136 in QString::split(QChar, QFlags<Qt::SplitBehaviorFlags>, Qt::CaseSensitivity) const /home/tim/dev/qt6/qtbase/src/corelib/text/qstring.cpp:7683
          #3 0x7f3f3d4196e5 in QQmlComponentPrivate::setInitialProperty(QObject*, QString const&, QVariant const&) /home/tim/dev/qt6/qtdeclarative/src/qml/qml/qqmlcomponent.cpp:381
          #4 0x7f3f3d41c565 in QQmlComponent::setInitialProperties(QObject*, QMap<QString, QVariant> const&) /home/tim/dev/qt6/qtdeclarative/src/qml/qml/qqmlcomponent.cpp:1253
          #5 0x7f3f3d41c771 in QQmlComponent::createWithInitialProperties(QMap<QString, QVariant> const&, QQmlContext*) /home/tim/dev/qt6/qtdeclarative/src/qml/qml/qqmlcomponent.cpp:892
          #6 0x7f3f3d37e0d3 in QQmlApplicationEnginePrivate::finishLoad(QQmlComponent*) /home/tim/dev/qt6/qtdeclarative/src/qml/qml/qqmlapplicationengine.cpp:155
          #7 0x7f3f3d37fcc8 in QQmlApplicationEnginePrivate::startLoad(QUrl const&, QByteArray const&, bool) /home/tim/dev/qt6/qtdeclarative/src/qml/qml/qqmlapplicationengine.cpp:139
          #8 0x7f3f3d380f7f in QQmlApplicationEngine::load(QString const&) /home/tim/dev/qt6/qtdeclarative/src/qml/qml/qqmlapplicationengine.cpp:306

      now the funny part: when examining the stack at `QQmlComponent::setInitialProperties`, the "properties" map looks good. but both name and value seem to be corrupted in `QQmlComponentPrivate::setInitialProperty`

      some observations:

      • it works fine if i compile my application code with clang
      • both gcc-10 and gcc-11 crash in this location
        this is quite surprising to me, as the in both cases qt is compiled with gcc.
      • the content of the QVariantMap doesn't seem to matter much.
      • unfortunately i could not build a test case from scratch
      • i'm seeing the same crash on x86_64 and on armv7

      makes me wonder how to debug this further ... any ideas?


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



            qtqmlteam Qt Qml Team User
            timblechmann tim blechmann
            0 Vote for this issue
            3 Start watching this issue



              Gerrit Reviews

                There are no open Gerrit changes