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

QML Engine (QV4) crashes with QtQuickCompiler and large allocations/strings

    XMLWordPrintable

Details

    • b79f7477b9a0f2e301b16b4908e1944423b77fb8

    Description

      Allocating more than ~32KB in a string will crash the application when using QtQuickCompiler. It seems the ~32KB limit is for the whole JS code. When dividing the allocation into multiple variables the application will crash when they reach the limit.

      See attached call stack and example.

      Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
      0 libsystem_kernel.dylib 0x00007fff54d85e3e __pthread_kill + 10
      1 libsystem_pthread.dylib 0x00007fff54ec4150 pthread_kill + 333
      2 libsystem_c.dylib 0x00007fff54ce2312 abort + 127
      3 libsystem_malloc.dylib 0x00007fff54ddf866 free + 521
      4 org.qt-project.QtQml 0x0000000104cc7eb4 QQmlOpenMetaObjectType::~QQmlOpenMetaObjectType() + 52
      5 org.qt-project.QtQml 0x0000000104c032e2 QV4::ExecutionContext::getProperty(QV4::String*) + 450
      6 org.qt-project.QtQml 0x0000000104cc007c QV4::Runtime::method_getActivationProperty(QV4::ExecutionEngine*, int) + 92
      7 com.mycompany.string-length-allocation	0x0000000104724e33 (anonymous namespace)::jsfunction_0(QV4::ExecutionEngine*) + 1251 (allocation_js.cpp:65)
      8 org.qt-project.QtQml 0x0000000104c02d43 QV4::ExecutionContext::simpleCall(QV4::Scope&, QV4::CallData*, QV4::Function*) + 419
      9 org.qt-project.QtQml 0x0000000104c4207e QV4::Script::run() + 302
      10 org.qt-project.QtQml 0x0000000104d16084 QQmlScriptData::scriptValueForContext(QQmlContextData*) + 948
      11 org.qt-project.QtQml 0x0000000104d6cbd9 QQmlObjectCreator::create(int, QObject*, QQmlInstantiationInterrupt*) + 601
      12 org.qt-project.QtQml 0x0000000104cea2bd QQmlComponentPrivate::beginCreate(QQmlContextData*) + 893
      13 org.qt-project.QtQml 0x0000000104ce9ee1 QQmlComponent::create(QQmlContext*) + 97
      14 org.qt-project.QtQml 0x0000000104d65eda QQmlApplicationEnginePrivate::finishLoad(QQmlComponent*) + 90
      15 org.qt-project.QtQml 0x0000000104d664f2 QQmlApplicationEngine::load(QUrl const&) + 34
      16 com.mycompany.string-length-allocation	0x0000000104724275 main + 133 (main.cpp:11)
      17 libdyld.dylib 0x00007fff54c36115 start + 1
      

      Attachments

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

        Activity

          People

            erikv Erik Verbruggen
            gri Christoph Keller
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes