INTERNAL: Upgrades in the Mesa library for Linux and in X11 Library Security Are Crashing IDL
Anonym
Topic:
This Tech Tips needs to be updated
Two unrelated library updates released in March/April 2007 by several Linux brands are proving to be incompatible with IDL versions through IDL 6.3. Around April 19th the IDL Graphics Interface development team found both temporary workarounds for immediate disclosure, and the path to a more permanent workaround that will be incorporated in the May 2007 release of IDL 6.4 .
For all Linux users seeking immediate relief, read below the details of how you can keep your machines compatible with IDL 6.3 (and earlier) until you acquire IDL 6.4. Linux users of pre-6.4 IDL's (and forthcoming pre-4.4 ENVI's) are also dependent on the workarounds shown in the Discussion section below.Discussion:
I. BACKGROUND
Two unrelated library updates released in March/April 2007 by several Linux brands are proving to be incompatible with IDL versions through IDL 6.3.
One incompatibility comes from the 'libX11' library, released, most immediately, with Debian ("etch") and Ubuntu. To strengthen the security of their operating system Debian patched 'libx11' to fix a buffer overflow. Unfortunately, this patch has caused a number of applications, including IDL, to crash. Any users, who update their Debian system to get the latest 'libx11', are exposed to a fatal "segmentation fault" error when they execute the IDL command
TV. It appears that Fedora Linux is also including this IDL-incompatible security patch in its automatic updates now.
The second problematic update is in the Mesa library, which provides an OpenGL implementation on Linux. This update, whose main wide release commenced in late March, has introduced symbols that clash with the Mesa library with which IDL versions through version 6.4 Beta have been compiled. This Mesa development has definitely been incorporated in Fedora automatic updates and probably several other Linux brands as well. It renders IDL's Object Graphics hardware-rendering interface library 'gl_driver.so' incompatible with systems that have been upgraded with the new Mesa. The symptoms are the same - an IDL process-crashing segmentation fault - but there are a much broader set of both Direct Graphics and Object Graphics commands that can trigger the error, like:
- The splash screen in an IDLDE, IDL Virtual Machine or ENVI initialization
- IDL> oWin = obj_new('IDLgrWindow')
- IDL> plot, [0,1]
- IDL> help, /DEVICE
The diagnosis and search for workarounds for these unexpected Linux operating system modifications has been the top priority of IDL's Graphics Interface development team since these bugs were first reported. Though these two problems appear to be related due to their similar symptoms and their coincidental timing, they are actually completely unrelated in their origins and in their options for immediate repair.
For the first problem - the X11 library security update managing a buffer overflow - the best workaround is to downgrade to the previous version of 'libx11'. Full details on how to do this for various brands and versions of Linux are posted in Section II. below.
For the second problem - the Mesa library introduction of new symbols that clash with IDL - IDL currently has a configuration environment setting that can temporarily save the day. More details are below, but the quick summary of the main repair option is to create in your system or user login environments an environment variable named LIBGL_ALWAYS_INDIRECT set to 1. More details on this, and its possible impacts on graphics processing speed, are discussed in Section III.
II. SEG FAULT CAUSE 1: The Debian "etch" libx11 Security Update (APR 2007)
Debian have released a security patch for the X11 library (on Debian 'libx11.so') to fix a buffer overflow. This patch has definitely become part of the Debian and Ubuntu automatic update, and, we believe, more recently that of Fedora Cores 5 and 6 as well. Unfortunately, this patch causes a number of applications, including IDL, to crash. Any users, who have allowed this patch to update their Linux O.S.'s, will find that execution of the IDL image-displaying command TV will crash their IDL process with a segmentation fault. To reproduce, try:
Debian's explanation of the buffer overflow bug is here:
For immediate relief from this bug, we have found no reliable workaround short of replacing the more current incompatible X11 library with the version that preceded it. Below are links and steps showing how to do this on all the problem Linux versions, whose customers have reported problems to us:
Debian:
32-bit IDL users download the installer from this site: libx11-6_1.0.3-6_i386.deb
and install with:
dpkg -i libx11-6_1.0.3-6_i386.deb
64-bit IDL users download the installer from this site: libx11-6_1.0.3-6_amd64.deb
and install with:
dpkg -i libx11-6_1.0.3-6_amd64.deb
Fedora Core 6:
32-bit users can run the following commands from any prompt location on their Xterm:
rpm -e --nodeps libX11.i386
rpm -i http://download.fedora.redhat.com/pub/fedora/linux/core/updates/6/i386/libX11-1.0.3-6.fc6.i386.rpm
... and 64-bit users can run these:
rpm -e --nodeps libX11.x86_64
rpm -i http://download.fedora.redhat.com/pub/fedora/linux/core/updates/6/x86_64/libX11-1.0.3-6.fc6.x86_64.rpm
Fedora Core 5:
32-bit users can run the following commands from any prompt location on their Xterm:
rpm -e --nodeps libX11-1.0.0
rpm -i http://download.fedora.redhat.com/pub/fedora/linux/core/updates/5/i386/libX11-1.0.0-3.FC5.0.i386.rpm
... and 64-bit users can run these:
rpm -e --nodeps libX11-1.0.0
rpm -i http://download.fedora.redhat.com/pub/fedora/linux/core/updates/5/x86_64/libX11-1.0.0-3.FC5.0.x86_64.rpm
SuSE 9.3:
An IDL user on 32-bit SuSE Linux 9.3 reported that he was able to revert to the older compatible version of the libX11 library by issuing the following command from a command prompt with root privileges:
rpm -i --force ftp://ftp.suse.com/pub/suse/i386/update/9.3/rpm/i586/xorg-x11-libs-6.8.2-30.3.i586.rpm
This will install the old version of the X11 library without uninstalling the new version. That approach is reported to work fine for patching this particular IDL/X11 compatibility problem. The upgraded library on SuSE 9.3 (32-bit), which first caused the incompatibility, by the way, is 'xorg-x11-libs-6.8.2-30.12.i586.rpm.'
Other versions of SuSE would likely require installation of a version of the xorg-x11-libs RPM package that is appropriate to that version of SuSE Linux, to revert to an IDL-compatible version of the libX11 library file.
For example, SuSE 10 (SLES10) has xorg-x11-libs-6.8.2-100, by installing the older package xorg-x11-libs-6.8.2-30.3 in separate directory and added its path to $LD_LIBRARY_PATH before starting idl and that seems to fix it.
Mandriva 2007.1:
An ENVI+IDL user on 32-bit Mandriva 2007.1 reported that he was able to revert to the older compatible version of the libX11 library by issuing the following commands from a command prompt with root privileges:
rpm -ve --nodeps libx11_6-1.1.1-2.1mdv2007.1
(all on one line) rpm -iv ftp://mirrors.secsup.org/pub/linux/mandrakelinux/official/2007.1/i586/media/main/release/libx11_6-1.1.1-2mdv2007.1.i586.rpm
If the next time your system's updater runs and upgrades the RPM package that contains the 'libx11' library, you will have to repeat these steps to downgrade again in order to use the affected version of IDL.
III. SEG FAULT CAUSE 2: The Mesa3D Library Introduction Of New Clashing Symbols
An incompatibility between the system Mesa3D library, currently being included in most if not every Linux automatic update, and the Mesa3D library shipped with IDL (used for software rendering) also causes IDL to crash with a segmentation fault. One method immediately available to work around this is to create in the shell environment a variable named "LIBGL_ALWAYS_INDIRECT" and set its value to 1.
C-shell and TC-shell syntax: setenv LIBGL_ALWAYS_INDIRECT 1
bash and korn shell syntax: export LIBGL_ALWAYS_INDIRECT=1
Should this environment variable not work for you, then IDL offers an alternative approach: Rename the symbolic link gl_driver.so in the .../idl_6.3/bin/bin.linux.x86/ and/or .../idl_6.3/bin/bin.linux.x86_64/ directories with calls like the following:
$ cd /usr/local/rsi/idl_6.3/bin/bin.linux.x86
$ mv gl_driver.so gl_driver_donotuse.so
$ cd /usr/local/rsi/idl_6.3/bin/bin.linux.x86_64
$ mv gl_driver.so gl_driver_donotuse.so
Either of these approaches will force IDL to use software rendering only, ignoring the hardware accelerated Mesa3D system library. Many users will notice no performance impact from this, but those who are doing very complicated graphics processing (e.g. rotating isosurfaces) and/or are graphically processing very large data sets may observe a speed decline when their IDL process is forced into software rendering. For this reason, this fix proposal is only intended to be necessary until the release of IDL 6.4 For Linux.
Solution:
[Edit this field in the IDL-based Tech Tip Editor, v62]