Details
-
Bug
-
Resolution: Done
-
P2: Important
-
5.9.4, 5.10.1
-
None
-
Reproduced on Debian GNU/Linux sid amd64, the original bug report was from Ubuntu 18.04 user.
-
a35c6a49c938fefbf25332cc5a2dc760f6d0c4ed
Description
Currently QGLXContext::getProcAddress has the following code:
QLibrary lib(QLatin1String("GL")); glXGetProcAddressARB = (qt_glXGetProcAddressARB) lib.resolve("glXGetProcAddressARB");
This searches for a library named libGL.so. However, on Debian/Ubuntu (did not test on other distros) this file is not present unless the libglvnd-dev package is installed. That is a development package, and it will be rarely present on users’ systems. Without it, only libGL.so.1 file is present.
This means that initializing the OpenGL context will fail in programs that are not linked to OpenGL themselves, which will result in crashes when trying to use it. I received a bug report from PyQt5 user, but there may be other affected applications.
Here is a small example which illustrates the problem:
#include <QtCore/QCoreApplication> #include <QtCore/QLibrary> #include <QtCore/QString> #include <QtCore/QTextStream> int main(int argc, char **argv) { QCoreApplication app(argc, argv); QLibrary lib(QLatin1String("GL")); QTextStream(stdout) << lib.load() << endl; return 0; }
It prints 1 (loading successful) when libglvnd-dev is installed, and 0 (loading failed) when it is not installed.
Attachments
Issue Links
- relates to
-
QTBUG-71488 QtWebEngine: can load wrong libGL.so in certain circumstances
- Closed
For Gerrit Dashboard: QTBUG-67537 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
225681,3 | glx: Fix loading OpenGL library when libGL.so symlink is missing | 5.11 | qt/qtbase | Status: MERGED | +2 | 0 |