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

Crash when trying to trick property bindings

    XMLWordPrintable

Details

    • 1786f6c18 (dev), fe856f769 (6.6), 5a643eb8c (6.5), 60d7e1a84 (tqtc/lts-6.2)

    Description

      The following code crashes:

      import QtQuick
      import QtQuick.Window
      
      Window {
          id: top
          width: 640
          height: 480
          visible: true
          title: qsTr("Hello World")
      
          property int test: 1
      
          Component {
              id: comp
              Item {
                  width: { width = test * 100 }
              }
          }
      
          Loader {
              sourceComponent: comp
              width: 100
          }
      }
      

      Stack trace:

                                                                                                            
      1   QPropertyBindingPrivate::hasCustomVTable            qproperty_p.h             400  0x7fffbe86c4a3 
      2   QQmlObjectCreator::finalize                         qqmlobjectcreator.cpp     1473 0x7fffb2a2b780 
      3   QQmlIncubatorPrivate::incubate                      qqmlincubator.cpp         346  0x7fffb29b326a 
      4   QQmlEnginePrivate::incubate                         qqmlincubator.cpp         55   0x7fffb29b1f25 
      5   QQmlComponent::create                               qqmlcomponent.cpp         1429 0x7fffb286e758 
      6   QQuickLoaderPrivate::_q_sourceLoaded                qquickloader.cpp          743  0x7fffa4ba6f7e 
      7   QQuickLoaderPrivate::load                           qquickloader.cpp          605  0x7fffa4ba5d53 
      8   QQuickLoader::componentComplete                     qquickloader.cpp          803  0x7fffa4ba4657 
      9   QQmlObjectCreator::finalize                         qqmlobjectcreator.cpp     1498 0x7fffb2a2b9ac 
      10  QQmlComponentPrivate::complete                      qqmlcomponent.cpp         1149 0x7fffb2872deb 
      11  QQmlComponentPrivate::completeCreate                qqmlcomponent.cpp         1253 0x7fffb28716fb 
      12  QQmlComponent::completeCreate                       qqmlcomponent.cpp         1231 0x7fffb286e273 
      13  QQmlComponentPrivate::createWithProperties          qqmlcomponent.cpp         959  0x7fffb2873df5 
      14  QQmlComponent::create                               qqmlcomponent.cpp         908  0x7fffb286e055 
      15  QQmlApplicationEnginePrivate::finishLoad            qqmlapplicationengine.cpp 135  0x7fffb282bb4b 
      16  QQmlApplicationEnginePrivate::ensureLoadingFinishes qqmlapplicationengine.cpp 163  0x7fffb282bdee 
      17  QQmlApplicationEnginePrivate::startLoad             qqmlapplicationengine.cpp 110  0x7fffb282b5bb 
      18  QQmlApplicationEngine::load                         qqmlapplicationengine.cpp 324  0x7fffb282a52e 
      19  main                                                main.cpp                  16   0x7ff6452633db 
      20  qtEntryPoint                                        qtentrypoint_win.cpp      50   0x7ff64526f1b7 
      ... <More>                                                                                            
      

      The context here is an attempt at setting properties without creating a binding, to work around QTBUG-117641.

      When googling for this, the following suggestion comes up: https://stackoverflow.com/a/64947495

      It's possible this was a hack that worked in Qt 5 for random reasons, but it probably shouldn't crash, so I thought it was worth reporting.

      Attachments

        Issue Links

          For Gerrit Dashboard: QTBUG-117642
          # Subject Branch Project Status CR V

          Activity

            People

              olivier.decanniere Olivier De Cannière
              esabraha Eskil Abrahamsen Blomfeldt
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes