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

qmlpreview fails to load libworkerscriptplugin.so

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • 6.8
    • 6.6.0
    • QML: Tooling
    • None
    • Void Linux, Qt 6.6.0
    • Linux/X11, Linux/Other display system

    Description

      When building a QML application with QML debugging enabled and running it in qmlpreview, the Qt plugin loader fails to load libworkerscriptplugin.so with the error "failed to map to memory: Unknown error". This prevents the QML module QtQml from being loaded and the application from launching. This does not happen when the application is run directly.

      Through some debugging, it would appear that d->fileEngine->supportsExtension(QAbstractFileEngine::MapExtension) returns false, when it seems like it should be returning true.

      The attached minimal reproducing application causes the error when run in qmlpreview:

      $ mkdir build; cd build
      $ cmake ..; make
      $ qmlpreview ./helloworld
      QML debugging is enabled. Only use this in a safe environment.
      QML Debugger: Connecting to socket /tmp/qmlpreview.sMiiGA...
      qt.core.plugin.loader: /usr/lib/qt6/qml/QtQml/WorkerScript/libworkerscriptplugin.so: failed to map to memory: Unknown error
      qt.core.plugin.loader: /usr/lib/qt6/qml/QtQml/WorkerScript/libworkerscriptplugin.so: failed to map to memory: Unknown error
      qt.core.plugin.loader: /usr/lib/qt6/qml/QtQml/WorkerScript/libworkerscriptplugin.so: failed to map to memory: Unknown error
      qt.core.plugin.loader: /usr/lib/qt6/qml/QtQml/WorkerScript/libworkerscriptplugin.so: failed to map to memory: Unknown error
      QQmlApplicationEngine failed to load component
      qrc:/main.qml:8:1: module "QtQuick" version 2.12 cannot be imported because:
      module "QtQml" version 2.12 cannot be imported because:
      The file '/usr/lib/qt6/qml/QtQml/WorkerScript/libworkerscriptplugin.so' is not a valid Qt plugin.
      qrc:/main.qml: module "QtQml" version 2.12 cannot be imported because:
      The file '/usr/lib/qt6/qml/QtQml/WorkerScript/libworkerscriptplugin.so' is not a valid Qt plugin.
      qrc:/main.qml: The file '/usr/lib/qt6/qml/QtQml/WorkerScript/libworkerscriptplugin.so' is not a valid Qt plugin.
      qrc:/main.qml: module "QtQml" version 2.12 cannot be imported because:
      The file '/usr/lib/qt6/qml/QtQml/WorkerScript/libworkerscriptplugin.so' is not a valid Qt plugin.
      qrc:/main.qml: The file '/usr/lib/qt6/qml/QtQml/WorkerScript/libworkerscriptplugin.so' is not a valid Qt plugin.
      qrc:/main.qml: module "QtQuick" version 2.12 cannot be imported because:
      module "QtQml" version 2.12 cannot be imported because:
      The file '/usr/lib/qt6/qml/QtQml/WorkerScript/libworkerscriptplugin.so' is not a valid Qt plugin.
      qrc:/main.qml: module "QtQml" version 2.12 cannot be imported because:
      The file '/usr/lib/qt6/qml/QtQml/WorkerScript/libworkerscriptplugin.so' is not a valid Qt plugin.
      qrc:/main.qml: The file '/usr/lib/qt6/qml/QtQml/WorkerScript/libworkerscriptplugin.so' is not a valid Qt plugin.
      qrc:/main.qml: module "QtQml" version 2.12 cannot be imported because:
      The file '/usr/lib/qt6/qml/QtQml/WorkerScript/libworkerscriptplugin.so' is not a valid Qt plugin.
      qrc:/main.qml: The file '/usr/lib/qt6/qml/QtQml/WorkerScript/libworkerscriptplugin.so' is not a valid Qt plugin.
      qrc:/main.qml: Failed to load dependent import "QtQml.WorkerScript" version 2.12
      qrc:/main.qml: Failed to load dependencies for module "QtQml" version 2.12
      qrc:/main.qml: Failed to load dependent import "QtQml.WorkerScript" version 2.12
      qrc:/main.qml: Failed to load dependencies for module "QtQml" version 2.12
      qrc:/main.qml: Failed to load dependent import "QtQml" version 2.12
      qrc:/main.qml: Failed to load dependencies for module "QtQuick" version 2.12
      qrc:/main.qml: Failed to load dependent import "QtQml.WorkerScript" version 2.12
      qrc:/main.qml: Failed to load dependencies for module "QtQml" version 2.12
      qrc:/main.qml: Failed to load dependent import "QtQml.WorkerScript" version 2.12
      qrc:/main.qml: Failed to load dependencies for module "QtQml" version 2.12
      qrc:/main.qml: Failed to load dependent import "QtQml" version 2.12
      qrc:/main.qml: Failed to load dependencies for module "QtQuick" version 2.12
      

      If a Void Linux environment is needed, OCI containers are available:

      $ docker run -it -v $(pwd)/testapp:/test ghcr.io/void-linux/void-glibc-full
      # xbps-install -Syu base-devel cmake qt6-declarative-devel qt6-declarative-tools
      # mkdir /test/build; cd /test/build
      # cmake ..; make
      # QT_QPA_PLATFORM=offscreen /usr/lib/qt6/bin/qmlpreview ./helloworld
      

      Attachments

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

        Activity

          People

            qtqmlteam Qt Qml Team User
            classabbyamp Abby classabbyamp
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes