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

Plugin parsing/loading issues under clang build (with ASan)

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P0: Blocker
    • 6.3.0 Alpha
    • 6.3, 6.x
    • Core: Plugins
    • None
    • Linux/X11
    • 0ab3c5c2505dcfa684fd4a3961f24345de7e1d6f (qt/qtbase/dev)

    Description

      I recently stopped being able to run Qt tests under Ubuntu. My local build is done with clang and the following is what I see:

      ag@ag:~/work/build/qt5$ ./qtdeclarative/tests/auto/qml/qmltc/tst_qmltc_nodiskcache
      qt.qpa.plugin: Could not find the Qt platform plugin "xcb" in ""
      This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.
      

      The following log is what gets printed out by the test:

      QFactoryLoader::QFactoryLoader() looking at "/home/ag/work/build/qt5/qtbase/plugins/platforms/libqxcb.so"
      qt.core.plugin.elfparser: /home/ag/work/build/qt5/qtbase/plugins/platforms/libqxcb.so : ELF 64-bit LSB (SYSV), version 1, shared library or PIC executable, x86-64
      qt.core.plugin.elfparser: /home/ag/work/build/qt5/qtbase/plugins/platforms/libqxcb.so : contains 8 program headers of 56 bytes at offset 64
      qt.core.plugin.elfparser: /home/ag/work/build/qt5/qtbase/plugins/platforms/libqxcb.so : contains 37 sections of 64 bytes at offset 314856 ; section header string table (shstrtab) is entry 36
      qt.core.plugin.elfparser: /home/ag/work/build/qt5/qtbase/plugins/platforms/libqxcb.so : program LOAD offset 0x0 virtaddr 0x0 filesz 0x5220 memsz 0x5220 align 0x200000 flags RX
      qt.core.plugin.elfparser: /home/ag/work/build/qt5/qtbase/plugins/platforms/libqxcb.so : program LOAD offset 0x59b8 virtaddr 0x2059b8 filesz 0xbd8 memsz 0xc88 align 0x200000 flags RW
      qt.core.plugin.elfparser: /home/ag/work/build/qt5/qtbase/plugins/platforms/libqxcb.so : program DYNAMIC offset 0x5c00 virtaddr 0x205c00 filesz 0x3b0 memsz 0x3b0 align 0x8 flags RW
      qt.core.plugin.elfparser: /home/ag/work/build/qt5/qtbase/plugins/platforms/libqxcb.so : program NOTE offset 0x200 virtaddr 0x200 filesz 0x24 memsz 0x24 align 0x4 flags R
      qt.core.plugin.elfparser: /home/ag/work/build/qt5/qtbase/plugins/platforms/libqxcb.so : program NOTE offset 0x5160 virtaddr 0x5160 filesz 0xc0 memsz 0xc0 align 0x20 flags R
      qt.core.plugin.elfparser: /home/ag/work/build/qt5/qtbase/plugins/platforms/libqxcb.so : program GNU_EH_FRAME offset 0x4938 virtaddr 0x4938 filesz 0x1a4 memsz 0x1a4 align 0x4 flags R
      qt.core.plugin.elfparser: /home/ag/work/build/qt5/qtbase/plugins/platforms/libqxcb.so : program GNU_STACK offset 0x0 virtaddr 0x0 filesz 0x0 memsz 0x0 align 0x10 flags RW
      qt.core.plugin.elfparser: /home/ag/work/build/qt5/qtbase/plugins/platforms/libqxcb.so : program GNU_RELRO offset 0x59b8 virtaddr 0x2059b8 filesz 0x648 memsz 0x648 align 0x1 flags R
      qt.core.plugin.elfparser: /home/ag/work/build/qt5/qtbase/plugins/platforms/libqxcb.so : shstrtab section is located at offset 314488 size 361
      qt.core.plugin.elfparser: /home/ag/work/build/qt5/qtbase/plugins/platforms/libqxcb.so : section 0 name "" type NULL flags  offset 0x0 size 0x0
      qt.core.plugin.elfparser: /home/ag/work/build/qt5/qtbase/plugins/platforms/libqxcb.so : section 1 name ".note.gnu.build-id" type NOTE flags A offset 0x200 size 0x24
      qt.core.plugin.elfparser: /home/ag/work/build/qt5/qtbase/plugins/platforms/libqxcb.so : section 2 name ".gnu.hash" type 0x6ffffff6 flags A offset 0x228 size 0x6c
      qt.core.plugin.elfparser: /home/ag/work/build/qt5/qtbase/plugins/platforms/libqxcb.so : section 3 name ".dynsym" type DYNSYM flags A offset 0x298 size 0x5d0
      qt.core.plugin.elfparser: /home/ag/work/build/qt5/qtbase/plugins/platforms/libqxcb.so : section 4 name ".dynstr" type STRTAB flags A offset 0x868 size 0x90f
      qt.core.plugin.elfparser: /home/ag/work/build/qt5/qtbase/plugins/platforms/libqxcb.so : section 5 name ".gnu.version" type 0x6fffffff flags A offset 0x1178 size 0x7c
      qt.core.plugin.elfparser: /home/ag/work/build/qt5/qtbase/plugins/platforms/libqxcb.so : section 6 name ".gnu.version_d" type 0x6ffffffd flags A offset 0x11f8 size 0xe4
      qt.core.plugin.elfparser: /home/ag/work/build/qt5/qtbase/plugins/platforms/libqxcb.so : section 7 name ".gnu.version_r" type 0x6ffffffe flags A offset 0x12e0 size 0xc0
      qt.core.plugin.elfparser: /home/ag/work/build/qt5/qtbase/plugins/platforms/libqxcb.so : section 8 name ".rela.dyn" type RELA flags A offset 0x13a0 size 0xa98
      qt.core.plugin.elfparser: /home/ag/work/build/qt5/qtbase/plugins/platforms/libqxcb.so : section 9 name ".rela.plt" type RELA flags A offset 0x1e38 size 0x2d0
      qt.core.plugin.elfparser: /home/ag/work/build/qt5/qtbase/plugins/platforms/libqxcb.so : section 10 name ".init" type PROGBITS flags AX offset 0x2108 size 0x17
      qt.core.plugin.elfparser: /home/ag/work/build/qt5/qtbase/plugins/platforms/libqxcb.so : section 11 name ".plt" type PROGBITS flags AX offset 0x2120 size 0x1f0
      qt.core.plugin.elfparser: /home/ag/work/build/qt5/qtbase/plugins/platforms/libqxcb.so : section 12 name ".plt.got" type PROGBITS flags AX offset 0x2310 size 0x10
      qt.core.plugin.elfparser: /home/ag/work/build/qt5/qtbase/plugins/platforms/libqxcb.so : section 13 name ".text" type PROGBITS flags AX offset 0x2320 size 0x1e6e
      qt.core.plugin.elfparser: /home/ag/work/build/qt5/qtbase/plugins/platforms/libqxcb.so : section 14 name ".fini" type PROGBITS flags AX offset 0x4190 size 0x9
      qt.core.plugin.elfparser: /home/ag/work/build/qt5/qtbase/plugins/platforms/libqxcb.so : section 15 name ".rodata" type PROGBITS flags A offset 0x41a0 size 0x783
      qt.core.plugin.elfparser: /home/ag/work/build/qt5/qtbase/plugins/platforms/libqxcb.so : section 16 name ".qtversion" type PROGBITS flags A offset 0x4928 size 0x10
      qt.core.plugin.elfparser: /home/ag/work/build/qt5/qtbase/plugins/platforms/libqxcb.so : section 17 name ".eh_frame_hdr" type PROGBITS flags A offset 0x4938 size 0x1a4
      qt.core.plugin.elfparser: /home/ag/work/build/qt5/qtbase/plugins/platforms/libqxcb.so : section 18 name ".eh_frame" type PROGBITS flags A offset 0x4ae0 size 0x680
      qt.core.plugin.elfparser: /home/ag/work/build/qt5/qtbase/plugins/platforms/libqxcb.so : section 19 name ".note.qt.metadata" type NOTE flags A offset 0x5160 size 0xc0
      qt.core.plugin.elfparser: /home/ag/work/build/qt5/qtbase/plugins/platforms/libqxcb.so : section 20 name ".init_array" type INIT_ARRAY flags WA offset 0x59b8 size 0x18
      qt.core.plugin.elfparser: /home/ag/work/build/qt5/qtbase/plugins/platforms/libqxcb.so : section 21 name ".fini_array" type FINI_ARRAY flags WA offset 0x59d0 size 0x10
      qt.core.plugin.elfparser: /home/ag/work/build/qt5/qtbase/plugins/platforms/libqxcb.so : section 22 name ".data.rel.ro" type PROGBITS flags WA offset 0x59e0 size 0x220
      qt.core.plugin.elfparser: /home/ag/work/build/qt5/qtbase/plugins/platforms/libqxcb.so : section 23 name ".dynamic" type DYNAMIC flags WA offset 0x5c00 size 0x3b0
      qt.core.plugin.elfparser: /home/ag/work/build/qt5/qtbase/plugins/platforms/libqxcb.so : section 24 name ".got" type PROGBITS flags WA offset 0x5fb0 size 0x40
      qt.core.plugin.elfparser: /home/ag/work/build/qt5/qtbase/plugins/platforms/libqxcb.so : section 25 name ".got.plt" type PROGBITS flags WA offset 0x6000 size 0x108
      qt.core.plugin.elfparser: /home/ag/work/build/qt5/qtbase/plugins/platforms/libqxcb.so : section 26 name ".data" type PROGBITS flags WA offset 0x6110 size 0x480
      qt.core.plugin.elfparser: /home/ag/work/build/qt5/qtbase/plugins/platforms/libqxcb.so : section 27 name ".bss" type NOBITS flags WA offset 0x6590 size 0xa0
      qt.core.plugin.elfparser: /home/ag/work/build/qt5/qtbase/plugins/platforms/libqxcb.so : section 28 name ".comment" type PROGBITS flags S offset 0x6590 size 0x54
      qt.core.plugin.elfparser: /home/ag/work/build/qt5/qtbase/plugins/platforms/libqxcb.so : section 29 name ".debug_info" type PROGBITS flags  offset 0x65e4 size 0x1b781
      qt.core.plugin.elfparser: /home/ag/work/build/qt5/qtbase/plugins/platforms/libqxcb.so : section 30 name ".debug_abbrev" type PROGBITS flags  offset 0x21d65 size 0x87b
      qt.core.plugin.elfparser: /home/ag/work/build/qt5/qtbase/plugins/platforms/libqxcb.so : section 31 name ".debug_line" type PROGBITS flags  offset 0x225e0 size 0x1631
      qt.core.plugin.elfparser: /home/ag/work/build/qt5/qtbase/plugins/platforms/libqxcb.so : section 32 name ".debug_str" type PROGBITS flags S offset 0x23c11 size 0x2682b
      qt.core.plugin.elfparser: /home/ag/work/build/qt5/qtbase/plugins/platforms/libqxcb.so : section 33 name ".debug_ranges" type PROGBITS flags  offset 0x4a43c size 0x2a0
      qt.core.plugin.elfparser: /home/ag/work/build/qt5/qtbase/plugins/platforms/libqxcb.so : section 34 name ".symtab" type SYMTAB flags  offset 0x4a6e0 size 0x1098
      qt.core.plugin.elfparser: /home/ag/work/build/qt5/qtbase/plugins/platforms/libqxcb.so : section 35 name ".strtab" type STRTAB flags  offset 0x4b778 size 0x1500
      qt.core.plugin.elfparser: /home/ag/work/build/qt5/qtbase/plugins/platforms/libqxcb.so : section 36 name ".shstrtab" type STRTAB flags  offset 0x4cc78 size 0x169
      Failed to find metadata in lib /home/ag/work/build/qt5/qtbase/plugins/platforms/libqxcb.so: '/home/ag/work/build/qt5/qtbase/plugins/platforms/libqxcb.so' is not a Qt plugin (metadata not found)
      "Failed to extract plugin meta data from '/home/ag/work/build/qt5/qtbase/plugins/platforms/libqxcb.so': '/home/ag/work/build/qt5/qtbase/plugins/platforms/libqxcb.so' is not a Qt plugin (metadata not found)" 
               not a plugin
      QFactoryLoader::QFactoryLoader() checking directory path "/home/ag/work/build/qt5/qtdeclarative/tests/auto/qml/qmltc/platforms" ...
      qt.qpa.plugin: Could not find the Qt platform plugin "xcb" in ""
      This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.
      

      It seems to me that we failed to find the '.qtmetadata' section which is a new-ish way to figure out whether a library is a plugin. Looks like there's no '.qtmetadata' sections for any of the files under qtbase/plugins/platforms/, which is probably why there's no plugin found => we fail to start the application.

      Roughly the same Qt configure but with gcc as a compiler seems to work fine, so I'd guess we fail to correctly do the preprocessor's #if-ery somewhere.

      Note: I do use also ASan when building with clang, but this hopefully shouldn't matter.

      Attachments

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

        Activity

          People

            thiago Thiago Macieira
            agolubev Andrei Golubev
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes