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 581829 - gtk_widget_get_snapshot crashes
gtk_widget_get_snapshot crashes
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: .General
unspecified
Other Linux
: Normal major
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2009-05-08 06:25 UTC by Andreas J. Guelzow
Modified: 2010-01-01 00:38 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Andreas J. Guelzow 2009-05-08 06:25:37 UTC
Use current gtk+ from git or 2.14 

Use current gnumeric git with the patch from 144787 (of course with compilation of the main part of that patch enabled).

Run gnumeric

Add a slider to the empty gnumeric window.

Select preview. This will result in a crash from within gtk_widget_get_snapshot.

The following info is obtained by setting a break point at gtk_widget_get_snapshot while running 

jhbuild run gdb --args gnumeric --sync

Breakpoint 1, IA__gtk_widget_get_snapshot (widget=0x8f47008, clip_rect=0x0) at gtkwidget.c:8773
8773	  GdkWindow *parent_window = NULL;
(gdb) p widget
$1 = (GtkWidget *) 0x8f47008
(gdb) p *widget
$2 = {object = {parent_instance = {g_type_instance = {g_class = 0x8f6a900}, ref_count = 1, qdata = 0x8f8c3b0}, flags = 2164704}, 
  private_flags = 3584, state = 0 '\0', saved_state = 0 '\0', name = 0x0, style = 0x8decc78, requisition = {width = 31, height = 17}, 
  allocation = {x = 38, y = 81, width = 183, height = 26}, window = 0x8dcc0e0, parent = 0x8f5d400}
(gdb) n
8775	  GList *windows = NULL, *list;
(gdb) 
8777	  g_return_val_if_fail (GTK_IS_WIDGET (widget), NULL);
(gdb) 
8778	  if (!GTK_WIDGET_VISIBLE (widget))
(gdb) 
8782	  if (widget->parent && !GTK_WIDGET_REALIZED (widget->parent))
(gdb) 
8784	  if (!GTK_WIDGET_REALIZED (widget))
(gdb) 
8788	  x = widget->allocation.x;
(gdb) 
8789	  y = widget->allocation.y;
(gdb) 
8790	  width = widget->allocation.width;
(gdb) p x
$3 = 38
(gdb) p y
$4 = 81
(gdb) n      
8791	  height = widget->allocation.height;
(gdb) n
8793	  if (widget->parent && !GTK_WIDGET_NO_WINDOW (widget))
(gdb) p width
$5 = 183
(gdb) p height
$6 = 26
(gdb) n
8825	  else if (!widget->parent)
(gdb) 
8833	  if (clip_rect)
(gdb) p clip_rect
$7 = (GdkRectangle *) 0x0
(gdb) n
8861	  pixmap = gdk_pixmap_new (widget->window, width, height, gdk_drawable_get_depth (widget->window));
(gdb) 
8862	  for (list = windows; list; list = list->next) /* !NO_WINDOW widgets */
(gdb) p windows
$8 = (GList *) 0x0
(gdb) n
8874	  if (!windows) /* NO_WINDOW || toplevel => parent_window == NULL || parent_window == widget->window */
(gdb) n
8876	      gdk_window_redirect_to_drawable (widget->window, pixmap, x, y, 0, 0, width, height);
(gdb) 
8877	      expose_window (widget->window);
(gdb) 

Gdk-ERROR **: The program '/home/aguelzow/gnumeric/bin/gnumeric' received an X Window System error.
This probably reflects a bug in the program.
The error was 'BadAlloc (insufficient resources for operation)'.
  (Details: serial 67177 error_code 11 request_code 53 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.)
aborting...

Program received signal SIGABRT, Aborted.
0xb7fcd424 in __kernel_vsyscall ()
(gdb) bt
  • #0 __kernel_vsyscall
  • #1 raise
    from /lib/i686/cmov/libc.so.6
  • #2 abort
    from /lib/i686/cmov/libc.so.6
  • #3 IA__g_logv
    at /build/buildd-glib2.0_2.20.1-1-i386-SPuBUJ/glib2.0-2.20.1/glib/gmessages.c line 506
  • #4 IA__g_log
    at /build/buildd-glib2.0_2.20.1-1-i386-SPuBUJ/glib2.0-2.20.1/glib/gmessages.c line 526
  • #5 gdk_x_error
    at gdkmain-x11.c line 641
  • #6 _XError
    from /usr/lib/libX11.so.6
  • #7 ??
    from /usr/lib/libX11.so.6
  • #8 ??
  • #9 ??
  • #10 ??
  • #11 ??
  • #12 ??

Comment 1 Andreas J. Guelzow 2010-01-01 00:38:11 UTC
This appears to be fixed in 2.18.