Bug#663684: libGL.so/libGL.so.1 diversions are causing issues in libgtkglext1 programs with nvidia drivers
Yuri D'Elia
wavexx at thregr.org
Tue Mar 13 11:11:29 UTC 2012
Package: glx-diversions
Version: 0.2.1
Severity: normal
When using the binary nvidia drivers with the current glx-diversions setup,
function calls to glXGetProcAddress causes programs to crash with a
segmentation fault.
In a private discussion with Andreas Beckmann, I understood that the current
diversion mechanism works as follows:
- libGL.so always points to mesa-diverted
- libGL.so.1 points to the binary driver
This forces programs to link to the mesa library by default, so that no symbols
from the proprietary driver are brought in.
This is _very_ sensible, but has some drawbacks:
- This causes programs dynloading "libGL.so" to fail. Several dynamic languages
are doing it, notably lisp environment and in particular the "cl-opengl"
package, which currently fails only on Debian because of this. While I agree
that opening the proper soname (libGL.so.1) is the way to go, determining it
at "runtime" for a dynamic language *is* a problem. Afterall, libGL.so is
expected to point at the default GL libs. Fixing cl-opengl is easy in this
case (simply loading libGL.so.1 fixes the issue), but kind of unexpected.
- Second issue is more complicated. This link group breaks all applications
using libgtkglext1. I didn't debug it fully yet to understand why.
Please see bug #337022: all calls to glXGetProcAddress (or the gdk equivalent
gdk_gl_get_proc_address) fail with a segmentation fault.
Replacing the libGL.so link to point to libGL.so.1 (to the nvidia driver
directly) fixes the issue.
To reproduce the issue simply dowload the source of libgtkglext1, build the
package, cd into examples and make coolwave.
I'm attaching both strace and ltrace output of the output of coolwave with the
default link group.
It seems that someone (maybe the binary driver itself?) is trying to load
libGL.so at runtime. Given that libGL.so.1 is already loaded, after calling
functions in libGL.so some internal state gets (and rightfully so) corrupted.
I was left wondering though, if some packages are failing to get GL extensions
and degrade gracefully, thus giving me a subpar experience. I know of at least
one case (http://factorcode.org/) where the "GL demos" do work and _are_
accellerated by the binary driver, but all GL extensions are disabled because
dynamic loading "silently" fails.
Tricky.
-- Package-specific info:
Diversions:
diversion of /usr/lib/i386-linux-gnu/libGL.so to /usr/lib/mesa-diverted/i386-linux-gnu/libGL.so by glx-diversions
diversion of /usr/lib/i386-linux-gnu/libGL.so.1 to /usr/lib/mesa-diverted/i386-linux-gnu/libGL.so.1 by glx-diversions
diversion of /usr/lib/i386-linux-gnu/libGL.so.1.2 to /usr/lib/mesa-diverted/i386-linux-gnu/libGL.so.1.2 by glx-diversions
diversion of /usr/lib/libGL.so to /usr/lib/mesa-diverted/libGL.so by glx-diversions
diversion of /usr/lib/libGL.so.1 to /usr/lib/mesa-diverted/libGL.so.1 by glx-diversions
diversion of /usr/lib/libGL.so.1.2 to /usr/lib/mesa-diverted/libGL.so.1.2 by glx-diversions
diversion of /usr/lib/x86_64-linux-gnu/libGL.so to /usr/lib/mesa-diverted/x86_64-linux-gnu/libGL.so by glx-diversions
diversion of /usr/lib/x86_64-linux-gnu/libGL.so.1 to /usr/lib/mesa-diverted/x86_64-linux-gnu/libGL.so.1 by glx-diversions
diversion of /usr/lib/x86_64-linux-gnu/libGL.so.1.2 to /usr/lib/mesa-diverted/x86_64-linux-gnu/libGL.so.1.2 by glx-diversions
/usr/lib/mesa-diverted:
total 100
drwxr-xr-x 4 root root 72 Sep 5 2011 .
drwxr-xr-x 130 root root 77824 Mar 13 11:27 ..
drwxr-xr-x 2 root root 6 Jun 26 2011 i386-linux-gnu
lrwxrwxrwx 1 root root 33 Jul 21 2011 libGL.so-master -> /etc/alternatives/libGL.so-master
drwxr-xr-x 2 root root 57 Dec 13 10:56 x86_64-linux-gnu
/usr/lib/mesa-diverted/i386-linux-gnu/:
total 0
drwxr-xr-x 2 root root 6 Jun 26 2011 .
drwxr-xr-x 4 root root 72 Sep 5 2011 ..
/usr/lib/mesa-diverted/x86_64-linux-gnu/:
total 356
drwxr-xr-x 2 root root 57 Dec 13 10:56 .
drwxr-xr-x 4 root root 72 Sep 5 2011 ..
lrwxrwxrwx 1 root root 10 Dec 11 15:54 libGL.so -> libGL.so.1
lrwxrwxrwx 1 root root 12 Dec 11 15:54 libGL.so.1 -> libGL.so.1.2
-rw-r--r-- 1 root root 363920 Dec 11 15:54 libGL.so.1.2
Alternative 'glx':
glx - auto mode
link currently points to /usr/lib/nvidia
/usr/lib/mesa-diverted - priority 5
slave glx--libGL.so.1-x86_64-linux-gnu: /usr/lib/mesa-diverted/x86_64-linux-gnu/libGL.so.1
/usr/lib/nvidia - priority 100
slave glx--libGL.so.1-x86_64-linux-gnu: /usr/lib/x86_64-linux-gnu/nvidia/libGL.so.1
slave glx--libXvMCNVIDIA.so.1-x86_64-linux-gnu: /usr/lib/x86_64-linux-gnu/nvidia/libXvMCNVIDIA.so.1
slave glx--libXvMCNVIDIA_dynamic.so.1-x86_64-linux-gnu: /usr/lib/x86_64-linux-gnu/nvidia/libXvMCNVIDIA_dynamic.so.1
slave glx--libnvidia-cfg.so.1-x86_64-linux-gnu: /usr/lib/x86_64-linux-gnu/nvidia/libnvidia-cfg.so.1
slave glx--linux-libglx.so: /usr/lib/nvidia/libglx.so
slave glx--nvidia-bug-report.sh: /usr/lib/nvidia/nvidia-bug-report.sh
slave glx--nvidia_drv.so: /usr/lib/nvidia/nvidia_drv.so
Current 'best' version is '/usr/lib/nvidia'.
lrwxrwxrwx 1 root root 15 Feb 23 17:08 /etc/alternatives/glx -> /usr/lib/nvidia
lrwxrwxrwx 1 root root 48 Jul 21 2011 /etc/alternatives/glx--libGL.so-x86_64-linux-gnu -> /usr/lib/mesa-diverted/x86_64-linux-gnu/libGL.so
lrwxrwxrwx 1 root root 43 Feb 23 17:08 /etc/alternatives/glx--libGL.so.1-x86_64-linux-gnu -> /usr/lib/x86_64-linux-gnu/nvidia/libGL.so.1
lrwxrwxrwx 1 root root 51 Feb 23 17:08 /etc/alternatives/glx--libXvMCNVIDIA.so.1-x86_64-linux-gnu -> /usr/lib/x86_64-linux-gnu/nvidia/libXvMCNVIDIA.so.1
lrwxrwxrwx 1 root root 59 Feb 23 17:08 /etc/alternatives/glx--libXvMCNVIDIA_dynamic.so.1-x86_64-linux-gnu -> /usr/lib/x86_64-linux-gnu/nvidia/libXvMCNVIDIA_dynamic.so.1
lrwxrwxrwx 1 root root 51 Feb 23 17:08 /etc/alternatives/glx--libnvidia-cfg.so.1-x86_64-linux-gnu -> /usr/lib/x86_64-linux-gnu/nvidia/libnvidia-cfg.so.1
lrwxrwxrwx 1 root root 25 Feb 23 17:08 /etc/alternatives/glx--linux-libglx.so -> /usr/lib/nvidia/libglx.so
lrwxrwxrwx 1 root root 36 Feb 23 17:08 /etc/alternatives/glx--nvidia-bug-report.sh -> /usr/lib/nvidia/nvidia-bug-report.sh
lrwxrwxrwx 1 root root 29 Feb 23 17:08 /etc/alternatives/glx--nvidia_drv.so -> /usr/lib/nvidia/nvidia_drv.so
File System:
lrwxrwxrwx 1 root root 21 Sep 5 2011 /usr/lib/glx -> /etc/alternatives/glx
lrwxrwxrwx 1 root root 50 Sep 5 2011 /usr/lib/x86_64-linux-gnu/libGL.so.1 -> /etc/alternatives/glx--libGL.so.1-x86_64-linux-gnu
-rw-r--r-- 1 root root 402824 Mar 5 00:44 /usr/lib/xorg/modules/extensions/libglx.so
-- System Information:
Debian Release: wheezy/sid
APT prefers unstable
APT policy: (900, 'unstable'), (800, 'experimental')
Architecture: amd64 (x86_64)
Kernel: Linux 3.2.0-2-amd64 (SMP w/2 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Versions of packages glx-diversions depends on:
ii dpkg 1.16.1.2
ii nvidia-installer-cleanup 20111111+3
Versions of packages glx-diversions recommends:
ii glx-alternative-mesa 0.2.1
glx-diversions suggests no packages.
Versions of packages nvidia-glx depends on:
ii dpkg 1.16.1.2
ii libgl1-nvidia-glx 295.20-1
ii nvidia-alternative 295.20-1
ii nvidia-installer-cleanup 20111111+3
ii nvidia-kernel-dkms [nvidia-kernel-295.20] 295.20-1
ii nvidia-support 20111111+3
ii nvidia-vdpau-driver 295.20-1
ii xserver-xorg-video-nvidia 295.20-1
Versions of packages nvidia-glx suggests:
ii nvidia-kernel-dkms [nvidia-kernel-dkms] 295.20-1
ii nvidia-settings 295.20-1
Versions of packages glx-diversions is related to:
ii glx-alternative-fglrx <none>
ii glx-alternative-mesa 0.2.1
ii glx-alternative-nvidia 0.2.1
ii libgl1-dev <none>
ii libgl1-mesa-glx [libgl1] 7.11.2-1
ii libgl1-nvidia-glx [libgl1-nvidia-glx-any] 295.20-1
ii nvidia-glx [nvidia-glx-any] 295.20-1
ii xserver-xorg-video-nvidia [xserver-xorg-video-nvidia-any] 295.20-1
-- no debconf information
-------------- next part --------------
A non-text attachment was scrubbed...
Name: coolwave-ltrace.log.gz
Type: application/x-gzip
Size: 14467 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/pkg-nvidia-devel/attachments/20120313/147d7fec/attachment-0002.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: coolwave-strace.log.gz
Type: application/x-gzip
Size: 19958 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/pkg-nvidia-devel/attachments/20120313/147d7fec/attachment-0003.bin>
More information about the pkg-nvidia-devel
mailing list