GNOME Bugzilla – Bug 445376
gdk_device_get_history causes X error with libX11 1.1.2
Last modified: 2007-06-18 20:56:47 UTC
(1) make a new image, RGB
(2) I chose the brush "circle (17) (19 x 19)"
(3) click and drag anywhere in the image
This is a development version of GIMP. Debug messages may appear here.
The program 'gimp-2.3' received an X Window System error.
This probably reflects a bug in the program.
The error was 'BadWindow (invalid Window parameter)'.
(Details: serial 36183 error_code 3 request_code 39 minor_code 0)
(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.)
(script-fu:24646): LibGimpBase-WARNING **: script-fu: wire_read(): error
The error_code, request_code and minor_code are always the same.
Following the advice of the error,
$ gdb /usr/local/bin/gimp-2.3
GNU gdb 6.6-1mdv2007.1 (Mandriva Linux release 2007.1)
This GDB was configured as "i586-mandriva-linux-gnu"...
Using host libthread_db library "/lib/i686/libthread_db.so.1".
(gdb) break gdk_x_error
Function "gdk_x_error" not defined.
Hmm, 2.3.17 is also crashing for me now when I do this, so it might be unrelated to gimp, sorry.
Shouldn't make a difference for the X server what tool you are using. Are you experiencing similar problems with other paint tools? Do you still get this problem when you disable fancy cursors in the preferences? Are you using a tablet or just the regular core pointer?
Yes, still get it with or without fancy cursors.
A single touch with the eraser is OK, only dragging is a problem.
The same is true with the paintbrush.
Regular core pointer.
This is all after an update to Gnome 2.19, and a new X server,
so I'm pretty sure it's not gimp's fault, but not certain enough
not to file it, if that makes sense.
Other programs seem OK, e.g. inkscape, krita (except I can't
figure out how to use krita), imagemagick. And scripts
that render images seem to work OK, too, as does the
rectangle selection tool. Unfortunately "cut" in latest
SVN gimp fills the selection with orange, regardless of
colours selected, or I'd have an OK workaround :-)
Looks like a bug in the X server, but we can tell definitely that GIMP is using it correctly. It would be nice to get a stack trace for this but you would have to use GTK+ with debugging symbols.
That should have read "we can not tell definitely that GIMP is using it correctly", of course.
Looks like a either a problem with new xlib, or the way gtk+ uses it.
Relevant portion of stack trace:
This happens with libx11 1.1.2, and not with versions prior.
Created attachment 89711 [details]
Small test case
This is a small standalone test case to trip the bug. Simply compile, start, and move your mouse over the window.
Reassigning to GTK+, as the bug can be reproduced outside of GIMP.
As said earlier, this very well could be a libX11 bug.
I've used git bisect to find the offending commit in libX11.
Surprisingly, it seems to be a code-style change:
$ git bisect good 605d357074d556a05a3fba2e85cbea36a3204248
a48386ce6b5f8fd2d9dc11a966c9bf5da59f3831 is first bad commit commit a48386ce6b5f8fd2d9dc11a966c9bf5da59f3831
Author: Magnus Kessler <Magnus.Kessler@gmx.net>
Date: Tue May 1 15:20:08 2007 +0200
Switched function definitions from K&R to ANSI style.
:040000 040000 78bcf3e9c54ff02d77c2e590e10d36bbe00610b4 da6cdb57564533f1084b2ea2b9888c12884b151e M src
Reverting this commit on libx11-1.1.2 makes gimp brushes work again.
I'll try to find the precise hunk that breaks gdk.
I've found the offending bug, upstream bug report is here:
Hah, that's messed up. Thanks for tracking it down. Closing as NOTGNOME.
*** Bug 440473 has been marked as a duplicate of this bug. ***
*** Bug 448724 has been marked as a duplicate of this bug. ***
*** Bug 448882 has been marked as a duplicate of this bug. ***