GNOME Bugzilla – Bug 710319
eog and other GNOME apps crash with X11 error after upgrading to gtk+ 3.10 or later
Last modified: 2014-07-14 03:28:15 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
+ Trace 232627
Thread 1 (process 30123)
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.
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.
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.