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 710319 - eog and other GNOME apps crash with X11 error after upgrading to gtk+ 3.10 or later
eog and other GNOME apps crash with X11 error after upgrading to gtk+ 3.10 or...
Status: RESOLVED NOTGNOME
Product: gtk+
Classification: Platform
Component: Backend: X11
3.10.x
Other Mac OS
: Normal critical
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2013-10-16 19:31 UTC by David Evans
Modified: 2014-07-14 03:28 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description David Evans 2013-10-16 19:31:06 UTC
After upgrading from gtk+ 3.8 to gtk+ 3.10, many GNOME apps repeatably crash with an X Window System error when selecting an image from file chooser and/or other operations involving images.  Problem is observed using gtk+ 3.10.0, 3.10.1, 3.10.2. Apps work correctly using gtk+ 3.8.5 or earlier.

To reproduce using eog 3.10.1:

1) open eog
2) select Image->Open
3) select an image file from Image Open window

Program immediately crashes with no further screen updates displaying the following error on console:

(eog:30070): Gdk-ERROR **: The program 'eog' received an X Window System error.
This probably reflects a bug in the program.
The error was 'BadAccess (attempt to access private resource denied)'.
  (Details: serial 3800 error_code 10 request_code 132 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 GDK_SYNCHRONIZE environment
   variable to change this behavior. You can then get a meaningful
   backtrace from your debugger if you break on the gdk_x_error() function.)
Trace/BPT trap: 5

xdpyinfo shows:

$ xdpyinfo -queryExt | grep opcode | grep 132
    MIT-SHM  (opcode: 132, base event: 72, base error: 132)

Setting GDK_SYNCHRONIZE and running eog under gdb with the requested breakpoint
shows:

Breakpoint 1, gdk_x_error (xdisplay=0x10202ee00, error=0x7fff5fbfc378) at gdkmain-x11.c:269
269	  if (error->error_code)
(gdb) thread apply all bt

