Bug 25038 - Qt applications using a different Qt than system one are broken, remove QT_PLUGIN_PATH from system-wide environment variables
Summary: Qt applications using a different Qt than system one are broken, remove QT_PL...
Status: RESOLVED FIXED
Alias: None
Product: Mageia
Classification: Unclassified
Component: RPM Packages (show other bugs)
Version: Cauldron
Hardware: All Linux
Priority: release_blocker critical
Target Milestone: Mageia 8
Assignee: David GEIGER
QA Contact:
URL:
Whiteboard: MGA7TOO
Keywords:
: 26112 (view as bug list)
Depends on:
Blocks:
 
Reported: 2019-07-03 20:34 CEST by Timothée Giet
Modified: 2021-01-09 11:33 CET (History)
5 users (show)

See Also:
Source RPM: qtbase5-5.12.6-1.mga7.src.rpm
CVE:
Status comment:


Attachments

Description Timothée Giet 2019-07-03 20:34:52 CEST
Description of problem:

This problem was noticed while trying to run some krita appimages (4.2.2 and later). 

It crashes with this error:

"./krita-4.2.2-x86_64.appimage: relocation error: /lib64/libQt5XcbQpa.so.5: symbol _ZN14QWindowPrivate17screenForGeometryERK5QRect version Qt_5_PRIVATE_API not defined in file libQt5Gui.so.5 with link time reference"

I didn't notice that with previous appimages as they used the same Qt version (or at least somehow a luckily compatible one)

As the Krita maintainer explained to me, the issue is that QT_PLUGIN_PATH is set system-wide in mageia, which should explicitly not be done. See on https://doc.qt.io/qt-5/deployment-plugins.html :
"Note: QT_PLUGIN_PATH should not be exported as a system-wide environment variable since it can interfere with other Qt installations."

And indeed, we do have the guilty "set QT_PLUGIN_PATH" lines in /etc/profile.d/60qt5.sh and /etc/profile.d/60qt5.csh , which should really not be needed.


How reproducible:

100% reporducible

Steps to Reproduce:
1.download https://download.kde.org/stable/krita/4.2.2/krita-4.2.2-x86_64.appimage , set it executable and try to run it from a terminal, it crashes with the message described above.
2.do "unset QT_PLUGIN_PATH" in a terminal, then run the appimage from it: it works.
Comment 1 Lewis Smith 2019-07-03 22:51:13 CEST
@Timothée
Thank you for your researched, thorough & helpful report.

Assigning initially to neoclust as the Qt maintainer.

CC: (none) => lewyssmith
Assignee: bugsquad => mageia

Comment 2 Alejandro Vargas 2020-01-21 09:21:22 CET
Problem stills there. 

From https://doc.qt.io/qt-5/deployment-plugins.html

**Note: Do not export QT_PLUGIN_PATH as a system-wide environment variable because it can interfere with other Qt installations.**

CC: (none) => alejandro.anv

Comment 3 Lewis Smith 2020-01-21 21:28:59 CET
https://bugs.mageia.org/show_bug.cgi?id=26112#c0
duplicates this complaint - the comment above:
Alejandro Vargas 2020-01-21 09:38:14 CET
In files /etc/profile.d/60qt5.csh and /etc/profile.d/60qt5.sh please remove QT_PLUGIN_PATH
This is a bug that prevents programs using different version of QT to run (like appimages). 
See https://doc.qt.io/qt-5/deployment-plugins.html that says:
Note: Do not export QT_PLUGIN_PATH as a system-wide environment variable because it can interfere with other Qt installations.
----------
Both files come from pkg qtbase5-common, in qtbase5-5.12.6-1.mga7.src.rpm
This problem clearly matters, and appears easy to fix.

Assigning to DavidG as the active maintainer; CC'ing Nicolas for his view.

Source RPM: qtbase5-5.12.2-2.mga7.src.rpm => qtbase5-5.12.6-1.mga7.src.rpm
CC: lewyssmith => mageia
Summary: Qt applications using a different Qt than system one are broken => Qt applications using a different Qt than system one are broken, remove QT_PLUGIN_PATH from system-wide environment variables
Assignee: mageia => geiger.david68210

