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

Crash in a statically built Qt Quick application on exit

    XMLWordPrintable

Details

    • iOS/tvOS/watchOS, Linux/X11, macOS
    • c018df5b4075ae962966d4df7653d476dab02840 (qt/qtdeclarative/5.12)

    Description

      I made static build of Qt 5.12.2

      OPENSSL_LIBS='-L/usr/local/lib -lssl -lcrypto' ./configure -opensource -confirm-license -debug -release -optimized-tools -optimize-size -static -prefix ~/Qt/5.12.2/gcc_64_static -c++std c++1z -nomake examples -nomake tests -ssl -openssl-linked -system-freetype -qt-libpng -qt-libjpeg -qt-zlib -qt-harfbuzz -opengl desktop -xcb-xlib -xcb-xinput -qpa xcb -xkb -qt-xcb -fontconfig
      

      Builded the application, having statically plug-ins as follows:

      static {
      LIBS += -L$$[QT_INSTALL_PREFIX]/qml/QtQuick.2 \
              -L$$[QT_INSTALL_PREFIX]/qml/QtQuick/Controls.2 \
              -L$$[QT_INSTALL_PREFIX]/qml/QtQuick/Controls.2/Material \
              -L$$[QT_INSTALL_PREFIX]/qml/QtQuick/Window.2 \
              -L$$[QT_INSTALL_PREFIX]/qml/QtQuick/Templates.2
      
      QTPLUGIN += qtquick2plugin \
                  qtquickcontrols2plugin \
                  qtquickcontrols2materialstyleplugin \
                  windowplugin \
                  qtquicktemplates2plugin
      }
      

      Made import, according to documentation

      #ifdef QT_STATIC
      #include <QtPlugin>
      #include <QQmlExtensionPlugin>
      Q_IMPORT_PLUGIN(QtQuick2Plugin)
      Q_IMPORT_PLUGIN(QtQuickControls2Plugin)
      Q_IMPORT_PLUGIN(QtQuickControls2MaterialStylePlugin)
      Q_IMPORT_PLUGIN(QtQuick2WindowPlugin)
      Q_IMPORT_PLUGIN(QtQuickTemplates2Plugin)
      #endif

      At regular exit of the application there is a sigfault in disassembler

       

      0x555555db7cfc                  48 8b 0f     mov    (%rdi),%rcx
      0x555555db7cff  <+    3>        41 89 d0     mov    %edx,%r8d
      0x555555db7d02  <+    6>        48 89 f8     mov    %rdi,%rax
      0x555555db7d05  <+    9>        44 8b 49 20  mov    0x20(%rcx),%r9d
      0x555555db7d09  <+   13>        45 85 c9     test   %r9d,%r9d
      0x555555db7d0c  <+   16>        74 2d        je     0x555555db7d3b <_ZNK5QHashIPK11QMetaObjectiE8findNodeERKS2_j+63>
      0x555555db7d0e  <+   18>        89 d0        mov    %edx,%eax
      0x555555db7d10  <+   20>        31 d2        xor    %edx,%edx
      0x555555db7d12  <+   22>        41 f7 f1     div    %r9d
      0x555555db7d15  <+   25>        48 8b 41 08  mov    0x8(%rcx),%rax
      0x555555db7d19  <+   29>        89 d2        mov    %edx,%edx
      0x555555db7d1b  <+   31>        48 8d 04 d0  lea    (%rax,%rdx,8),%rax
      0x555555db7d1f  <+   35>        48 8b 10     mov    (%rax),%rdx
      0x555555db7d22  <+   38>        48 39 d1     cmp    %rdx,%rcx
      0x555555db7d25  <+   41>        74 14        je     0x555555db7d3b <_ZNK5QHashIPK11QMetaObjectiE8findNodeERKS2_j+63>
      HERE->>>>>>0x555555db7d27  <+   43>        44 3b 42 08  cmp    0x8(%rdx),%r8d
      0x555555db7d2b  <+   47>        75 09        jne    0x555555db7d36 <_ZNK5QHashIPK11QMetaObjectiE8findNodeERKS2_j+58>
      0x555555db7d2d  <+   49>        48 8b 7a 10  mov    0x10(%rdx),%rdi
      0x555555db7d31  <+   53>        48 39 3e     cmp    %rdi,(%rsi)
      0x555555db7d34  <+   56>        74 05        je     0x555555db7d3b <_ZNK5QHashIPK11QMetaObjectiE8findNodeERKS2_j+63>
      0x555555db7d36  <+   58>        48 89 d0     mov    %rdx,%rax
      0x555555db7d39  <+   61>        eb e4        jmp    0x555555db7d1f <_ZNK5QHashIPK11QMetaObjectiE8findNodeERKS2_j+35>
      0x555555db7d3b  <+   63>        c3           retq
      

      Stack of calls:

      1 QHash<QMetaObject const *, int>::findNode(QMetaObject const * const&, unsigned int) const                  0x555555db7d27 
      2 QQmlType::~QQmlType()                                                                                      0x555555db7e91 
      3 QList<QQmlType>::dealloc(QListData::Data *) [clone .isra.132]                                              0x555555db7f2d 
      4 (anonymous namespace)::Q_QGS_metaTypeData::innerFunction()::Holder::~Holder()                              0x555555db992d 
      5 __run_exit_handlers                                                                       exit.c       108 0x7ffff4444041 
      6 __GI_exit                                                                                 exit.c       139 0x7ffff444413a 
      7 __libc_start_main                                                                         libc-start.c 344 0x7ffff4422b9e 
      8 _start                                                                                                     0x5555556c11da 
      

      At the same time, falling happens on any QtQuick the application, even hello world. But only, if to import Controls 2. Without this plug-in of the application come to the end correctly

      Attachments

        Issue Links

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

          Activity

            People

              ulherman Ulf Hermann
              man_k28 Stanislav Prokofev
              Votes:
              4 Vote for this issue
              Watchers:
              12 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes