Trident: Qt5 Network library linkage issue


#1

Hello Guys

It has been some time since I have hit and have been able to consistently reproduce the issue with fresh clean (clean disk) installtion of Trident from downloaded ISO when attempting to start up Qt5 apps such as falkon, telegram-dekstop, etc…

The issue consistently appears to be related to dynamic linker unable to resolve the same QNetworkInterface symbol in the plugins/bearer module. The issue occurs kind of randomly: after the latest installation it ocurred on the first reboot, before that it occurred on the 3rd reboot.

Has anyone else encountered such issue?

Please find more details at the following Github URL: https://github.com/project-trident/trident-core/issues/26

Thanks,
Max


#2

Have you tried running ldconfig as root after the install to rebuild the library hints? Perhaps an ordering thing is going on and depending on what is run first you hit it or you don’t. If that helps then it implies that a post install script in pkg may not be getting run after installing the plugins package.


#3

I tried running ldconfig which resulted in a bunch of low-level libraries not being found (e.g. glib, nss, intl…). They were resolved at the startup though.

When invoking dry run I see the following (qt5/plugins is not on the search directories list):
/var/run/ld-elf.so.hints:

    search directories: /lib:/usr/lib:/usr/lib/compat:/usr/local/lib:/usr/local/lib/graphviz:/usr/local/lib/nss:/usr/local/lib/perl5/5.26/mach/CORE:/usr/local/lib/qt5:/usr/local/llvm60/lib:/usr/local/share/chromium

falkon ld-elf.so.1: /usr/local/lib/qt5/plugins/bearer/libqgenericbearer.so: Undefined symbol "_ZN17QNetworkInterfaceC1ERKS_@Qt_5" ldd /usr/local/bin/falkon |grep glib
libglib-2.0.so.0 => /usr/local/lib/libglib-2.0.so.0 (0x807f70000)
sudo ldconfig -v Password: falkon
ld-elf.so.1: Shared object “libglib-2.0.so.0” not found, required by “libQt5WebEngineCore.so.5”
$ sudo
ld-elf.so.1: Shared object “libintl.so.8” not found, required by “sudo”

I see the following hints file used

ldconfig ldconfig: mkstemp(/var/run/ld-elf.so.hints.2e0q6I): Permission denied ls -lrt /var/run/ld-elf*
-r–r--r-- 1 root wheel 139 Nov 24 11:09 /var/run/ld-elf32.so.hints
-r–r--r-- 1 root wheel 129 Nov 24 11:15 /var/run/ld-elf.so.hints

On TrueOS 18.03 (for reference where issue does not appear) I see there is a single hints file, no ld-elf32.so.hints.

$ ls -lrt /var/run/ld-elf.so.hints
-r–r--r-- 1 root wheel 492 Nov 22 21:44 /var/run/ld-elf.so.hints

libmap.conf appears to include the non-existing directory

less /etc/libmap.conf

FreeBSD

includedir /usr/local/etc/libmap.d

$ ls -lrt /usr/local/etc/libmap.d
ls: /usr/local/etc/libmap.d: No such file or directory

Thanks,
Max


#4

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.


#5

UPDATE #2

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

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-ports/pull/65


#6

UPDATE #4

Now falkon proceeds a bit further and crashes with SIGBUS in QWebEngine module.
GDB backtrace:

Program terminated with signal SIGBUS, Bus error.
#0 0x00000008006cc534 in QWebEnginePage::view() const () from /usr/local/lib/qt5/libQt5WebEngineWidgets.so.5
[Current thread is 1 (LWP 100506)]
(gdb) bt
#0 0x00000008006cc534 in QWebEnginePage::view() const () from /usr/local/lib/qt5/libQt5WebEngineWidgets.so.5
#1 0x0000000800604155 in WebPage::view() const () from /usr/local/lib/libFalkonPrivate.so.3

Error log:

[8808:215035904:1201/165511.350327:ERROR:broker_posix.cc(41)] Invalid node channel message
[8789:215035904:1201/165511.350477:ERROR:broker_posix.cc(41)] Invalid node channel message

Suspicious reference of Core (v5.11) from WebEngine (v5.9)

usr/local/lib/qt5/libQt5WebEngine.so:
libQt5WebEngineCore.so.5 => /usr/local/lib/qt5/libQt5WebEngineCore.so.5 (0x801200000)
libQt5Quick.so.5 => /usr/local/lib/qt5/libQt5Quick.so.5 (0x8064ad000)
libQt5Gui.so.5 => /usr/local/lib/qt5/libQt5Gui.so.5 (0x806910000)
libQt5WebChannel.so.5 => /usr/local/lib/qt5/libQt5WebChannel.so.5 (0x800689000)
libQt5Qml.so.5 => /usr/local/lib/qt5/libQt5Qml.so.5 (0x806e13000)
libQt5Core.so.5 => /usr/local/lib/qt5/libQt5Core.so.5 (0x807400000)
libQt5Network.so.5 => /usr/local/lib/qt5/libQt5Network.so.5 (0x8078f5000)
libQt5Positioning.so.5 => /usr/local/lib/qt5/libQt5Positioning.so.5 (0x80105e000)

On Trident mix of 5.9 and 5.11 dynamic libraries (issue is present)

"lrwxr-xr-x 1 root wheel 20 Nov 28 17:26 /usr/local/lib/qt5//libQt5Core.so -> libQt5Core.so.5.11.2
ls -lrt /usr/local/lib/qt5//libQt5WebEngine.so lrwxr-xr-x 1 root wheel 24 Nov 29 02:57 /usr/local/lib/qt5//libQt5WebEngine.so -> libQt5WebEngine.so.5.9.5 ls -lrt /usr/local/lib/qt5//libQt5WebEngineCore.so
lrwxr-xr-x 1 root wheel 28 Nov 29 02:57 /usr/local/lib/qt5//libQt5WebEngineCore.so -> libQt5WebEngineCore.so.5.9.5
"

On TrueOS 18.03 dynamic libraries are of same version ( no issue observed)

lrwxr-xr-x 1 root wheel 28 Mar 23 2018 /usr/local/lib/qt5/libQt5WebEngineCore.so -> libQt5WebEngineCore.so.5.9.4
[max@trueden ~/Desktop]$ ls -lrt /usr/local/lib/qt5/libQt5Core.so
lrwxr-xr-x 1 root wheel 19 Mar 8 2018 /usr/local/lib/qt5/libQt5Core.so -> libQt5Core.so.5.9.4"

NOTE
This happened when restoring previously closed browser session