Details
-
Bug
-
Resolution: Done
-
P1: Critical
-
5.10.0, 5.9.4, 5.10.1
-
None
-
macOS 10.13.3 / iOS 10.3 / iOS 11.2 / Android 7 / Android 8
-
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