Summary: | textproc/kf5-syntax-highlighting: does not build on systems with VLAN interfaces | ||
---|---|---|---|
Product: | Ports & Packages | Reporter: | Ting-Wei Lan <lantw44> |
Component: | Individual Port(s) | Assignee: | freebsd-kde (group) <kde> |
Status: | Closed FIXED | ||
Severity: | Affects Only Me | CC: | adridg, freebsd, nbe, riccp, swills, yan.batuto, zarychtam |
Priority: | --- | Flags: | bugzilla:
maintainer-feedback?
(kde) |
Version: | Latest | ||
Hardware: | amd64 | ||
OS: | Any |
Description
Ting-Wei Lan
2018-09-16 15:43:34 UTC
The vlans seem like a red herring to me (unless networking is loading genericbearer based on the presence of vlans .. which seems really peculiar). However, kf5-syntax-highlighting *should not* depend on xmlpatterns and should not change its build based on its presence. So there's some configuration that needs wrangling there at the very least. kf5-syntax-highlighting prints these messages at the end of configure phase: -- The following OPTIONAL packages have been found: * Qt5Widgets Example application. * Qt5XmlPatterns Compile-time validation of syntax definition files. libqgenericbearer.so is always loaded and _ZN17QNetworkInterfaceC1ERKS_ is always called when katehighlightingindexer is linked to qt5-xmlpatterns. When there is no VLAN interface, the hash value isn't modified and the symbol can be found successfully. When I set a breakpoint on _ZN17QNetworkInterfaceC1ERKS_, it hits multiple times before it exits. When there is a VLAN interface, the hash value is modified and the symbol cannot be found. I set breakpoints on both _ZN17QNetworkInterfaceC1ERKS_@plt in libqgenericbearer.so and _ZN17QNetworkInterfaceC1ERKS_ in libQt5Network.so.5. Only the PLT one is hit because _rtld_bind calls rtld_die, which causes the program to exit early. Yes, I have the same issue. Vlans are configured and kf5-syntax-highlighting does not build. (In reply to Yan Batyuto from comment #3) I've seen something similar (but with lumina and telegram-desktop). Using VLANs I get: # telegram-desktop Got keys from plugin meta data ("generic") QFactoryLoader::QFactoryLoader() checking directory path "/usr/local/bin/bearer" ... loaded library "/usr/local/lib/qt5/plugins/bearer/libqgenericbearer.so" /usr/local/lib/qt5/plugins/bearer/libqgenericbearer.so: Undefined symbol "_ZN17QNetworkInterfaceC1ERKS_@Qt_5" # start-lumina-desktop ..... [Lumina] Checking User Files - Old Version: "1.4.1" - Current Version: "1.4.1" - Made Changes: false Finished with user files check QFactoryLoader::QFactoryLoader() checking directory path "/usr/local/lib/qt5/plugins/accessiblebridge" ... QFactoryLoader::QFactoryLoader() checking directory path "/usr/local/bin/accessiblebridge" ... qt.qpa.xcb: QXcbConnection: XCB error: 148 (Unknown), sequence: 206, resource id: 0, major code: 140 (Unknown), minor code: 20 Got Desktop Process Finished: 1 Finished Closing Down Lumina QLibraryPrivate::unload succeeded on "/usr/local/lib/qt5/plugins/platforminputcontexts/libcomposeplatforminputcontextplugin.so" QLibraryPrivate::unload succeeded on "/usr/local/lib/qt5/plugins/xcbglintegrations/libqxcb-glx-integration.so" QLibraryPrivate::unload succeeded on "/usr/local/lib/qt5/plugins/platforms/libqxcb.so" QLibraryPrivate::unload succeeded on "Xcursor" # lumina-desktop (just to see the qt5_debug_plugins) Got keys from plugin meta data ("generic") QFactoryLoader::QFactoryLoader() checking directory path "/usr/local/bin/bearer" ... loaded library "/usr/local/lib/qt5/plugins/bearer/libqgenericbearer.so" /usr/local/lib/qt5/plugins/bearer/libqgenericbearer.so: Undefined symbol "_ZN17QNetworkInterfaceC1ERKS_@Qt_5" Exit 1 If I destroy the vlans everything works. (In reply to Ricardo from comment #4) Forgot to mention, it's a stable/11 (FreeBSD 11.2-STABLE #2 r338902) We can "workaround" with kf5-syntax-highlighting by blocking Qt5Network, which will turn of some build-time schema-validation. That's build-time validation that happens elsewhere anyway, so it doesn't really buy us anything but extra dependencies and build time. This will get it to build again. *But* the bigger issue is that underneath, in Qt5Networking, there's a problem with VLANs on FreeBSD. That is what actually needs to be sorted out. *** Bug 231999 has been marked as a duplicate of this bug. *** Any Qt5 application with networking (e.g. quassel, kmail, falkon ...) can be crashed by creating a vlan while the application is running; once there's a vlan the application no longer starts. It all comes down to the missing symbols / mismatched symbols as Ting-Wei Lan has described. I've started doing *some* debugging, but it's a giant pain in the butt and I don't understand the symbol versioning very well. readelf(1) tells me there are @@Qt_5 symbols and @Qt_5 symbols (one @ or two) and that *seems* to be related. *** Bug 232318 has been marked as a duplicate of this bug. *** (In reply to Adriaan de Groot from comment #8) Note that there is no missing or mismatched symbols here. Both libraries are built correctly and symbols should be successfully resolved. It is the memory corruption issue that overwrites the data of the runtime linker, causing it to reject the symbol early before comparing strings. If I understand correctly, both @ and @@ are used to denote the version tag. In addition, @@ means it is the default version and the build time linker should choose it if object files don't specify a version. Therefore, undefined @Qt_5 symbol should be resolved to the @@Qt_5 at runtime if there is no memory issue and it is the case when there is no VLAN interface on the system. Ting-Wei Lan, could you file a bug against ld, then? This isn't going to get fixed by us staring at the code of Qt5Network. A commit references this bug: Author: adridg Date: Thu Oct 18 12:19:58 UTC 2018 New revision: 482342 URL: https://svnweb.freebsd.org/changeset/ports/482342 Log: Workaround textprof/kf5-syntax-hightlighting build failure. (library) Qt5Network crashes in the presence of VLANs. This terminates the build when the host build process runs applications that touch the network -- which happens during schema validation, which is done if the host has XmlPatters installed. Workaround by ignoring XmlPatterns. Underlying problem (Qt5Network and VLANs) has not been addressed. PR: 231402 Reported by: Ting-Wei Lan Changes: head/textproc/kf5-syntax-highlighting/Makefile (In reply to commit-hook from comment #12) It doesn't look like an issue of ld or rtld to me. Both ld and rtld do the right thing, and it is an ioctl call on a socket file descriptor that modifies the internal data structure of rtld. I still believe the problem is in Qt5Network itself, but I haven't spent time debugging the issue further. A **workaround** is to add QT_EXCLUDE_GENERIC_BEARER=1 to your environment. *** Bug 233798 has been marked as a duplicate of this bug. *** I've been debug-chasing this for a few days in an 11.2 VM. The goal is to allow genericbearer to load -- that is, the environment-variable workaround should not be necessary. As Ting-Wei Lan pointed out originally, everything looks like memory corruption **somewhere**. - removing the call to get the interfaceFromIndex(0) fixes the problem - I found a spot in QNetworkInterface where adding qWarning() << "foo" fixes the problem When build WITH_DEBUG=yes I get crashes (SEGV), rather than unresolved symbols: more hint that it's memory corruption. In any case: *because* this is corrupting memory from a Qt-internal method that is listing network interfaces, I would like to fix the root cause rather than working around things. *** Bug 232318 has been marked as a duplicate of this bug. *** A commit references this bug: Author: adridg Date: Mon Dec 24 16:46:18 UTC 2018 New revision: 488276 URL: https://svnweb.freebsd.org/changeset/ports/488276 Log: Fix net/qt5-network in the face of VLANs. Adding a VLAN to a FreeBSD system caused memory corruption -- usually enough to make rtld fall over with symbol resolution errors, although in DEBUG builds it would just crash. Revamp network interface discovery to not be full of memory gotcha's. An explanation is included in the patches. While here, "make makesum" has moved some files around. PR: 231402, 233798, 232318 Reported by: Ting-Wei Lan, Nils Beyer, Marek Zarychta Changes: head/net/qt5-network/Makefile head/net/qt5-network/files/patch-qsslcontext_openssl.cpp head/net/qt5-network/files/patch-src_network_kernel_qnetworkinterface__unix.cpp head/net/qt5-network/files/patch-src_network_socket_qnet__unix__p.h head/net/qt5-network/files/patch-src_network_socket_qnet_unix_p.h head/net/qt5-network/files/patch-src_network_ssl_qsslcontext__openssl.cpp head/net/qt5-network/files/patch-src_plugins_bearer_generic_qgenericengine.cpp |