Thread 1 (process 30123)

  • #0 gdk_x_error
    at gdkmain-x11.c line 269
  • #1 _XError
    at XlibInt.c line 1463
  • #2 handle_error
    at xcb_io.c line 213
  • #3 handle_response
    at xcb_io.c line 325
  • #4 _XReply
    at xcb_io.c line 627
  • #5 XSync
    at Sync.c line 44
  • #6 _XSyncFunction
    at Synchro.c line 35
  • #7 XSyncSetCounter
    at XSync.c line 474
  • #8 set_sync_counter
    at gdkwindow-x11.c line 214
  • #9 window_pre_damage
    at gdkwindow-x11.c line 232
  • #10 on_surface_changed
    at gdkwindow-x11.c line 243
  • #11 _cairo_mime_data_destroy
    at cairo-surface.c line 1197
  • #12 _cairo_user_data_array_fini
    at cairo-array.c line 392
  • #13 _cairo_surface_detach_mime_data
    at cairo-surface.c line 325
  • #14 _cairo_surface_flush
    at cairo-surface.c line 1488
  • #15 _cairo_surface_finish_snapshots
    at cairo-surface.c line 994
  • #16 cairo_surface_destroy
    at cairo-surface.c line 938
  • #17 gdk_window_create_similar_image_surface
    at gdkwindow.c line 9351
  • #18 gdk_cairo_surface_create_from_pixbuf
    at gdkcairo.c line 296
  • #19 ensure_surface_from_pixbuf
    at gtkiconhelper.c line 591
  • #20 _gtk_icon_helper_ensure_surface
    at gtkiconhelper.c line 736
  • #21 _gtk_icon_helper_get_size
    at gtkiconhelper.c line 783
  • #22 gtk_image_get_preferred_size
    at gtkimage.c line 1525
  • #23 gtk_image_get_preferred_width
    at gtkimage.c line 1703
  • #24 gtk_widget_query_size_for_orientation
    at gtksizerequest.c line 180
  • #25 gtk_widget_compute_size_for_orientation
    at gtksizerequest.c line 390
  • #26 gtk_widget_get_preferred_width
    at gtksizerequest.c line 490
  • #27 gtk_box_get_size
    at gtkbox.c line 1112
  • #28 gtk_box_get_preferred_width
    at gtkbox.c line 1210
  • #29 gtk_widget_query_size_for_orientation
    at gtksizerequest.c line 180
  • #30 gtk_widget_compute_size_for_orientation
    at gtksizerequest.c line 390
  • #31 gtk_widget_get_preferred_width
    at gtksizerequest.c line 490
  • #32 gtk_box_get_size
    at gtkbox.c line 1112
  • #33 gtk_box_get_preferred_width
    at gtkbox.c line 1210
  • #34 gtk_widget_query_size_for_orientation
    at gtksizerequest.c line 180
  • #35 gtk_widget_compute_size_for_orientation
    at gtksizerequest.c line 390
  • #36 gtk_widget_get_preferred_width
    at gtksizerequest.c line 490
  • #37 gtk_box_get_size
    at gtkbox.c line 1112
  • #38 gtk_box_get_preferred_width
    at gtkbox.c line 1210
  • #39 gtk_widget_query_size_for_orientation
    at gtksizerequest.c line 180
  • #40 gtk_widget_compute_size_for_orientation
    at gtksizerequest.c line 390
  • #41 gtk_widget_get_preferred_width
    at gtksizerequest.c line 490
  • #42 gtk_box_get_size
    at gtkbox.c line 1112
  • #43 gtk_box_get_preferred_width
    at gtkbox.c line 1210
  • #44 gtk_widget_query_size_for_orientation
    at gtksizerequest.c line 180
  • #45 gtk_widget_compute_size_for_orientation
    at gtksizerequest.c line 390
  • #46 gtk_widget_get_preferred_width
    at gtksizerequest.c line 490
  • #47 _gtk_widget_get_preferred_size_for_size
    at gtksizerequest.c line 869
  • #48 gtk_paned_get_preferred_size_for_orientation
    at gtkpaned.c line 955
  • #49 gtk_paned_get_preferred_size
    at gtkpaned.c line 1047
  • #50 gtk_paned_get_preferred_width
    at gtkpaned.c line 1057
  • #51 gtk_widget_query_size_for_orientation
    at gtksizerequest.c line 180
  • #52 gtk_widget_compute_size_for_orientation
    at gtksizerequest.c line 390
  • #53 gtk_widget_get_preferred_width
    at gtksizerequest.c line 490
  • #54 gtk_box_get_size
    at gtkbox.c line 1112
  • #55 gtk_box_get_preferred_width
    at gtkbox.c line 1210
  • #56 gtk_widget_query_size_for_orientation
    at gtksizerequest.c line 180
  • #57 gtk_widget_compute_size_for_orientation
    at gtksizerequest.c line 390
  • #58 gtk_widget_get_preferred_width
    at gtksizerequest.c line 490
  • #59 gtk_box_get_size
    at gtkbox.c line 1112
  • #60 gtk_box_get_preferred_width
    at gtkbox.c line 1210
  • #61 gtk_widget_query_size_for_orientation
    at gtksizerequest.c line 180
  • #62 gtk_widget_compute_size_for_orientation
    at gtksizerequest.c line 390
  • #63 gtk_widget_get_preferred_width
    at gtksizerequest.c line 490
  • #64 gtk_box_get_size
    at gtkbox.c line 1112
  • #65 gtk_box_get_preferred_width
    at gtkbox.c line 1210
  • #66 gtk_widget_query_size_for_orientation
    at gtksizerequest.c line 180
  • #67 gtk_widget_compute_size_for_orientation
    at gtksizerequest.c line 390
  • #68 gtk_widget_get_preferred_width
    at gtksizerequest.c line 490
  • #69 gtk_box_get_size
    at gtkbox.c line 1112
  • #70 gtk_box_get_preferred_width
    at gtkbox.c line 1210
  • #71 gtk_widget_query_size_for_orientation
    at gtksizerequest.c line 180
  • #72 gtk_widget_compute_size_for_orientation
    at gtksizerequest.c line 390
  • #73 gtk_widget_get_preferred_width
    at gtksizerequest.c line 490
  • #74 gtk_window_get_preferred_width
    at gtkwindow.c line 7844
  • #75 gtk_widget_query_size_for_orientation
    at gtksizerequest.c line 180
  • #76 gtk_widget_compute_size_for_orientation
    at gtksizerequest.c line 390
  • #77 gtk_widget_get_preferred_width
    at gtksizerequest.c line 490
  • #78 _gtk_widget_get_preferred_size_and_baseline
    at gtksizerequest.c line 683
  • #79 gtk_widget_get_preferred_size
    at gtksizerequest.c line 748
  • #80 gtk_window_compute_hints
    at gtkwindow.c line 9189
  • #81 gtk_window_compute_configure_request
    at gtkwindow.c line 8544
  • #82 gtk_window_move_resize
    at gtkwindow.c line 8774
  • #83 gtk_window_check_resize
    at gtkwindow.c line 7596
  • #84 _g_closure_invoke_va
  • #85 g_signal_emit_valist
  • #86 g_signal_emit
  • #87 gtk_container_check_resize
    at gtkcontainer.c line 1865
  • #88 gtk_container_idle_sizer
    at gtkcontainer.c line 1701
  • #89 _g_closure_invoke_va
  • #90 g_signal_emit_valist
  • #91 g_signal_emit_by_name
  • #92 gdk_frame_clock_paint_idle
    at gdkframeclockidle.c line 408
  • #93 gdk_threads_dispatch
    at gdk.c line 804
  • #94 g_timeout_dispatch
  • #95 g_main_context_dispatch
  • #96 g_main_context_iterate
  • #97 g_main_context_iteration
  • #98 g_application_run
  • #99 main

Other apps crash in a similar fashion:

1) evince crashes on start up
2) gnumeric crashs inserting an image into a spreadsheet

Reverting to gtk+ 3.8.5 or earlier fixes all problems

Platform information:

MacPorts 2.2.0
Mac OS X 10.8.5
Xcode 5.0

Using XQuartz 2.7.4 (xorg-server 1.13.0) X11 Server
MacPorts xorg-libX11 1.6.2
         xorg-libExt 1.3.2
         glib2   2.38.1
         cairo   1.12.16 (x11 backend)
         gtk3    3.10.0, 3.10.1, 3.10.2 (x11 backend)


Any help tracing down the cause of this problem would be appreciated.
Currently blocking upgrade of MacPorts to GNOME 3.8/3.10.
Comment 1 David Evans 2013-10-18 18:56:24 UTC
After further testing and bisection of commits, it appears that this problem first appeared between 3.9.6
and 3.9.8 with commit

https://git.gnome.org/browse/gtk+/commit/?id=8524e0c1507043c6c230828493e52ce666e67a5a

which adds gdk_cairo_surface_create_from_pixbuf and then modifies gdk_cairo_set_source_pixbuf to use it.
Comment 2 David Evans 2013-10-19 17:19:49 UTC
Latest testing shows that this problem is not directly caused by gtk+ (although the commit above triggered it) but to the internal workings of cairo having to do with its optional xcb-shm functions.

The current MacPorts build of cairo enables these functions.  Disabling them fixes the problem reported here.

See MacPorts ticket https://trac.macports.org/ticket/40811.