After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 445376 - gdk_device_get_history causes X error with libX11 1.1.2
gdk_device_get_history causes X error with libX11 1.1.2
Status: RESOLVED NOTGNOME
Product: gtk+
Classification: Platform
Component: Backend: X11
2.10.x
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
: 440473 448724 448882 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2007-06-08 05:47 UTC by liam
Modified: 2007-06-18 20:56 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Small test case (789 bytes, text/plain)
2007-06-10 18:47 UTC, Manish Singh
Details

Description liam 2007-06-08 05:47:59 UTC
To reproduce,
(1) make a new image, RGB
(2) I chose the brush "circle (17) (19 x 19)"
(3) click and drag anywhere in the image

GIMP crashes.

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.)
dell!lee Caussin-HolyCourt> 
(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.
Comment 1 liam 2007-06-08 05:50:44 UTC
Hmm, 2.3.17 is also crashing for me now when I do this, so it might be unrelated to gimp, sorry.
Comment 2 Sven Neumann 2007-06-08 09:33:51 UTC
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?
Comment 3 liam 2007-06-10 01:14:51 UTC
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 :-)



Comment 4 Sven Neumann 2007-06-10 11:07:22 UTC
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.
Comment 5 Sven Neumann 2007-06-10 11:16:58 UTC
That should have read "we can not tell definitely that GIMP is using it correctly", of course.
Comment 6 Manish Singh 2007-06-10 18:11:16 UTC
Looks like a either a problem with new xlib, or the way gtk+ uses it.

Relevant portion of stack trace:

  • #0 gdk_x_error
    at /tmp/buildd/gtk+2.0-2.10.12/gdk/x11/gdkmain-x11.c line 614
  • #1 _XError
    at ../../src/XlibInt.c line 2905
  • #2 _XReply
    at ../../src/xcb_io.c line 417
  • #3 XGetMotionEvents
    at ../../src/GetMoEv.c line 51
  • #4 IA__gdk_device_get_history
    at /tmp/buildd/gtk+2.0-2.10.12/gdk/x11/gdkinput.c line 218
  • #5 gimp_display_shell_canvas_tool_events
    at gimpdisplayshell-callbacks.c line 1159

This happens with libx11 1.1.2, and not with versions prior.
Comment 7 Manish Singh 2007-06-10 18:47:32 UTC
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.
Comment 8 Manish Singh 2007-06-10 18:48:56 UTC
Reassigning to GTK+, as the bug can be reproduced outside of GIMP.
Comment 9 Manish Singh 2007-06-10 18:52:57 UTC
As said earlier, this very well could be a libX11 bug.
Comment 10 Olivier Blin 2007-06-10 20:08:42 UTC
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.
Comment 11 Olivier Blin 2007-06-10 21:10:43 UTC
I've found the offending bug, upstream bug report is here:
https://bugs.freedesktop.org/show_bug.cgi?id=11222
Comment 12 Manish Singh 2007-06-11 03:15:19 UTC
Hah, that's messed up. Thanks for tracking it down. Closing as NOTGNOME.
Comment 13 Sven Neumann 2007-06-11 07:39:28 UTC
*** Bug 440473 has been marked as a duplicate of this bug. ***
Comment 14 Sven Neumann 2007-06-18 10:44:27 UTC
*** Bug 448724 has been marked as a duplicate of this bug. ***
Comment 15 Simon Budig 2007-06-18 20:53:38 UTC
*** Bug 448882 has been marked as a duplicate of this bug. ***
Comment 16 Simon Budig 2007-06-18 20:56:47 UTC
*** Bug 448724 has been marked as a duplicate of this bug. ***