Comment 4 Lewis Smith 2020-01-21 21:34:06 CET
*** Bug 26112 has been marked as a duplicate of this bug. ***
Comment 5 Rémi Verschelde 2020-02-23 22:20:54 CET
I ran into this with RPCS3 too: https://github.com/RPCS3/rpcs3/issues/6986

While debugging we came to the same conclusions, and a bug report was filed upstream with AppImage: https://github.com/probonopd/linuxdeployqt/issues/416

I think it could possibly be mitigated in AppImage (e.g. by forcefully unsetting QT_PLUGIN_PATH), but we seem to be the odd ones out with this environment variable so we should review whether we really need it.

As Alejandro pointed out, the Qt 5 docs explicitly say that this should not be done.
Comment 6 papoteur 2020-11-04 20:02:03 CET
Hello,
Same problem with Zoom which seems to be an AppImage.
The variable QT_PLUGIN_PATH is defined in the spec file:
http://svnweb.mageia.org/packages/cauldron/qtbase5/current/SPECS/qtbase5.spec?view=markup#l1833
Could this part be deleted ?
# Set the QT_PLUGIN_PATH environment variable
if [ -z \$(echo \$QT_PLUGIN_PATH | grep "kcms") ]; then
 QT_PLUGIN_PATH="%{_qt5_plugindir}:%{_qt5_plugindir}/kcms:\$QT_PLUGIN_PATH"
 export QT_PLUGIN_PATH
fi

see also bug 18209 bug 17891 bug 16765

CC: (none) => yves.brungard_mageia

Comment 7 w unruh 2020-12-10 05:36:36 CET
This definitely is  a problem with Zoom, the conferencing program, and the most recent (5.4.xx) versions. zoom crashes with a segfault when it starts. Using
(unset QT_PLUGIN_PATH; zoom ) fixes the problem. So, QT_PLUGIN_PATH should not be set in the first place. This is in Mageia 7.1 (and it is 4 months since this was first reported). Because Zoom is so crucial to both remote work and sanity during this time of Covid, breaking people's lifeline is not a good idea.

CC: (none) => unruh

Rémi Verschelde 2020-12-27 21:49:24 CET

Severity: normal => critical
Priority: Normal => High

Comment 8 Rémi Verschelde 2020-12-27 22:03:04 CET
Increasing to release blocker as discussed with neoclust.

Priority: High => release_blocker

Comment 9 Morgan Leijström 2020-12-28 15:21:56 CET
So in Cauldron too.

Target Milestone: --- => Mageia 8
CC: (none) => fri
Whiteboard: (none) => MGA7TOO
Version: 7 => Cauldron

Comment 10 Nicolas Lécureuil 2021-01-08 14:54:40 CET
we removed the QT_PLUGIN_PATH some weeks ago.

What is the status of  this bug ?
Comment 11 Timothée Giet 2021-01-08 15:40:45 CET
In mga7, the bug is still there (I guess QT_PLUGIN_PATH has been removed only on cauldron).

I can't test it on cauldron as I don't have it installed now, but you can check easily: download Krita appimage (https://download.kde.org/stable/krita/4.4.1/krita-4.4.1-x86_64.appimage), set it executable and try to launch it.
If it starts properly, the bug is fixed.
If it stops/crashes while starting, the bug is not fixed.
Comment 12 papoteur 2021-01-09 11:33:09 CET
Hello,
In my cauldron up to date.
env|grep QT_
QT_XFT=0
QT_AUTO_SCREEN_SCALE_FACTOR=0

Thus QT_PLUGIN_PATH is no more set, what is wanted.
krita downloaded as said by Animtim stars OK.
Thus, the bug can be closed. 
If side effects occur, other reports have to be filed.

Status: NEW => RESOLVED
Resolution: (none) => FIXED


Note You need to log in before you can comment on or make changes to this bug.