Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possible missing QtCore modules - Qt5 Compilation & Linkage errors #26

Closed
maxsteciuk opened this issue Oct 7, 2018 · 14 comments
Closed

Possible missing QtCore modules - Qt5 Compilation & Linkage errors #26

maxsteciuk opened this issue Oct 7, 2018 · 14 comments

Comments

Labels
None yet
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants
@maxsteciuk
Copy link
Contributor

@maxsteciuk maxsteciuk commented Oct 7, 2018

UPDATE
The following sequence of steps cures the linkage problem:

  1. Uncheck any Qt5 networking apps (falkon, telegram...) in trident-installer UI
  2. Proceed to finish installation of Trident
  3. Reboot
  4. pkg install falkon
  5. falkon
  6. Observe falkon starts up and no undefined symbol error thrown

P.S. 6 reboots and so far issue didn’t reappear. This is workaround, the root cause seems to be due to the installer using Qt5 WebEngine of v5.11 as necessary depedency for falkon while pkg install prompt shows its dependency is Qt5 WebEngine v5.9. This is version on TrueOS 18.03 where issue is not present.

Describe the bug

  1. Falkon, AppCafe failed to start up due to the runtime linkage problem whee linker complaied that one of QNetwork symbols was undefined

  2. For example when starting Falkon it fails with the following error
    /usr/local/lib/qt5/plugins/bearer/libqgenericbearer.so: Undefined symbol "_ZN17QNetworkInterfaceC1ERKS_@Qt_5"
    Although such the symbol and library do exist on the system strings /usr/local/lib/qt5/libQt5Network.so |grep _ZN17QNetworkInterfaceC1ERKS _ZN17QNetworkInterfaceC1ERKS_

  3. full output of ldd falkon

$ which falkon
/usr/local/bin/falkon
$ ldd /usr/local/bin/falkon
/usr/local/bin/falkon:
libFalkonPrivate.so.3 => /usr/local/lib/libFalkonPrivate.so.3 (0x80024c000)
libexecinfo.so.1 => /usr/lib/libexecinfo.so.1 (0x8005af000)
libQt5WebEngineWidgets.so.5 => /usr/local/lib/qt5/libQt5WebEngineWidgets.so.5 (0x8005b4000)
libQt5WebEngineCore.so.5 => /usr/local/lib/qt5/libQt5WebEngineCore.so.5 (0x800800000)
libQt5Positioning.so.5 => /usr/local/lib/qt5/libQt5Positioning.so.5 (0x805aad000)
libQt5Sql.so.5 => /usr/local/lib/qt5/libQt5Sql.so.5 (0x805b30000)
libQt5PrintSupport.so.5 => /usr/local/lib/qt5/libQt5PrintSupport.so.5 (0x805b6b000)
libQt5QuickWidgets.so.5 => /usr/local/lib/qt5/libQt5QuickWidgets.so.5 (0x805bdb000)
libQt5Widgets.so.5 => /usr/local/lib/qt5/libQt5Widgets.so.5 (0x805c00000)
libQt5Quick.so.5 => /usr/local/lib/qt5/libQt5Quick.so.5 (0x80624b000)
libQt5WebChannel.so.5 => /usr/local/lib/qt5/libQt5WebChannel.so.5 (0x8066ae000)
libQt5Qml.so.5 => /usr/local/lib/qt5/libQt5Qml.so.5 (0x8066cd000)
libQt5Network.so.5 => /usr/local/lib/qt5/libQt5Network.so.5 (0x806ac6000)
libxcb.so.1 => /usr/local/lib/libxcb.so.1 (0x806c3b000)
libQt5X11Extras.so.5 => /usr/local/lib/qt5/libQt5X11Extras.so.5 (0x8007f1000)
libQt5Gui.so.5 => /usr/local/lib/qt5/libQt5Gui.so.5 (0x806c64000)
libcrypto.so.111 => /lib/libcrypto.so.111 (0x807167000)
libQt5DBus.so.5 => /usr/local/lib/qt5/libQt5DBus.so.5 (0x807455000)
libQt5Core.so.5 => /usr/local/lib/qt5/libQt5Core.so.5 (0x807600000)
libc++.so.1 => /usr/lib/libc++.so.1 (0x8074d6000)
libcxxrt.so.1 => /lib/libcxxrt.so.1 (0x8075a5000)
libm.so.5 => /lib/libm.so.5 (0x8075c6000)
libc.so.7 => /lib/libc.so.7 (0x807af5000)
libelf.so.2 => /lib/libelf.so.2 (0x807f00000)
libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x807f1a000)
libthr.so.3 => /lib/libthr.so.3 (0x807f32000)
libkvm.so.7 => /lib/libkvm.so.7 (0x807f5d000)
libglib-2.0.so.0 => /usr/local/lib/libglib-2.0.so.0 (0x807f70000)
libnss3.so => /usr/local/lib/nss/libnss3.so (0x808089000)
libsmime3.so => /usr/local/lib/nss/libsmime3.so (0x8083b4000)
libnssutil3.so => /usr/local/lib/nss/libnssutil3.so (0x8085de000)
libnspr4.so => /usr/local/lib/libnspr4.so (0x80880e000)
libdl.so.1 => /usr/lib/libdl.so.1 (0x8007f7000)
libevent-2.1.so.6 => /usr/local/lib/libevent-2.1.so.6 (0x80884e000)
libX11.so.6 => /usr/local/lib/libX11.so.6 (0x8088a0000)
libX11-xcb.so.1 => /usr/local/lib/libX11-xcb.so.1 (0x8007fb000)
libXcursor.so.1 => /usr/local/lib/libXcursor.so.1 (0x805bef000)
libXext.so.6 => /usr/local/lib/libXext.so.6 (0x8089e1000)
libXi.so.6 => /usr/local/lib/libXi.so.6 (0x8089f5000)
libXrender.so.1 => /usr/local/lib/libXrender.so.1 (0x808a06000)
libXtst.so.6 => /usr/local/lib/libXtst.so.6 (0x8075f8000)
libXss.so.1 => /usr/local/lib/libXss.so.1 (0x808a12000)
libfontconfig.so.1 => /usr/local/lib/libfontconfig.so.1 (0x808a17000)
libfreetype.so.6 => /usr/local/lib/libfreetype.so.6 (0x808a61000)
libharfbuzz.so.0 => /usr/local/lib/libharfbuzz.so.0 (0x808b19000)
libpng16.so.16 => /usr/local/lib/libpng16.so.16 (0x808bd9000)
libjpeg.so.8 => /usr/local/lib/libjpeg.so.8 (0x808c16000)
libre2.so.0 => /usr/local/lib/libre2.so.0 (0x808cac000)
libavcodec.so.58 => /usr/local/lib/libavcodec.so.58 (0x808e00000)
libavformat.so.58 => /usr/local/lib/libavformat.so.58 (0x80a800000)
libavutil.so.56 => /usr/local/lib/libavutil.so.56 (0x80ac46000)
libopus.so.0 => /usr/local/lib/libopus.so.0 (0x808d09000)
libdbus-1.so.3 => /usr/local/lib/libdbus-1.so.3 (0x808d7a000)
libsnappy.so.1 => /usr/local/lib/libsnappy.so.1 (0x808dcc000)
libxml2.so.2 => /usr/local/lib/libxml2.so.2 (0x80aebe000)
libwebp.so.7 => /usr/local/lib/libwebp.so.7 (0x80a6ee000)
libwebpdemux.so.2 => /usr/local/lib/libwebpdemux.so.2 (0x808dd6000)
libxslt.so.1 => /usr/local/lib/libxslt.so.1 (0x80a780000)
libz.so.6 => /lib/libz.so.6 (0x808ddc000)
libXau.so.6 => /usr/local/lib/libXau.so.6 (0x808df6000)
libXdmcp.so.6 => /usr/local/lib/libXdmcp.so.6 (0x80a7be000)
libGL.so.1 => /usr/local/lib/libGL.so.1 (0x80b054000)
libprocstat.so.1 => /usr/lib/libprocstat.so.1 (0x80a7c5000)
libicui18n.so.63 => /usr/local/lib/libicui18n.so.63 (0x80b0e3000)
libicuuc.so.63 => /usr/local/lib/libicuuc.so.63 (0x80b3ee000)
libpcre2-16.so.0 => /usr/local/lib/libpcre2-16.so.0 (0x80b5d3000)
libiconv.so.2 => /usr/local/lib/libiconv.so.2 (0x80b66c000)
libpcre.so.1 => /usr/local/lib/libpcre.so.1 (0x80b76a000)
libintl.so.8 => /usr/local/lib/libintl.so.8 (0x80a7d3000)
libplc4.so => /usr/local/lib/libplc4.so (0x80a7e0000)
libplds4.so => /usr/local/lib/libplds4.so (0x80a7e7000)
libXfixes.so.3 => /usr/local/lib/libXfixes.so.3 (0x80a7ed000)
libexpat.so.1 => /usr/local/lib/libexpat.so.1 (0x80b80c000)
libbz2.so.4 => /usr/lib/libbz2.so.4 (0x80b837000)
libgraphite2.so.3 => /usr/local/lib/libgraphite2.so.3 (0x80b84c000)
libswresample.so.3 => /usr/local/lib/libswresample.so.3 (0x80b877000)
libvpx.so.5 => /usr/local/lib/libvpx.so.5 (0x80ba96000)
libwebpmux.so.3 => /usr/local/lib/libwebpmux.so.3 (0x80bc93000)
liblzma.so.5 => /usr/lib/liblzma.so.5 (0x80bca0000)
libfdk-aac.so.1 => /usr/local/lib/libfdk-aac.so.1 (0x80bccb000)
libmp3lame.so.0 => /usr/local/lib/libmp3lame.so.0 (0x80bdbd000)
libtheoraenc.so.1 => /usr/local/lib/libtheoraenc.so.1 (0x80be40000)
libtheoradec.so.1 => /usr/local/lib/libtheoradec.so.1 (0x80be72000)
libvorbis.so.0 => /usr/local/lib/libvorbis.so.0 (0x80be85000)
libvorbisenc.so.2 => /usr/local/lib/libvorbisenc.so.2 (0x80bebb000)
libx264.so.155 => /usr/local/lib/libx264.so.155 (0x80bf5f000)
libx265.so.160 => /usr/local/lib/libx265.so.160 (0x80c24a000)
libxvidcore.so.4 => /usr/local/lib/libxvidcore.so.4 (0x80c78f000)
libva.so.2 => /usr/local/lib/libva.so.2 (0x80c8bb000)
libgmp.so.10 => /usr/local/lib/libgmp.so.10 (0x80c8e3000)
libgnutls.so.30 => /usr/local/lib/libgnutls.so.30 (0x80c966000)
libva-drm.so.2 => /usr/local/lib/libva-drm.so.2 (0x808dfb000)
libva-x11.so.2 => /usr/local/lib/libva-x11.so.2 (0x80a7f5000)
libvdpau.so.1 => /usr/local/lib/libvdpau.so.1 (0x80cade000)
libxcb-dri3.so.0 => /usr/local/lib/libxcb-dri3.so.0 (0x80cae5000)
libxcb-xfixes.so.0 => /usr/local/lib/libxcb-xfixes.so.0 (0x80caea000)
libxcb-present.so.0 => /usr/local/lib/libxcb-present.so.0 (0x80caf2000)
libxcb-sync.so.1 => /usr/local/lib/libxcb-sync.so.1 (0x80caf7000)
libxshmfence.so.1 => /usr/local/lib/libxshmfence.so.1 (0x80cafe000)
libglapi.so.0 => /usr/local/lib/libglapi.so.0 (0x80cb02000)
libXdamage.so.1 => /usr/local/lib/libXdamage.so.1 (0x80cb5e000)
libxcb-glx.so.0 => /usr/local/lib/libxcb-glx.so.0 (0x80cb63000)
libxcb-dri2.so.0 => /usr/local/lib/libxcb-dri2.so.0 (0x80cb7e000)
libXxf86vm.so.1 => /usr/local/lib/libXxf86vm.so.1 (0x80cb84000)
libdrm.so.2 => /usr/local/lib/libdrm.so.2 (0x80cb8c000)
libutil.so.9 => /lib/libutil.so.9 (0x80cba2000)
libicudata.so.63 => /usr/local/lib/libicudata.so.63 (0x805bfd000)
libogg.so.0 => /usr/local/lib/libogg.so.0 (0x80cbb9000)
libmd.so.6 => /lib/libmd.so.6 (0x80cbc1000)
librt.so.1 => /usr/lib/librt.so.1 (0x80cbde000)
libp11-kit.so.0 => /usr/local/lib/libp11-kit.so.0 (0x80cbe6000)
libunistring.so.2 => /usr/local/lib/libunistring.so.2 (0x80cd0a000)
libtasn1.so.6 => /usr/local/lib/libtasn1.so.6 (0x80cebf000)
libnettle.so.6 => /usr/local/lib/libnettle.so.6 (0x80ced6000)
libhogweed.so.4 => /usr/local/lib/libhogweed.so.4 (0x80cf11000)
libidn2.so.0 => /usr/local/lib/libidn2.so.0 (0x80cf47000)
libffi.so.6 => /usr/local/lib/libffi.so.6 (0x80cf69000)

  1. plugins/bearer ldd output

$ ldd /usr/local/lib/qt5/plugins/bearer/libqgenericbearer.so
/usr/local/lib/qt5/plugins/bearer/libqgenericbearer.so:
libQt5Network.so.5 => /usr/local/lib/qt5/libQt5Network.so.5 (0x800e00000)
libQt5Core.so.5 => /usr/local/lib/qt5/libQt5Core.so.5 (0x801000000)
libc++.so.1 => /usr/lib/libc++.so.1 (0x800690000)
libcxxrt.so.1 => /lib/libcxxrt.so.1 (0x80075f000)
libthr.so.3 => /lib/libthr.so.3 (0x800780000)
libc.so.7 => /lib/libc.so.7 (0x800248000)
libz.so.6 => /lib/libz.so.6 (0x8007ab000)
libkvm.so.7 => /lib/libkvm.so.7 (0x8007c5000)
libprocstat.so.1 => /usr/lib/libprocstat.so.1 (0x8007d8000)
libexecinfo.so.1 => /usr/lib/libexecinfo.so.1 (0x8007e6000)
libm.so.5 => /lib/libm.so.5 (0x800f75000)
libicui18n.so.63 => /usr/local/lib/libicui18n.so.63 (0x8014f5000)
libicuuc.so.63 => /usr/local/lib/libicuuc.so.63 (0x801800000)
libpcre2-16.so.0 => /usr/local/lib/libpcre2-16.so.0 (0x8019e5000)
libglib-2.0.so.0 => /usr/local/lib/libglib-2.0.so.0 (0x801a7e000)
libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x800fa7000)
libelf.so.2 => /lib/libelf.so.2 (0x800fbf000)
libutil.so.9 => /lib/libutil.so.9 (0x800fd9000)
libicudata.so.63 => /usr/local/lib/libicudata.so.63 (0x8007eb000)
libiconv.so.2 => /usr/local/lib/libiconv.so.2 (0x801b97000)
libpcre.so.1 => /usr/local/lib/libpcre.so.1 (0x801c95000)
libintl.so.8 => /usr/local/lib/libintl.so.8 (0x8007ed000)

  1. Error on statup:

$ falkon
ld-elf.so.1: /usr/local/lib/qt5/plugins/bearer/libqgenericbearer.so: Undefined symbol "ZN17QNetworkInterfaceC1ERKS@Qt_5"

  1. SHA256 hash of falkon binary

$ sha256 /usr/local/bin/falkon
SHA256 (/usr/local/bin/falkon) = 1f0686579fc7cea610b5688a5e6b6bdbafe654af3932ebdaf054ce9857bae4c2

This started happening after reboot.

To Reproduce
UPDATE
The following sequence of steps cures the linkage problem:

  1. Uncheck any Qt5 networking apps (falkon, telegram...) in trident-installer UI
  2. Proceed to finish installation of Trident
  3. Reboot
  4. pkg install falkon
  5. falkon
  6. Observe falkon starts up and no undefined symbol error thrown

P.S. 6 reboots and so far issue didn’t reappear. This is workaround, the root cause seems to be due to the installer using Qt5 WebEngine of v5.11 as necessary depedency for falkon while pkg install prompt shows its dependency is Qt5 WebEngine v5.9. This is version on TrueOS 18.03 where issue is not present.


Steps to reproduce the behavior:

  1. Boot Trident
  2. Start Falkon, Telegram desktop app or any other Qt5 app from terminal
  3. Check terminal output for errors described above

Expected behavior
Qt5 apps start successfully

Screenshots
N/A

OS Version:
Trident RC 1

Additional context
N/A

UPDATE 2018-10-08

  1. Rebuild of Qt5 libraries including net/qt5-network, trueos-update did not help to resolve the issue
  2. When building net/qt5-network I found the following log strip --strip-unneeded /usr/ports/net/qt5-network/work/stage/usr/local/lib/qt5/plugins/bearer/libqgenericbearer.so
    3.After removal of qt5/plugins/bearer (backing up to qt5/plugins/bearer.20181008) AppCafe, Falkon, started up. However Falkon then immediately crashed with the following on the first interaction

`Qt version: 5.11.1 (compiled with 5.11.1)
Falkon version: 3.0.0
Rendering engine: QtWebEngine

============== BACKTRACE ==============
#0: 0x20442f <???> at /usr/local/bin/falkon
#1: 0x807e30166 <pthread_sigmask+0x536> at /lib/libthr.so.3`

@beanpole135
Copy link
Member

@beanpole135 beanpole135 commented Oct 19, 2018

WARNING
Rebuilding system libraries like Qt from ports will cause the linking issues that you mention because it will be out-of-sync with the rest of the packages/binaries that you have installed on the system. If you want to rebuild something like Qt manually (or from ports), then you will have to rebuild almost every single package that you have installed on the system to ensure they are all "in-sync".


The real problem that started this whole mess is the qconfig-modules.h include file.
The qt5-core package is supposed to dynamically create that file during the post-installation step of the package install, but for some reason during the initial system installation all the post-installation steps by pkg are getting ignored for some reason. This appears to be a problem with either pkg or TrueOS STABLE 18.06 (pc-sysinstall component), and I still looking into a way to mitigate/fix this upstream.

In the meantime, if you need to work around this issue so you can compile Qt apps locally then you can run pkg install -f -g "qt5-*" to forcibly re-install all the qt5- packages directly on the local system (where the post-install steps will run properly).
That will ensure that the include files are all properly generated for you as well as keep your libraries "in-sync" with all the rest of the system packages.

@RodMyers
Copy link

@RodMyers RodMyers commented Nov 11, 2018

Have you attempted to us RC3?

@maxsteciuk
Copy link
Contributor Author

@maxsteciuk maxsteciuk commented Nov 18, 2018

  1. qconfig-modules.h for Qt5 app build is in place for RC3 build

Nov 17 19:28 /usr/local/include/qt5/QtCore/qconfig-modules.h

  1. Fresh install of RC3 build still yields the Qt5 linkage error on the very first startup (e.g. falkon). trueos-update, pkg install -f -g "qt5-*" don't resolve this.

ld-elf.so.1: /usr/local/lib/qt5/plugins/bearer/libqgenericbearer.so: Undefined symbol "ZN17QNetworkInterfaceC1ERKS@Qt_5"

@maxsteciuk
Copy link
Contributor Author

@maxsteciuk maxsteciuk commented Nov 21, 2018

Digging further and taking into account that the linker is consistently complaining about the same undefined symbol i.e. QNetworkInterface I see there is some macro logic associate with this class. Hopefully this provides some additional pointers...

The macro associated with the class is Q_NETWORK_EXPORT
It is defined based on conditional as follows (http://doc.qt.io/qt-5/sharedlibrary.html)

Q_DECL_EXPORT must be added to the declarations of symbols used when compiling a shared library.
Q_DECL_IMPORT must be added to the declarations of symbols used when compiling a client that uses the shared library.

Snippet of suspected class from qnetworkinterface.h header:

class Q_NETWORK_EXPORT QNetworkInterface
{
Q_GADGET
public:
...
...
...
QNetworkInterface();

@maxsteciuk
Copy link
Contributor Author

@maxsteciuk maxsteciuk commented Nov 21, 2018

QNetworkInterfarce is used by the following plugin qtbase-everywhere-src-5.11.2/src/plugins/bearer/generic/qgenericengine.cpp but under an interesting macro condition

#ifndef QT_NO_NETWORKINTERFACE

So maybe this is related how the port is built and packaged, on some Makefile option?

@q5sys
Copy link
Member

@q5sys q5sys commented Nov 21, 2018

What is your build system?

@maxsteciuk
Copy link
Contributor Author

@maxsteciuk maxsteciuk commented Nov 21, 2018

This happens on ISO downloaded from project-trident.org

@q5sys
Copy link
Member

@q5sys q5sys commented Nov 22, 2018

@q5sys
Copy link
Member

@q5sys q5sys commented Nov 24, 2018

2 Questions. A) Have you tried Ken's advice of pkg install -f -g "qt5-*" on RC3?
I can confirm that qnetworkinterface.h is being built.
B) Since no one else has reported these errors, this leads me to believe that there is something different with your system. Are you having these issues from a Fresh install?

@maxsteciuk
Copy link
Contributor Author

@maxsteciuk maxsteciuk commented Nov 24, 2018

  1. Yes, I did that on RC3 and my latest status was after trying it.
  2. Yes, fresh clean install. Latest status on 11/23 pre-release it happened on the very first reboot to desktop

@maxsteciuk
Copy link
Contributor Author

@maxsteciuk maxsteciuk commented Nov 24, 2018

UPDATE
The following sequence of steps cures the linkage problem:

  1. Uncheck any Qt5 networking apps (falkon, telegram...) in trident-installer UI
  2. Proceed to finish installation of Trident
  3. Reboot
  4. pkg install falkon
  5. falkon
  6. Observe falkon starts up and no undefined symbol error thrown

P.S. 6 reboots and so far issue didn’t reappear. This is workaround, the root cause seems to be due to the installer using Qt5 WebEngine of v5.11 as necessary depedency for falkon while pkg install prompt shows its dependency is Qt5 WebEngine v5.9. This is version on TrueOS 18.03 where issue is not present.

@maxsteciuk
Copy link
Contributor Author

@maxsteciuk maxsteciuk commented Nov 25, 2018

UPDATE 2

Issue is still present. As per the chat it happens when I add my vlan ifconfig entries in rc.conf

@maxsteciuk
Copy link
Contributor Author

@maxsteciuk maxsteciuk commented Nov 25, 2018

UPDATE 3

The workaround for the linkgage issue while having my VLAN configs in rc.conf is to build qt5-network/plugins/bearer with -DQT_NO_NETWORKINTERFACE option

I submitted this patch which made the issue disappear as a pull request here https://github.com/trueos/trueos-

@beanpole135
Copy link
Member

@beanpole135 beanpole135 commented Jan 2, 2019

Patch appears to have been accepted into FreeBSD/TrueOS. Closing this issue.

@beanpole135 beanpole135 closed this Jan 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment