Public bug reported:

Title
Gnumeric toolbar icons fail to render (g_object_unref assertion in goffice's 
go_combo_pixmaps_add_element via GtkUIManager)

Summary
After a recent update, Gnumeric's toolbar icons fail to render — some appear
completely blank, others show as faint/ghosted placeholders — regardless of
which GTK icon theme is active (reproduced with both Papirus and Humanity;
switching to Adwaita does not fix it). This appears to be a regression
triggered by GTK3 behavior that libgoffice's legacy GtkUIManager-based
toolbar construction code does not handle correctly, specifically around
`go_combo_pixmaps_add_element()`.

Environment
- Ubuntu release: 24.04 (noble)
- gtk+3.0 / libgtk-3-0t64 version: 3.24.41-4ubuntu1.3
- libgoffice-0.10-10t64 version: 0.10.56-2.1build2
- gnumeric version: [FILL IN — output of `gnumeric --version`]
- Icon themes tested: Papirus, Humanity, Adwaita (all affected)
- Session: X11, local (not remote/SSH/VNC), GDK_BACKEND unset

Steps to reproduce
1. Install/launch Gnumeric on an up-to-date Ubuntu 24.04 system with the
   Papirus or Humanity icon theme active.
2. Observe that several toolbar buttons — notably the dropdown/combo-style
   items such as sort direction, borders, and alignment — render blank or
   as faint placeholder glyphs instead of their icons.
3. Switch the system icon theme to Adwaita and relaunch Gnumeric. The
   problem persists unchanged.

Diagnosis performed
- Ruled out icon theme fallback/inheritance issues: switching the active
  icon theme to Adwaita has no effect.
- Ruled out a missing or broken icon cache: `icon-theme.cache` files for
  both `hicolor` and `Adwaita` exist, are current, and have correct
  ownership/permissions (root:root, 644).
- Ruled out gdk-pixbuf/librsvg SVG decoding as the cause: loading the
  affected icon files directly via `GdkPixbuf.Pixbuf.new_from_file()` in
  Python succeeds and returns a valid pixbuf object.
- `strace -f -e trace=openat` on the affected process shows the icon SVG
  files (e.g. `edit-cut.svg`, `view-sort-ascending.svg`) being located and
  opened successfully (fd returned, no ENOENT) — the failure occurs after
  the file is opened, not during lookup.
- Console output shows a flood of the following at startup, matching the
  affected icons:

  GLib-GObject-CRITICAL **: g_object_unref: assertion 'G_IS_OBJECT
(object)' failed

  and

  Gdk-CRITICAL **: gdk_cursor_new_from_surface: assertion 'surface !=
NULL' failed

- A `gdb` backtrace captured at the first critical shows the failure
  originates in libgoffice, called from GTK's deprecated `GtkUIManager`
  toolbar-construction path:

  #0  g_logv () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
  #1  g_log () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
  #2  go_combo_pixmaps_add_element () at /lib/libgoffice-0.10.so.10
  #3  ??? () at /lib/libgoffice-0.10.so.10
  #4  ??? () at /lib/libgoffice-0.10.so.10
  #5  gtk_action_create_tool_item () at /lib/x86_64-linux-gnu/libgtk-3.so.0
  #6  ??? () at /lib/x86_64-linux-gnu/libgtk-3.so.0
  #7  ??? () at /lib/x86_64-linux-gnu/libgtk-3.so.0
  #8  ??? () at /lib/x86_64-linux-gnu/libgtk-3.so.0
  #9  gtk_ui_manager_ensure_update () at /lib/x86_64-linux-gnu/libgtk-3.so.0
  #10 ??? () at /lib/libspreadsheet-1.12.56.so
  #11 g_type_create_instance () at /lib/x86_64-linux-gnu/libgobject-2.0.so.0
  #12 ??? () at /lib/x86_64-linux-gnu/libgobject-2.0.so.0
  #13 g_object_new_with_properties () at 
/lib/x86_64-linux-gnu/libgobject-2.0.so.0
  #14 g_object_new () at /lib/x86_64-linux-gnu/libgobject-2.0.so.0
  #15 wbc_gtk_new () at /lib/libspreadsheet-1.12.56.so
  #16 main ()


Suspected cause
`libgoffice` (0.10.56, unchanged for over a year) builds toolbar items via
the deprecated `GtkAction`/`GtkUIManager` APIs. Ubuntu's `gtk+3.0` package
carries a downstream-only patch not present upstream or in Debian:

uimanager-guard-against-nested-node-updates.patch

This patch changes behavior inside `GtkUIManager`'s update/node-rebuild
path — exactly the call path in the backtrace above
(`gtk_ui_manager_ensure_update` → `gtk_action_create_tool_item`). It's
suspected that this patch altered the timing/ordering of tool item
construction or finalization in a way that `go_combo_pixmaps_add_element()`
does not tolerate, causing it to call `g_object_unref()` on something that
is no longer (or never was) a valid `GObject` at that point, and to build
a `NULL` surface downstream (matching the `gdk_cursor_new_from_surface`
critical).

Since this patch is Ubuntu-specific, it would explain why the issue is
tied to "recent Ubuntu GTK3 changes" rather than being a general
upstream GTK3 or goffice regression.

Requested next steps
- Review `debian/patches/uimanager-guard-against-nested-node-updates.patch`
  in the Ubuntu `gtk+3.0` source package for behavior changes affecting
  `GtkUIManager` tool item construction/finalization ordering.
- Confirm whether this reproduces upstream (vanilla GTK3, or Debian's
  `gtk+3.0` without this patch) — if it does not, that would confirm the
  patch as the regression source.
- Consider whether `go_combo_pixmaps_add_element()` in goffice should be
  hardened regardless (null-check before unref) as a defensive fix, and
  cross-file against GNOME goffice
  (https://gitlab.gnome.org/GNOME/goffice/-/issues) for that purpose.

Attachments to include when filing
- Full `strace` output (or the relevant filtered excerpt)
- Screenshots showing the blank/ghosted icons (Papirus and Humanity)
- Output of `apt-cache policy gtk+3.0 libgoffice-0.10-10t64 gnumeric`

** Affects: gtk+3.0 (Ubuntu)
     Importance: Undecided
         Status: New

** Attachment added: "apt-cache policy gtk+3.0 libgoffice-0.10-10t64 gnumeric"
   
https://bugs.launchpad.net/bugs/2167140/+attachment/5999693/+files/apt-cache%20policy%20gtk+3.0%20libgoffice-0.10-10t64%20gnumeric.txt

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2167140

Title:
  Gtk3 gnumeric icon bug

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/gtk+3.0/+bug/2167140/+subscriptions


-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to