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

Races in QJSEngine()

    XMLWordPrintable

    Details

    • Commits:
      8d326a649938e23ecc0756fe8c42bf6cccca0251 18ba7ed4933273ba463bd9b663fd83dee490bccd d435fd9a26c2f5628de6c5ae75b80900c1f2c59f

      Description

      There seems to be a race in QJSEngine(). Running attached application, it often triggers an assert, but it also sometimes throws warnings about type converters or about a function call in javascript.

      Assert occurs in here (5.15.4):

      qtdeclarative/src/qml/qml/qqmlpropertycache.cpp, line 655
      

      The converter points to:

                                                                                                                                                                                                                                                                                               1  QMetaType::registerConverterFunction                                                                                                                                                                                                         qmetatype.cpp         694  0x7ffff6802e96 
      2  QtPrivate::ValueTypeIsMetaType<std::vector<int>, true>::registerConverter                                                                                                                                                                    qmetatype.h           2436 0x7ffff6f5ec15 
      3  qRegisterNormalizedMetaType<std::vector<int>>(QByteArray const&, std::vector<int> *, QtPrivate::MetaTypeDefinedHelper<std::vector<int>, QMetaTypeId2<std::vector<int>>::Defined&&(!QMetaTypeId2<std::vector<int>>::IsBuiltIn)>::DefinedType) qmetatype.h           1874 0x7ffff6f5ec15 
      4  QMetaTypeId<std::vector<int>>::qt_metatype_id                                                                                                                                                                                                qmetatype.h           2260 0x7ffff6f5ed38 
      5  QMetaTypeId2<std::vector<int>>::qt_metatype_id                                                                                                                                                                                               qmetatype.h           1776 0x7ffff6f5eb51 
      6  QtPrivate::QMetaTypeIdHelper<std::vector<int>, true>::qt_metatype_id                                                                                                                                                                         qmetatype.h           1789 0x7ffff6f5eb51 
      7  qRegisterNormalizedMetaType<std::vector<int>>(QByteArray const&, std::vector<int> *, QtPrivate::MetaTypeDefinedHelper<std::vector<int>, QMetaTypeId2<std::vector<int>>::Defined&&(!QMetaTypeId2<std::vector<int>>::IsBuiltIn)>::DefinedType) qmetatype.h           1857 0x7ffff6f5eb51 
      8  qRegisterMetaType<std::vector<int>>(const char *, std::vector<int> *, QtPrivate::MetaTypeDefinedHelper<std::vector<int>, QMetaTypeId2<std::vector<int>>::Defined&&(!QMetaTypeId2<std::vector<int>>::IsBuiltIn)>::DefinedType)                qmetatype.h           1896 0x7ffff6fbc6a3 
      9  QV4::SequencePrototype::init                                                                                                                                                                                                                 qv4sequenceobject.cpp 725  0x7ffff6fb22dd 
      10 QV4::ExecutionEngine::ExecutionEngine                                                                                                                                                                                                        qv4engine.cpp         652  0x7ffff6e9d442 
      11 QJSEngine::QJSEngine                                                                                                                                                                                                                         qjsengine.cpp         343  0x7ffff6e8ae8d 
      12 QJSEngine::QJSEngine                                                                                                                                                                                                                         qjsengine.cpp         330  0x7ffff6e8aeb2 
      13 MyThread::run                                                                                                                                                                                                                                main.cpp              27   0x402bd6       
      14 QThreadPrivate::start                                                                                                                                                                                                                        qthread_unix.cpp      329  0x7ffff65eec74 
      15 start_thread                                                                                                                                                                                                                                 pthread_create.c      333  0x7ffff50ad6ba 
      16 clone                                                                                                                                                                                                                                        clone.S               109  0x7ffff5cdd51d 
      

      Prints this:

      Type conversion already registered from type std::vector<int> to type QtMetaTypePrivate::QSequentialIterableImpl
      

      This happens when debugging, but I guess is unrelated:

      QObject: Cannot create children for a parent that is in a different thread.
      (Parent is QQmlDebuggerServiceFactory(0x7fffd0029400), parent's thread is QThread(0x667680), current thread is MyThread(0x72d0a0)
      

      Sometimes this gets printed. The function takes int parameter which should be ok, so something about the type information gets lost at runtime randomly:

      "Could not convert argument 0 at"
      	 "%entry@file:test.js:2"
      "Passing incompatible arguments to C++ functions from JavaScript is dangerous and deprecated."
      "This will throw a JavaScript TypeError in future releases of Qt!"
      

      And finally the assert:

      ASSERT: "data->notFullyResolved()" in file /home/user/qt/qtdeclarative/src/qml/qml/qqmlpropertycache.cpp, line 655
      

        Attachments

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

          Activity

            People

            Assignee:
            ulherman Ulf Hermann
            Reporter:
            poikelin Joni Poikelin
            Votes:
            3 Vote for this issue
            Watchers:
            7 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Gerrit Reviews

                There are no open Gerrit changes