Control Center crashes with SIGTRAP (from X11 MIT-SHM BadAlloc) on Applications view, in XShmCreatePixmap() from _cairo_xlib_shm_surface_create(width=242, height=43972)

Bug #1938494 reported by Brent Spillner
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
gnome-control-center (Ubuntu)
New
Low
Unassigned

Bug Description

1) Running AMD64 edition of Ubuntu 20.04.2 LTS; it is up-to-date with no pending updates from the main repo.

2) Specifically, have the amd64 build of gnome-control-center 1:3.36.5-0ubuntu2 installed. libgdk-pixbuf2.0-0 is version 2.40.0+dfsg-3ubuntu0.2, libcairo2 is 1.16.0-4ubuntu1, libgtk2.0-0 is 2.24.32-4ubuntu4 and libgtk-3-0 is 3.24.20-0ubuntu1.

3) What I expected to happen: possible to navigate between the "Applications" and other tabs of the Control Center without a crash.

4) What happens (100% reproducibly) instead: if the Control Center starts in any view except Applications, clicking on "Applications" in the selection pane causes an immediate application crash (hard exit) with the text below written to stderr. When the Control Center is restarted, the Applications pane is now loaded, and can be navigated as expected until I click the "<" in the top left of the window (to go back and select another category), whereupon it immediately crashes with the same error message quoted below.

Error message written to stderr in either case above:

Gdk-ERROR **: 22:18:27.542: The program 'gnome-control-center' received an X Window System error.
This probably reflects a bug in the program.
The error was 'BadAlloc (insufficient resources for operation)'.
  (Details: serial 47249 error_code 11 request_code 130 (MIT-SHM) minor_code 5)

From the backtrace below, it looks like this is possibly related to loading the pixmap for one of my application icons; I happen to have several applications with broken/missing icons (all Steam games), but don't have any problems viewing or starting those games from the Launcher, nor navigating to their settings when gnome-control-center launches in the Applications view (e.g. after the crash described above, or by manual selection on the command line). In any event, a Control Center crash for a missing or corrupted pixmap is not robust behavior.

Of note, line #14 in the backtrace (gdk_window_create_similar_surface) shows a "height" parameter of 43972, which may be unreasonably large in comparison to the width of 242 and possibly contributing to the BadAlloc. This machine has 16GB of RAM and no issues running much more demanding applications than the Control Center.

--- GDB stack trace follows ---

Thread 1 "gnome-control-c" hit Breakpoint 1, gdk_x_error (xdisplay=0x555555ac94f0,
    error=0x7fffffffc440) at ../../../../../gdk/x11/gdkmain-x11.c:271
271 ../../../../../gdk/x11/gdkmain-x11.c: No such file or directory.
(gdb) bt
#0 gdk_x_error (xdisplay=0x555555ac94f0, error=0x7fffffffc440)
    at ../../../../../gdk/x11/gdkmain-x11.c:271
#1 0x00007ffff6f4728b in _XError () at /lib/x86_64-linux-gnu/libX11.so.6
#2 0x00007ffff6f43ff7 in () at /lib/x86_64-linux-gnu/libX11.so.6
#3 0x00007ffff6f44095 in () at /lib/x86_64-linux-gnu/libX11.so.6
#4 0x00007ffff6f4501d in _XReply () at /lib/x86_64-linux-gnu/libX11.so.6
#5 0x00007ffff6f407f1 in XSync () at /lib/x86_64-linux-gnu/libX11.so.6
#6 0x00007ffff6f4088f in () at /lib/x86_64-linux-gnu/libX11.so.6
#7 0x00007ffff5c06116 in XShmCreatePixmap () at /lib/x86_64-linux-gnu/libXext.so.6
#8 0x00007ffff725fddd in _cairo_xlib_shm_surface_create
    (format=PIXMAN_a8r8g8b8, width=width@entry=242, height=height@entry=43972, will_sync=will_sync@entry=0, create_pixmap=4096, other=<optimized out>, other=<optimized out>)
    at ../../../../src/cairo-xlib-surface-shm.c:843
#9 0x00007ffff7260a08 in _cairo_xlib_surface_create_shm
    (other=other@entry=0x5555564558b0, format=<optimized out>, width=width@entry=242, height=height@entry=43972) at ../../../../src/cairo-xlib-surface-shm.c:1156
#10 0x00007ffff7260aa1 in _cairo_xlib_surface_create_similar_shm
    (other=0x5555564558b0, format=CAIRO_FORMAT_ARGB32, width=242, height=43972)
    at ../../../../src/cairo-xlib-surface-shm.c:1181
#11 0x00007ffff7233f6b in INT_cairo_surface_create_similar_image
    (height=43972, width=242, format=CAIRO_FORMAT_ARGB32, other=<optimized out>)
    at ../../../../src/cairo-surface.c:595
#12 INT_cairo_surface_create_similar_image
    (other=<optimized out>, format=CAIRO_FORMAT_ARGB32, width=242, height=43972)
    at ../../../../src/cairo-surface.c:576
#13 0x00007ffff7234157 in cairo_surface_create_similar
    (other=other@entry=0x5555564558b0, content=content@entry=CAIRO_CONTENT_COLOR_ALPHA, width=width@entry=242, height=height@entry=43972) at ../../../../src/cairo-surface.c:518
#14 0x00007ffff73bfb99 in gdk_window_create_similar_surface
    (window=0x555556e7c290, content=content@entry=CAIRO_CONTENT_COLOR_ALPHA, width=width@entry=242, height=height@entry=43972) at ../../../../gdk/gdkwindow.c:10187
#15 0x00007ffff7760cbc in gtk_stack_render
    (gadget=<optimized out>, cr=0x5555574f86c0, x=<optimized out>, y=<optimized out>, width=<optimized out>, height=<optimized out>, data=0x0) at ../../../../gtk/gtkstack.c:2159
#16 0x00007ffff75f1601 in gtk_css_custom_gadget_draw
    (gadget=<optimized out>, cr=<optimized out>, x=<optimized out>, y=<optimized out>, width=<optimized out>, height=<optimized out>) at ../../../../gtk/gtkcsscustomgadget.c:159
#17 0x00007ffff75f649c in gtk_css_gadget_draw (gadget=0x55555663a470, cr=0x5555574f86c0)
    at ../../../../gtk/gtkcssgadget.c:885
#18 0x00007ffff77605e9 in gtk_stack_draw (widget=<optimized out>, cr=<optimized out>)
    at ../../../../gtk/gtkstack.c:2119
#19 0x00007ffff780bd04 in gtk_widget_draw_internal
    (clip_to_size=1, cr=0x5555574f86c0, widget=0x5555566441c0)
    at ../../../../gtk/gtkwidget.c:7080
#20 gtk_widget_draw_internal
    (widget=widget@entry=0x5555566441c0, cr=cr@entry=0x5555574f86c0, clip_to_size=clip_to_size@entry=1) at ../../../../gtk/gtkwidget.c:7018
#21 0x00007ffff75ec28b in gtk_container_propagate_draw
    (container=container@entry=0x555555adeda0, child=0x5555566441c0, cr=cr@entry=0x5555574f86c0) at ../../../../gtk/gtkcontainer.c:3853
#22 0x00007ffff75ec35d in gtk_container_draw (widget=0x555555adeda0, cr=0x5555574f86c0)
    at ../../../../gtk/gtkcontainer.c:3673
--Type <RET> for more, q to quit, c to continue without paging--
#23 0x00007ffff7712391 in _gtk_pixel_cache_repaint
    (view_rect=0x7fffffffcd30, view_rect=0x7fffffffcd30, canvas_rect=0x7fffffffcd40, canvas_rect=0x7fffffffcd40, user_data=0x555555adeda0, draw=0x7ffff77fc7b0 <draw_bin>, window=0x555556e7c290, cache=0x555556637da0) at ../../../../gtk/gtkpixelcache.c:358
#24 _gtk_pixel_cache_draw
    (cache=0x555556637da0, cr=cr@entry=0x555557549d70, window=0x555556e7c290, view_rect=view_rect@entry=0x7fffffffcd30, canvas_rect=canvas_rect@entry=0x7fffffffcd40, draw=draw@entry=0x7ffff77fc7b0 <draw_bin>, user_data=0x555555adeda0) at ../../../../gtk/gtkpixelcache.c:448
#25 0x00007ffff77fc979 in gtk_viewport_render
    (gadget=<optimized out>, cr=0x555557549d70, x=<optimized out>, y=<optimized out>, width=<optimized out>, height=<optimized out>, data=0x0) at ../../../../gtk/gtkviewport.c:357
#26 0x00007ffff75f1601 in gtk_css_custom_gadget_draw
    (gadget=<optimized out>, cr=<optimized out>, x=<optimized out>, y=<optimized out>, width=<optimized out>, height=<optimized out>) at ../../../../gtk/gtkcsscustomgadget.c:159
#27 0x00007ffff75f649c in gtk_css_gadget_draw
    (gadget=0x555556656420, cr=cr@entry=0x555557549d70)
    at ../../../../gtk/gtkcssgadget.c:885
#28 0x00007ffff77fd6b1 in gtk_viewport_draw (widget=<optimized out>, cr=0x555557549d70)
    at ../../../../gtk/gtkviewport.c:946
#29 0x00007ffff780bd04 in gtk_widget_draw_internal
    (clip_to_size=1, cr=0x555557549d70, widget=0x555555adeda0)
    at ../../../../gtk/gtkwidget.c:7080
#30 gtk_widget_draw_internal
    (widget=widget@entry=0x555555adeda0, cr=cr@entry=0x555557549d70, clip_to_size=clip_to_size@entry=1) at ../../../../gtk/gtkwidget.c:7018
#31 0x00007ffff75ec28b in gtk_container_propagate_draw
    (container=container@entry=0x555556634530, child=0x555555adeda0, cr=cr@entry=0x555557549d70) at ../../../../gtk/gtkcontainer.c:3853
#32 0x00007ffff75ec35d in gtk_container_draw (widget=0x555556634530, cr=0x555557549d70)
    at ../../../../gtk/gtkcontainer.c:3673
#33 0x00007ffff77407cd in gtk_scrolled_window_render
    (gadget=<optimized out>, cr=0x555557549d70, x=<optimized out>, y=<optimized out>, width=<optimized out>, height=<optimized out>, data=0x0)
    at ../../../../gtk/gtkscrolledwindow.c:2103
#34 0x00007ffff75f1601 in gtk_css_custom_gadget_draw
    (gadget=<optimized out>, cr=<optimized out>, x=<optimized out>, y=<optimized out>, width=<optimized out>, height=<optimized out>) at ../../../../gtk/gtkcsscustomgadget.c:159
#35 0x00007ffff75f649c in gtk_css_gadget_draw (gadget=0x5555566318a0, cr=0x555557549d70)
    at ../../../../gtk/gtkcssgadget.c:885
#36 0x00007ffff773eaa5 in gtk_scrolled_window_draw
    (widget=<optimized out>, cr=<optimized out>) at ../../../../gtk/gtkscrolledwindow.c:3030
#37 0x00007ffff780bd04 in gtk_widget_draw_internal
    (clip_to_size=1, cr=0x555557549d70, widget=0x555556634530)
    at ../../../../gtk/gtkwidget.c:7080
#38 gtk_widget_draw_internal
    (widget=widget@entry=0x555556634530, cr=cr@entry=0x555557549d70, clip_to_size=clip_to_size@entry=1) at ../../../../gtk/gtkwidget.c:7018
#39 0x00007ffff75ec28b in gtk_container_propagate_draw
    (container=container@entry=0x5555565a7290, child=0x555556634530, cr=cr@entry=0x555557549d70) at ../../../../gtk/gtkcontainer.c:3853
#40 0x00007ffff75ec35d in gtk_container_draw
    (widget=0x5555565a7290, cr=cr@entry=0x555557549d70)
--Type <RET> for more, q to quit, c to continue without paging--
    at ../../../../gtk/gtkcontainer.c:3673
#41 0x00007ffff759cfd8 in gtk_box_draw_contents
    (gadget=<optimized out>, cr=0x555557549d70, x=<optimized out>, y=<optimized out>, width=<optimized out>, height=<optimized out>, unused=0x0) at ../../../../gtk/gtkbox.c:453
#42 0x00007ffff75f1601 in gtk_css_custom_gadget_draw
    (gadget=<optimized out>, cr=<optimized out>, x=<optimized out>, y=<optimized out>, width=<optimized out>, height=<optimized out>) at ../../../../gtk/gtkcsscustomgadget.c:159
#43 0x00007ffff75f649c in gtk_css_gadget_draw (gadget=0x5555565a5300, cr=0x555557549d70)
    at ../../../../gtk/gtkcssgadget.c:885
#44 0x00007ffff759f8f5 in gtk_box_draw (widget=<optimized out>, cr=<optimized out>)
    at ../../../../gtk/gtkbox.c:462
#45 0x00007ffff780bd04 in gtk_widget_draw_internal
    (clip_to_size=1, cr=0x555557549d70, widget=0x5555565a7290)
    at ../../../../gtk/gtkwidget.c:7080
#46 gtk_widget_draw_internal
    (widget=widget@entry=0x5555565a7290, cr=cr@entry=0x555557549d70, clip_to_size=clip_to_size@entry=1) at ../../../../gtk/gtkwidget.c:7018
#47 0x00007ffff75ec28b in gtk_container_propagate_draw
    (container=container@entry=0x5555565a7130, child=0x5555565a7290, cr=cr@entry=0x555557549d70) at ../../../../gtk/gtkcontainer.c:3853
#48 0x00007ffff75ec35d in gtk_container_draw
    (widget=0x5555565a7130, cr=cr@entry=0x555557549d70)
    at ../../../../gtk/gtkcontainer.c:3673
#49 0x00007ffff759cfd8 in gtk_box_draw_contents
    (gadget=<optimized out>, cr=0x555557549d70, x=<optimized out>, y=<optimized out>, width=<optimized out>, height=<optimized out>, unused=0x0) at ../../../../gtk/gtkbox.c:453
#50 0x00007ffff75f1601 in gtk_css_custom_gadget_draw
    (gadget=<optimized out>, cr=<optimized out>, x=<optimized out>, y=<optimized out>, width=<optimized out>, height=<optimized out>) at ../../../../gtk/gtkcsscustomgadget.c:159
#51 0x00007ffff75f649c in gtk_css_gadget_draw (gadget=0x5555565a5180, cr=0x555557549d70)
    at ../../../../gtk/gtkcssgadget.c:885
#52 0x00007ffff759f8f5 in gtk_box_draw (widget=<optimized out>, cr=<optimized out>)
    at ../../../../gtk/gtkbox.c:462
#53 0x00007ffff780bd04 in gtk_widget_draw_internal
    (clip_to_size=1, cr=0x555557549d70, widget=0x5555565a7130)
    at ../../../../gtk/gtkwidget.c:7080
#54 gtk_widget_draw_internal
    (widget=widget@entry=0x5555565a7130, cr=cr@entry=0x555557549d70, clip_to_size=clip_to_size@entry=1) at ../../../../gtk/gtkwidget.c:7018
#55 0x00007ffff75ec28b in gtk_container_propagate_draw
    (container=container@entry=0x5555565982a0, child=0x5555565a7130, cr=cr@entry=0x555557549d70) at ../../../../gtk/gtkcontainer.c:3853
#56 0x00007ffff75ec35d in gtk_container_draw (widget=0x5555565982a0, cr=0x555557549d70)
    at ../../../../gtk/gtkcontainer.c:3673
#57 0x00007ffff781a7c5 in gtk_window_draw (widget=0x5555565982a0, cr=0x555557549d70)
    at ../../../../gtk/gtkwindow.c:10635
#58 0x00007ffff780bd04 in gtk_widget_draw_internal
    (clip_to_size=<optimized out>, cr=0x555557549d70, widget=0x5555565982a0)
    at ../../../../gtk/gtkwidget.c:7080
#59 gtk_widget_draw_internal
    (widget=0x5555565982a0, cr=0x555557549d70, clip_to_size=<optimized out>)
    at ../../../../gtk/gtkwidget.c:7018
--Type <RET> for more, q to quit, c to continue without paging--
#60 0x00007ffff7815050 in gtk_widget_render
    (widget=widget@entry=0x5555565982a0, window=0x5555571523b0, region=<optimized out>)
    at ../../../../gtk/gtkwidget.c:17606
#61 0x00007ffff76be3b4 in gtk_main_do_event (event=0x7fffffffd840)
    at ../../../../gtk/gtkmain.c:1843
#62 gtk_main_do_event (event=<optimized out>) at ../../../../gtk/gtkmain.c:1690
#63 0x00007ffff73a6f79 in _gdk_event_emit (event=event@entry=0x7fffffffd840)
    at ../../../../gdk/gdkevents.c:73
#64 0x00007ffff73b82e1 in _gdk_window_process_updates_recurse_helper
    (window=0x5555571523b0, expose_region=<optimized out>)
    at ../../../../gdk/gdkwindow.c:3874
#65 0x00007ffff73b94b5 in gdk_window_process_updates_internal (window=0x5555571523b0)
    at ../../../../gdk/gdkwindow.c:4020
#66 0x00007ffff73b9674 in gdk_window_process_updates_with_mode
    (recurse_mode=<optimized out>, window=<optimized out>)
    at ../../../../gdk/gdkwindow.c:4215
#67 gdk_window_process_updates_with_mode
    (window=<optimized out>, recurse_mode=<optimized out>)
    at ../../../../gdk/gdkwindow.c:4186
#68 0x00007ffff7d5da56 in () at /lib/x86_64-linux-gnu/libgobject-2.0.so.0
#69 0x00007ffff7d7cb48 in g_signal_emit_valist ()
    at /lib/x86_64-linux-gnu/libgobject-2.0.so.0
#70 0x00007ffff7d7d0f3 in g_signal_emit () at /lib/x86_64-linux-gnu/libgobject-2.0.so.0
#71 0x00007ffff73b03b3 in _gdk_frame_clock_emit_paint (frame_clock=<optimized out>)
    at ../../../../gdk/gdkframeclock.c:643
#72 0x00007ffff73b0cf3 in gdk_frame_clock_paint_idle (data=0x555555b0c640)
    at ../../../../gdk/gdkframeclockidle.c:450
#73 0x00007ffff739af4d in gdk_threads_dispatch (data=0x555555ff46e0)
    at ../../../../gdk/gdk.c:769
#74 0x00007ffff7c72be8 in () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#75 0x00007ffff7c7204e in g_main_context_dispatch ()
    at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#76 0x00007ffff7c72400 in () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#77 0x00007ffff7c724a3 in g_main_context_iteration ()
    at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#78 0x00007ffff7e8bfe5 in g_application_run () at /lib/x86_64-linux-gnu/libgio-2.0.so.0
#79 0x00005555555bc8a9 in main (argc=<optimized out>, argv=<optimized out>)
    at ../shell/main.c:70

ProblemType: Bug
DistroRelease: Ubuntu 20.04
Package: gnome-control-center 1:3.36.5-0ubuntu2
ProcVersionSignature: Ubuntu 5.11.0-7614.15~1618626693~20.04~ecb25cd~dev-generic 5.11.13
Uname: Linux 5.11.0-7614-generic x86_64
NonfreeKernelModules: zfs zunicode zavl icp zcommon znvpair nvidia_modeset nvidia
ApportVersion: 2.20.11-0ubuntu27.18
Architecture: amd64
CasperMD5CheckResult: skip
CurrentDesktop: ubuntu:GNOME
Date: Thu Jul 29 22:38:40 2021
InstallationDate: Installed on 2020-09-23 (309 days ago)
InstallationMedia: Ubuntu 20.04.1 LTS "Focal Fossa" - Release amd64 (20200731)
SourcePackage: gnome-control-center
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
Brent Spillner (spillner) wrote :
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Looks like it's trying to create a window that's 242x43972 pixels so unsurprising that might fail.

Revision history for this message
Sebastien Bacher (seb128) wrote :

Thank you for the report but it would be easier to debug knowing which software is creating the issue. Could also maybe report it directly upstream on https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues ?

Changed in gnome-control-center (Ubuntu):
importance: Undecided → Low
Revision history for this message
Brent Spillner (spillner) wrote :

I'm not sure what you mean by "which software is creating the issue"--- the crashing process is gnome-control-center; everything else on the system is stable.

I agree that it's not completely surprising that a request for a 242x43972 pixbuf might fail; it is surprising to me that the Control Center would request a 242x43972 pixbuf in the first place (screen hardware resolution and virtual desktop are both 1920x1080), and it's disappointing that the application doesn't deal more gracefully with a failed pixbuf allocation for whatever reason.

i.e. I suspect that there are two separate bugs here, the failure to check the return value from gdk_pixbuf_new() (or related helper function), and the computation of the required pixbuf size in the first place. The request is probably for the application icon ribbon, but a height of 43972 would be enough to stack 458 96-pixel icons--- surely not all of those need to be in the display surface at one time.

I will open an upstream ticket; started here because I used the Ubuntu crash reporter and it looked like it might be a library incompatibility issue.

Revision history for this message
Brent Spillner (spillner) wrote :

s/pixbuf/window/, looking at the backtrace--- been so long I forgot the details.

Revision history for this message
Sebastien Bacher (seb128) wrote :

> I'm not sure what you mean by "which software is creating the issue"--- the crashing process is gnome-control-center;

Right, but it seems it's failing to compute valid requests for one of the items in the 'applications' list, knowing which one would perhaps make it possible to get a testcase for others, it's always easier to fix an issue when you can trigger it locally and poke at what is wrong

summary: Control Center crashes with SIGTRAP (from X11 MIT-SHM BadAlloc) on
- Applications view
+ Applications view, in XShmCreatePixmap() from
+ _cairo_xlib_shm_surface_create(width=242, height=43972)
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.