Qt6 QLibraryInfo returns wrong paths
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Stellarium |
New
|
Unknown
|
|||
qt6-base (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned | ||
Jammy |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
[Impact]
1. QLibraryInfo can return non-existent paths.
2. This results in Qt6 QWebEngine being unusable.
[Test Plan]
1. Check the output of qtdiag from qt6-tools-
a) Run "qtdiag --no-vulkan --no-rhi --no-gl | grep Path"
b) verify that the paths actually exist, in particular DataPath: /share/qt6 does not exist on jammy.
2. Build the Qt supplied simplebrowser example, and verify it launches without error
a) apt-get source libqt6webengine
b) cd qt6-webengine-
c) mkdir bld
d) cd bld
e) cmake -DCMAKE_
f) cmake --build .
g) ./simplebrowser
An example of output from a failure is attached as faillog.txt. In particular note the failure to find resources at /share:
Qt WebEngine resources not found at /share/
Qt WebEngine resources not found at /share/qt6. Trying application directory...
and the resulting segmentation fault:
Segmentation fault (core dumped)
[Where problems could occur]
The change in 6.2.4+dfsg-8 restores the configuration settings that were used to build qtbase-
The change causes QLibraryInfo to use paths known at build time instead of trying to dynamically establish the paths. This will fail if the package is relocated to a different location from that which it is build for. Since the package isn't relocatable this shouldn't be a problem.
[Other Info]
The change is currently in The Kinetic Kudu.
[Original Description]
The qtdiag program can be used to find the paths returned by QLibraryInfo:
qtdiag --no-vulkan --no-rhi --no-gl
In this output on jammy (22.04) with qt6-base-dev (6.2.4+
Library info:
PrefixPath: /
Documentation
HeadersPath: /include/
LibrariesPath: /lib/x86_
LibraryExecut
BinariesPath: /lib/qt6/bin
PluginsPath: /lib/x86_
QmlImportsPath: /lib/x86_
ArchDataPath: /lib/x86_
DataPath: /share/qt6
TranslationsPath: /share/
ExamplesPath: /lib/x86_
TestsPath: /tests
SettingsPath: /etc/xdg
This is problematic. For example, the DataPath /share/qt6 does not exist. This can lead to various failures. For example a Qt application using the Qt WebEngine might report:
Qt WebEngine resources not found at /share/
Qt WebEngine resources not found at /share/qt6. Trying application directory...
Qt WebEngine resources not found at /app/gpsbabel/
Path override failed for key base::DIR_
Installed Qt WebEngine locales directory not found at location /share/
Qt WebEngine locales directory not found at location /app/gpsbabel/
Path override failed for key ui::DIR_LOCALES and path '/home/
[0423/194717.
Some features may not be available.
[0423/194717.
Some features may not be available.
[0423/194717.
Some features may not be available.
[0423/194717.
[3004:3004:
Segmentation fault (core dumped)
I note that qtdiag reports the correct paths on debian sid and qt6-base-dev (6.2.4+dfsg-4):
Library info:
PrefixPath: /usr
Documentation
HeadersPath: /usr/include/
LibrariesPath: /usr/lib/
LibraryExecut
BinariesPath: /usr/lib/qt6/bin
PluginsPath: /usr/lib/
QmlImportsPath: /usr/lib/
ArchDataPath: /usr/lib/
DataPath: /usr/share/qt6
TranslationsPath: /usr/share/
ExamplesPath: /usr/lib/
TestsPath: /usr/tests
SettingsPath: /etc/xdg
It is not clear to me if this is because of the difference in package versions, or some issue with ubuntu packaging.
ProblemType: Bug
DistroRelease: Ubuntu 22.04
Package: libqt6core6 6.2.4+dfsg-2ubuntu1
ProcVersionSign
Uname: Linux 5.13.0-40-generic x86_64
ApportVersion: 2.20.11-0ubuntu82
Architecture: amd64
CasperMD5CheckR
Date: Sat Apr 23 19:40:12 2022
ProcEnviron:
TERM=xterm
PATH=(custom, no user)
LANG=en_US.UTF-8
SourcePackage: qt6-base
UpgradeStatus: No upgrade log present (probably fresh install)
Changed in stellarium: | |
importance: | Unknown → High |
Changed in stellarium: | |
importance: | High → Unknown |
status: | Unknown → New |
This seems to be related to the dynamic loader search path, see the comments in https:/ /bugreports. qt.io/browse/ QTBUG-82589