Opened 7 years ago

Closed 5 years ago

#3900 closed defect (fixed)

BadMatch error when reparenting glcanvas in wxGTK 2.8.0

Reported by: gverbruggen Owned by:
Priority: normal Milestone:
Component: wxGTK Version:
Keywords: Cc: gverbruggen
Blocked By: Blocking:
Patch: no

Description

When a wxGLCanvas is reparented in wxGTK 2.8.0, the following X error occurs:

(reparenttest:6450): Gdk-WARNING : gdkdrawable-x11.c:904 drawable is not a pixmap or window

(reparenttest:6450): Gdk-WARNING : gdkdrawable-x11.c:904 drawable is not a pixmap or window
The program 'reparenttest' received an X Window System error.
This probably reflects a bug in the program.
The error was 'BadMatch (invalid parameter attributes)'.

(Details: serial 1303 error_code 8 request_code 144 minor_code 26)

Attached is a small program that triggers the crash. (2 frames and a button. When the button is pressed, a GLCanvas is reparented from the left frame to the right frame and vice versa)
The program works fine with wxGTK 2.7.0 and crashes with wxGTK 2.8.0.

You get a similar error when you try to drag a wxAUI managed wxGLCanvas.

Attachments (1)

reparenttest.cpp download (4.1 KB) - added by gverbruggen 7 years ago.
program triggering the reparent bug

Download all attachments as: .zip

Change History (4)

Changed 7 years ago by gverbruggen

program triggering the reparent bug

comment:1 Changed 6 years ago by pcor

Can't reproduce in 2.8 branch, presumably fixed.

comment:2 Changed 5 years ago by zh

  • Status changed from closed to reopened

I have wxWidgets 2.8.7.1 and I still see this issue. I rebuilt the reparenttest.cpp app (needed to add a wxT() wrapper around the two strings to successfully compile), and when I run it it still crashes:

$ ./reparenttest
left -> right

(reparenttest:322): Gdk-WARNING : /build/buildd/gtk+2.0-2.12.9/gdk/x11/gdkdrawable-x11.c:878 drawable is not a pixmap or window

(reparenttest:322): Gdk-WARNING : /build/buildd/gtk+2.0-2.12.9/gdk/x11/gdkdrawable-x11.c:878 drawable is not a pixmap or window
The program 'reparenttest' received an X Window System error.
This probably reflects a bug in the program.
The error was 'BadMatch (invalid parameter attributes)'.

(Details: serial 3172 error_code 8 request_code 143 minor_code 26)
(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.)

Locking assertion failure. Backtrace:
#0 /usr/lib/libxcb-xlib.so.0 [0xb616b767]
#1 /usr/lib/libxcb-xlib.so.0(xcb_xlib_lock+0x2e) [0xb616b81e]
#2 /usr/lib/libX11.so.6 [0xb62b0518]
#3 /usr/lib/libX11.so.6(XFreeCursor+0x25) [0xb628c8f5]
#4 /usr/lib/libqt-mt.so.3(_ZN11QCursorDataD1Ev+0x3f) [0xb55c4389]
#5 /usr/lib/libqt-mt.so.3(_ZN7QCursorD1Ev+0x5a) [0xb55c458e]
#6 /usr/lib/libqt-mt.so.3 [0xb55c45d5]
#7 /lib/tls/i686/cmov/libc.so.6(exit+0xd4) [0xb7733084]
#8 /usr/lib/libgdk-x11-2.0.so.0 [0xb71a5637]
#9 /usr/lib/libX11.so.6(_XError+0xfe) [0xb62a973e]
#10 /usr/lib/libX11.so.6(_XReply+0x231) [0xb62b12f1]
#11 /usr/lib/libGL.so.1 [0xb75b6bc7]
#12 /usr/lib/libwx_gtk2u_gl-2.8.so.0 [0xb7883674]

Is this fixed in a later version of wxWidgets? I have a large scale application that has many glcanvas windows and moving them around is an important feature.

Also, is there perhaps a "manual" way of reparenting that can avoid the crash? Any other suggestions for a workaround?

comment:3 Changed 5 years ago by pcor

  • Cc pcor removed
  • Resolution set to fixed
  • Status changed from reopened to closed

I don't know why I didn't see this before, but I can reproduce it now. Fixed in r60708.

Note: See TracTickets for help on using tickets.