Uploaded image for project: 'Nuxeo Drive '
  1. Nuxeo Drive
  2. NXDRIVE-1880

[macOS] Fix a segfault when loading QtQuick.Controls QML plugin

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Blocker
    • Resolution: Fixed
    • Affects Version/s: 4.3.0
    • Fix Version/s: 4.3.0
    • Component/s: Packaging / Build
    • Environment:
      macOS

      Description

      Issue

      With fixes including to support macOS Mojave in NXDRIVE-1391, Drive does not start anymore:

      $ QT_DEBUG_PLUGINS=1 ./Nuxeo\ Drive.app/Contents/MacOS/ndrive
      # ...
      Found metadata in lib /Applications/Nuxeo Drive.app/Contents/Resources/PyQt5/Qt/qml/QtQuick/Controls.2/libqtquickcontrols2plugin.dylib, metadata=
      {
          "IID": "org.qt-project.Qt.QQmlExtensionInterface/1.0",
          "archreq": 0,
          "className": "QtQuickControls2Plugin",
          "debug": false,
          "uri": [
              "QtQuick.Controls.2"
          ],
          "version": 331008
      }
      
      loaded library "/Applications/Nuxeo Drive.app/Contents/Resources/PyQt5/Qt/qml/QtQuick/Controls.2/libqtquickcontrols2plugin.dylib"
      Trying... "/Applications/Nuxeo Drive.app/Contents/Resources/PyQt5/Qt/qml/QtQuick/Controls.2/qtquickcontrols2plugin"
      Trying... "/Applications/Nuxeo Drive.app/Contents/Resources/PyQt5/Qt/qml/QtQuick/Controls.2/qtquickcontrols2plugin.so"
      Trying... "/Applications/Nuxeo Drive.app/Contents/Resources/PyQt5/Qt/qml/QtQuick/Controls.2/qtquickcontrols2plugin.bundle"
      Trying... "/Applications/Nuxeo Drive.app/Contents/Resources/PyQt5/Qt/qml/QtQuick/Controls.2/qtquickcontrols2plugin.dylib"
      Trying... "/Applications/Nuxeo Drive.app/Contents/Resources/PyQt5/Qt/qml/QtQuick/Controls.2/libqtquickcontrols2plugin"
      Trying... "/Applications/Nuxeo Drive.app/Contents/Resources/PyQt5/Qt/qml/QtQuick/Controls.2/libqtquickcontrols2plugin.so"
      Trying... "/Applications/Nuxeo Drive.app/Contents/Resources/PyQt5/Qt/qml/QtQuick/Controls.2/libqtquickcontrols2plugin.bundle"
      Trying... "/Applications/Nuxeo Drive.app/Contents/Resources/PyQt5/Qt/qml/QtQuick/Controls.2/libqtquickcontrols2plugin.dylib"
      SEGFAULT
      

      In the console, a crash report is generated:

      Crashed Thread:        4  QQmlThread
      
      Exception Type:        EXC_GUARD
      Exception Codes:       0x4000004000000005, 0x08fd4dbfade2dead
      Exception Subtype:     GUARD_TYPE_FD, id=0x08fd4dbfade2dead, fd=5, flavor=0x00000040 (WRITE)
      

      See the attached crash file for details.

      Investigations

      In the packaging process, the tools/osx/fix_app_qt_folder_names_for_codesign.py script is called to fix codesigning with folders containing a dot in their name. See NXDRIVE-1301 for details.
      If that call is skipped, the application starts as expected (but codesiging is then broken):

      $ QT_DEBUG_PLUGINS=1 ./Nuxeo\ Drive.app/Contents/MacOS/ndrive
      # ...
      Found metadata in lib /Applications/Nuxeo Drive.app/Contents/MacOS/PyQt5/Qt/qml/QtQuick.2/libqtquick2plugin.dylib, metadata=
      {
          "IID": "org.qt-project.Qt.QQmlExtensionInterface/1.0",
          "archreq": 0,
          "className": "QtQuick2Plugin",
          "debug": false,
          "uri": [
              "QtQuick.2"
          ],
          "version": 331008
      }
      
      loaded library "/Applications/Nuxeo Drive.app/Contents/MacOS/PyQt5/Qt/qml/QtQuick.2/libqtquick2plugin.dylib"
      # ...
      

      Fix

      A change may be needed in the tools/osx/fix_app_qt_folder_names_for_codesign.py script: instead of moving problematic folders, move the parent folder ("qml"). After a day of investigations, it seems to be the good workaround).

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 6 hours
                  6h