The collected works of spd

I think I've found a workaround for the "BadValue" gdk_x_error()
on gnome applications in recent Linux distributions.

At http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=425189
it's said the fail is caused by a XkbSelectEventDetails() call; so
if you create a dynamic object which replaces that function, the
application will start:

$ tail -1 /etc/redhat-release
CentOS release 5 (Final)

$ ./hello_gtk
The program 'hello_gtk' received an X Window System error.
This probably reflects a bug in the program.
The error was 'BadValue (integer parameter out of range for operation)'.
(Details: serial 68 error_code 2 request_code 139 minor_code 1)
(Note to programmers: normally, X errors are reported asynchronously;
that is, you will receive the error a while after causing it.
To debug your program, run it with the --sync command line
option to change this behavior. You can then get a meaningful
backtrace from your debugger if you break on the gdk_x_error() function.)

$ cat xkb.c
int XkbSelectEventDetails(void *d, int ds, int ev, long b, long v) {return 1;}
$ gcc -fPIC -shared -Wl,-soname,xkb.so -o xkb.so xkb.c
$ LD_LIBRARY_PATH=$PWD LD_PRELOAD=xkb.so ./hello_gtk

... and "hello_gtk" runs fine.
octane MIPS R12000 400 MHz 2 MB L2 512 MB RAM, IRIX 6.5
Indy MIPS R4600 133 MHz 128 MB RAM, IRIX 6.2
In fact; you don't need to recompile; just launch gnome applications using a wrapper script.

I don't use remote gnome applications on a regular basis; but I use this fix for testing newly installed applications, and I haven't found any other function which should be wrapped.

(BTW, when using remote gnome apps with x11 forwarding is too slow with IRIX X11 server, you have to use direct X11 connection)



Example:

$ g2 firefox -no-remote

where g2 is

--------------------------------------
#!/bin/sh

LD_LIBRARY_PATH=/lib:/usr/lib

PKGDIR=$HOME/usr

EXEC=`type $1`
ARCH=`file ${EXEC}`


if expr "${ARCH}" : ".*x86-64.*"
then
LD_LIBRARY_PATH=${LD_LIBRARY_PATH:+$LD_LIBRARY_PATH:}${PKGDIR}/lib/linux-x86_64
else
LD_LIBRARY_PATH=${LD_LIBRARY_PATH:+$LD_LIBRARY_PATH:}${PKGDIR}/lib/linux-i686
fi

export LD_LIBRARY_PATH

LD_PRELOAD=xkb.so

APP=$1; shift
export LD_LIBRARY_PATH
export LD_PRELOAD
exec $APP ${1+"$@"}
octane MIPS R12000 400 MHz 2 MB L2 512 MB RAM, IRIX 6.5
Indy MIPS R4600 133 MHz 128 MB RAM, IRIX 6.2
karbonKid wrote: Also, I know we have plenty of backup programs already, but http://www.cis.upenn.edu/~bcpierce/unison/ would be nice...



It's pretty old, but it does work:

http://webdiis.unizar.es/pub/unix/comm/unison/
octane MIPS R12000 400 MHz 2 MB L2 512 MB RAM, IRIX 6.5
Indy MIPS R4600 133 MHz 128 MB RAM, IRIX 6.2
Thanks a lot! Firefox 3.0.19 running smoothly on Octane (R12k 400 MHz, 512 MB RAM)

_________________
octane MIPS R12000 400 MHz 2 MB L2 512 MB RAM, IRIX 6.5
Indy MIPS R4600 133 MHz 128 MB RAM, IRIX 6.2