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

[Reg 6.2 -> 6.5] Crash when using PropertyChanges with multiple inline components

    XMLWordPrintable

Details

    • Windows
    • b91a26ae3 (dev), 5b62b99f3 (6.7), ef54690ee (tqtc/lts-6.5)

    Description

      When two inline components are defined in the same file, and they have an item with the same id, and that id is referenced in a PropertyChanges in each component, an access violation occurs in a thread named QQmlThread in the std::_Atomic_storage<int,4>::load method. It does not require instantiating the components, only that the QML file component is loaded. Below I have the minimum QML code needed to trigger the crash, and have it in a minimal project to trigger the crash here

      import QtQuick
      
      Item {
          component First : Item {
              Item {
                  id: a
              }
      
              states: [
                  State {
                      name: "test1"
      
                      PropertyChanges {
                          a.enabled: false
                      }
                  }
              ]
          }
      
          component Second : Item {
              Item {
                  id: a
              }
      
              states: [
                  State {
                      name: "test2"
      
                      PropertyChanges {
                          a.enabled: false
                      }
                  }
              ]
          }
      }
      

      Here is the call stack for the exception also

      Qt6Qmld!std::_Atomic_storage<int,4>::load
      Qt6Qmld!QAtomicOps<int>::loadRelaxed<int>
      Qt6Qmld!QBasicAtomicInteger<int>::loadRelaxed
      Qt6Qmld!QQmlRefCount::addref
      Qt6Qmld!QQmlPropertyCacheVector::set
      Qt6Qmld!QQmlPendingGroupPropertyBindings::resolveMissingPropertyCaches
      Qt6Qmld!QQmlTypeCompiler::compile
      Qt6Qmld!QQmlTypeData::compile
      Qt6Qmld!QQmlTypeData::done
      Qt6Qmld!QQmlDataBlob::tryDone
      Qt6Qmld!QQmlTypeLoader::setCachedUnit
      Qt6Qmld!QQmlTypeLoader::loadWithCachedUnitThread
      Qt6Qmld!QQmlTypeLoaderThread::loadWithCachedUnitThread
      Qt6Qmld!std::invoke<void (__cdecl QQmlTypeLoaderThread::*&)(QQmlRefPointer<QQmlDataBlob> const &,QQmlPrivate::CachedQmlUnit const *),QQmlTypeLoaderThread *,QQmlRefPointer<QQmlDataBlob>,QQmlPrivate::CachedQmlUnit const *>
      Qt6Qmld!std::_Apply_impl<void (__cdecl QQmlTypeLoaderThread::*&)(QQmlRefPointer<QQmlDataBlob> const &,QQmlPrivate::CachedQmlUnit const *),std::tuple<QQmlTypeLoaderThread *,QQmlRefPointer<QQmlDataBlob>,QQmlPrivate::CachedQmlUnit const *>,0,1,2>
      Qt6Qmld!std::apply<void (__cdecl QQmlTypeLoaderThread::*&)(QQmlRefPointer<QQmlDataBlob> const &,QQmlPrivate::CachedQmlUnit const *),std::tuple<QQmlTypeLoaderThread *,QQmlRefPointer<QQmlDataBlob>,QQmlPrivate::CachedQmlUnit const *> >
      Qt6Qmld!`QQmlThread::createMessageFromMethod<void (__cdecl QQmlTypeLoaderThread::*)(QQmlRefPointer<QQmlDataBlob> const &,QQmlPrivate::CachedQmlUnit const *),QQmlRefPointer<QQmlDataBlob> const &,QQmlPrivate::CachedQmlUnit const * &>'::`2'::I::call
      Qt6Qmld!QQmlThreadPrivate::threadEvent
      Qt6Qmld!QQmlThreadPrivate::event
      Qt6Cored!QCoreApplicationPrivate::notify_helper
      Qt6Cored!doNotify
      Qt6Cored!QCoreApplication::notify
      Qt6Guid!QGuiApplication::notify
      Qt6Cored!QCoreApplication::notifyInternal2
      Qt6Cored!QCoreApplication::sendEvent
      Qt6Cored!QCoreApplicationPrivate::sendPostedEvents
      Qt6Cored!QEventDispatcherWin32::sendPostedEvents
      Qt6Cored!QEventDispatcherWin32::processEvents
      Qt6Cored!QEventLoop::processEvents
      Qt6Cored!QEventLoop::exec
      Qt6Cored!QThread::exec
      Qt6Cored!QThread::run
      Qt6Cored!QThreadPrivate::start
      KERNEL32!BaseThreadInitThunk
      ntdll!RtlUserThreadStart
      

      It's worth noting that this is null in the std::_Atomic_storage<int,4>::load stack frame

      Attachments

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

        Activity

          People

            ulherman Ulf Hermann
            rebecca Rebecca Reitsma
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes