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

qmlls eats all available memory

    XMLWordPrintable

Details

    • Linux/X11

    Description

      I have a project where qmlls quickly consumes 60 GB, crashing the machine.

      Repro:

      git clone https://github.com/iamsergio/rebaser.git
      cd rebaser
      git submodule update --init
      cmake --preset=dev -DQT_QML_GENERATE_QMLLS_INI=ON && cmake --build build-dev
      cp src/cpp/.qmlls.ini .
      // Now open main.qml in your editor

      Heaptrack:

      QQmlJSRegisterContentPool::clone(QQmlJSRegisterContentPrivate const*) in libQt6QmlCompiler.so.6
      QQmlJSRegisterContentPool::create() in libQt6QmlCompiler.so.6
      QQmlJSRegisterContentPool::create(QQmlJSRegisterContent, QQmlJSRegisterContent::ContentVariant) in libQt6QmlCompiler.so.6
      QQmlJSRegisterContentPool::createConversion(QList<QQmlJSRegisterContent> const&, QDeferredSharedPointer<QQmlJSScope const> const&, QQmlJSRegisterContent, QQmlJSRegisterContent::ContentVariant, QQmlJSRegisterContent) in libQt6QmlCompiler.so.6
      QQmlJSTypeResolver::merge(QQmlJSRegisterContent, QQmlJSRegisterContent) const in libQt6QmlCompiler.so.6
      QQmlJSTypeResolver::merge(QQmlJSRegisterContent, QQmlJSRegisterContent) const::operator() in libQt6QmlCompiler.so.6
      QQmlJSTypeResolver::merge(QQmlJSRegisterContent, QQmlJSRegisterContent) const in libQt6QmlCompiler.so.6
      QQmlJSTypeResolver::merge(QQmlJSRegisterContent, QQmlJSRegisterContent) const::operator() in libQt6QmlCompiler.so.6
      QQmlJSTypeResolver::merge(QQmlJSRegisterContent, QQmlJSRegisterContent) const in libQt6QmlCompiler.so.6
      QQmlJSTypeResolver::merge(QQmlJSRegisterContent, QQmlJSRegisterContent) const::operator() in libQt6QmlCompiler.so.6
      QQmlJSTypeResolver::merge(QQmlJSRegisterContent, QQmlJSRegisterContent) const in libQt6QmlCompiler.so.6
      QQmlJSTypePropagator::generate_IteratorNext(int, int) in libQt6QmlCompiler.so.6
      QV4::Moth::ByteCodeHandler::decode(char const*, unsigned int) in libQt6Qml.so.6
      QQmlJSTypePropagator::run(QQmlJSCompilePass::Function const*) in libQt6QmlCompiler.so.6
      QQmlJSLinterCodegen::analyzeFunction(QV4::Compiler::Context const*, QQmlJSCompilePass::Function*, QList<QQmlJS::DiagnosticMessage>*) in libQt6QmlCompiler.so.6
      QQmlJSLinterCodegen::compileBinding(QV4::Compiler::Context const*, QmlIR::Binding const&, QQmlJS::AST::Node*) in libQt6QmlCompiler.so.6
      std::for_each<__gnu_cxx::__normal_iterator<BindingOrFunction*, std::vector<BindingOrFunction> >, qCompileQmlFile(QmlIR::Document&, const QString&, QQmlJSSaveFunction, QQmlJSAotCompiler*, QQmlJSCompileError*, bool, QV4::Compiler::CodegenWarningInterface*, const QString*)::<lambda(const BindingOrFunction&)> >::operator() in libQt6QmlCompiler.so.6
      std:: in libQt6QmlCompiler.so.6
      qCompileQmlFile(QmlIR::Document&, QString const&, std::function<bool (QV4::CompiledData::SaveableUnitPointer const&, QMap<int, QQmlJSAotFunction> const&, QString*)>, QQmlJSAotCompiler*, QQmlJSCompileError*, bool, QV4::Compiler::CodegenWarningInterface*, QString const*) in libQt6QmlCompiler.so.6
      qCompileQmlFile(QString const&, std::function<bool (QV4::CompiledData::SaveableUnitPointer const&, QMap<int, QQmlJSAotFunction> const&, QString*)>, QQmlJSAotCompiler*, QQmlJSCompileError*, bool, QV4::Compiler::CodegenWarningInterface*, QString const*) in libQt6QmlCompiler.so.6
      QQmlJSLinter::lintFile(QString const&, QString const*, bool, QJsonArray*, QList<QString> const&, QList<QString> const&, QList<QString> const&, QList<QQmlJS::LoggerCategory> const&)::{lambda(QQmlJSResourceFileMapper*)#2}::operator()(QQmlJSResourceFileMapper*) const in libQt6QmlCompiler.so.6
      QQmlJSLinter::lintFile(QString const&, QString const*, bool, QJsonArray*, QList<QString> const&, QList<QString> const&, QList<QString> const&, QList<QQmlJS::LoggerCategory> const&) in libQt6QmlCompiler.so.6
      QmlLsp::QmlLintSuggestions::diagnoseHelper(QByteArray const&, QmlLsp::QmlLintSuggestions::VersionedDocument const&) in qmlls_real
      std::__do_visit<std::__detail::__variant::__deduce_visit_result<void>, qOverloadedVisitor<QmlLsp::QmlLintSuggestions::diagnose(const QByteArray&)::<lambda(QmlLsp::QmlLintSuggestions::NoDocumentAvailable)>, QmlLsp::QmlLintSuggestions::diagnose(const QByteArray&)::<lambda(const QmlLsp::QmlLintSuggestions::TryAgainLater&)>, QmlLsp::QmlLintSuggestions::diagnose(const QByteArray&)::<lambda(const QmlLsp::QmlLintSuggestions::VersionedDocument&)> >, std::variant<QmlLsp::QmlLintSuggestions::VersionedDocument, QmlLsp::QmlLintSuggestions::TryAgainLater, QmlLsp::QmlLintSuggestions::NoDocumentAvailable>&> in qmlls_real
      std::visit<qOverloadedVisitor<QmlLsp::QmlLintSuggestions::diagnose(const QByteArray&)::<lambda(QmlLsp::QmlLintSuggestions::NoDocumentAvailable)>, QmlLsp::QmlLintSuggestions::diagnose(const QByteArray&)::<lambda(const QmlLsp::QmlLintSuggestions::TryAgainLater&)>, QmlLsp::QmlLintSuggestions::diagnose(const QByteArray&)::<lambda(const QmlLsp::QmlLintSuggestions::VersionedDocument&)> >, std::variant<QmlLsp::QmlLintSuggestions::VersionedDocument, QmlLsp::QmlLintSuggestions::TryAgainLater, QmlLsp::QmlLintSuggestions::NoDocumentAvailable>&> in qmlls_real
      QmlLsp::QmlLintSuggestions::diagnose(QByteArray const&) in qmlls_real
      QtPrivate::QSlotObjectBase::call(QObject*, void**) in libQt6Core.so.6
      void doActivate<false>(QObject*, int, void**) in libQt6Core.so.6
      void QMetaObject::activate<void, QByteArray>(QObject*, QMetaObject const*, int, void*, QByteArray const&) in qmlls_real
      QmlLsp::QQmlCodeModel::updatedSnapshot(QByteArray const&) in qmlls_real
      QmlLsp::QQmlCodeModel::newDocForOpenFile(QByteArray const&, int, QString const&) in qmlls_real
      QmlLsp::QQmlCodeModel::openUpdate(QByteArray const&) in qmlls_real
      QmlLsp::QQmlCodeModel::openUpdateSome() in qmlls_real
      QRunnable::QGenericRunnable::Helper<QmlLsp::QQmlCodeModel::openNeedUpdate()::<lambda()> >::impl::operator() in qmlls_real
      QRunnable::QGenericRunnable::Helper<QmlLsp::QQmlCodeModel::openNeedUpdate()::<lambda()> >:: in qmlls_real
      QThreadPoolThread::run() in libQt6Core.so.6
      terminate_on_exception<QThreadPrivate::start(void*)::<lambda()> >::operator() in libQt6Core.so.6
       

      Attachments

        Issue Links

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

          Activity

            People

              qtqmlteam Qt Qml Team User
              iamsergio Sergio Martins
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes