Please consider a donation to the Higher Intellect project. See https://preterhuman.net/donate.php or the Donate to Higher Intellect page for more info.

The program gedit received an X Window System error

From Higher Intellect Wiki
Jump to navigation Jump to search

Problem

I have noticed a problem while trying to display X clients running on Linux systems with remote display on IRIX 6.5 X server.

	- Server:

	IRIX64 6.5.24f
	X11 Execution Environment, 6.5.24, based on X11R6.6
	Default screen #0: 

  dimensions:    1280x1024 pixels (396x297 millimeters)
  resolution:    82x88 dots per inch
  depths (5):    1, 8, 12, 15, 24
  root window id:    0x35
  depth of root window:    24 planes

  	- Clients:

	Several recent Linux distributions, for example Mandriva 2008.1
	lib64gdk_pixbuf2.0_0-2.12.5-2mdv2008.1
	gnome-common-2.20.0-2mdv2008.1

$ gedit
The program 'gedit' 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 72 error_code 2 request_code 139 minor_code 1)

Workaround

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.