[xcrysden] xc-1.5.53 on linux with 32bit visuals

Martin Kroeker martin at ruby.chemie.uni-freiburg.de
Sun Apr 1 00:07:34 CEST 2012


Hi, 
with a self-compiled 1.5.53 on 64bit Linux (various openSuSE 11.x boxes
with either NVIDIA or AMD graphics cards), we have encountered XError
aborts when the right mouse button is pressed. Apparently, when the
popup menu is to be created, some Tk function calls XQueryColors to
enumerate the colormap. On our systems, this consistently failed with
a "BadValue" error, and as XCrysDen does not install its own X error
handler, the stock XErrorFunction kicks in and terminates XCrysDen 
after printing its error message. 
After adding a more benign error handler in the main() function of
C/xcAppInit.C, posting the button menu worked, but most of the menu
apart from the color selector was empty and my error handler recorded 
a stream of further BadMatch/BadValue errors. Searching the internet
for similar cases led me to believe that the underlying problem is that
XCrysDen picks up a 32bit visual on our machines, and the XQueryColors
call fails possibly due to an Xlib bug, where the pixel range available
with RGBA visuals exceeds that accepted by XQueryColors.

The solution gleaned from similar cases (e.g., Nedit) was to add
export XLIB_SKIP_ARGB_VISUALS=1
to the xcrysden script. (A more invasive alternative being to disable
the "Composite" extension in the xorg.conf - both make xcrysden pick
a regular 24bit visual with no adverse effects).

As what appears to be the same problem was reported in June last year
by Hongsheng Zhao and reportedly solved by using a 32bit binary, the
above-mentioned misbehaviour of XQueryColors et al. seems to be limited
to 64bit systems. 

Regards
Martin
-- 
Dr. Martin Kroeker            martin at ruby.chemie.uni-freiburg.de
c/o Prof.Dr. Caroline Roehr
Institut fuer Anorganische und Analytische Chemie der Universitaet Freiburg


More information about the XCrySDen mailing list