Public bug reported: orca's clipboard presenter calls Atspi.EventListener.deregister() without guarding a closed AT-SPI connection. At logout/shutdown the AT-SPI bus is already gone, so the call raises:
GLib.GError: atspi_error: Connection is closed (1) and the exception escapes the GLib shutdown handler: /usr/bin/orca:gi.repository.GLib.GError:_glib_shutdown_handler:shutdown:deactivate apport records this as a crash. The exception also aborts the rest of shutdown(): the mouse presenter, presentation manager and device manager are not deactivated, systemd is not notified, the Atspi loop is not quit, and the 5-second SIGALRM set at the start of shutdown stays armed, so Orca can be SIGKILLed by its own timeout. Volume: 302 reports/week in the 26.04 release-scoped counter (a floor: 66% of the sampled incidents carry no DistroRelease; the sample-derived rate is ~169/day, ~1180/week). Affected versions in the sample: 50.3-0ubuntu0.1 (133), 50.2-0ubuntu0.1 (37), 50.1.2-1ubuntu1 (17) on 26.04, and 51.0-1ubuntu1 (13, including 26.10). Upstream fix: https://gitlab.gnome.org/GNOME/orca/-/merge_requests/297 (squash e3c8392eb66da4fa4d21837da8b6dadc1d54b153, closes issue #781). It guards the deregistration with "except GLib.GError" and logs the error with debug.print_tokens. The same change was cherry-picked to the gnome-51 branch as 249798a71f; tags 51.0-51.2 predate it, so 51.3 is the first upstream release with the guard. [Impact] Orca exits with a traceback at logout and files a crash report every time the screen reader is running. The rest of shutdown() is skipped, including the systemd STOPPING notification and Atspi.event_quit(), and the 5-second SIGALRM can SIGKILL Orca after the failed shutdown. The fix only wraps the deregistration in the same GLib.GError guard the event manager already uses. There is no behaviour change while the AT-SPI connection is alive. [Test Plan] 1. Headless function-level check (no GUI needed). Under dbus-run-session, activate the clipboard presenter, kill the private AT-SPI bus daemon, then call deactivate() exactly as shutdown() does. Unpatched: traceback "atspi_error: Connection is closed (1)" and non-zero exit. Patched: deactivate() returns cleanly and logs the guarded error at INFO level. 2. Real logout. On a desktop with the screen reader enabled (org.gnome.desktop.a11y.applications screen-reader-enabled true), log out of the session. Unpatched: a new orca crash report in /var/crash / apport plus the traceback in the journal. Patched: no new crash report, no GLib.GError, and orca exits without the 5-second SIGKILL. 3. Regression. With the patched package, copy text in a normal session and confirm Orca still announces clipboard text changes (the listener must still be registered while the connection is alive). [Where problems could occur] Only the shutdown deregistration is touched. A failure to catch a different exception type would still escape; the guard intentionally matches the event manager's existing GLib.GError handling. [Other Info] The Ubuntu packages still ship the single src/orca/clipboard.py module (deactivate() at :460 in 50.3 and :470 in 51.0); the split into clipboard_presenter.py happened after 51.1. The SRU patches therefore adapt the merged change to clipboard.py. debug.print_tokens has the same signature in both series. Versions: 26.04 resolute 50.3-0ubuntu0.1 -> 50.3-0ubuntu0.2; 26.10 stonking and 27.04 tenacious 51.0-1ubuntu1 -> 51.0-1ubuntu2 (tenacious is the devel-series fix). ** Affects: orca (Ubuntu) Importance: Medium Assignee: Chris Bainbridge (chris-bainbridge) Status: In Progress ** Affects: orca (Ubuntu Resolute) Importance: Medium Assignee: Chris Bainbridge (chris-bainbridge) Status: In Progress ** Affects: orca (Ubuntu Stonking) Importance: Medium Assignee: Chris Bainbridge (chris-bainbridge) Status: In Progress ** Affects: orca (Ubuntu Tenacious) Importance: Medium Assignee: Chris Bainbridge (chris-bainbridge) Status: In Progress ** Tags: desktop-needs-sru resolute stonking tenacious ** Changed in: orca (Ubuntu) Importance: Undecided => Medium ** Changed in: orca (Ubuntu Resolute) Importance: Undecided => Medium ** Changed in: orca (Ubuntu Stonking) Importance: Undecided => Medium ** Changed in: orca (Ubuntu) Status: New => In Progress ** Changed in: orca (Ubuntu Resolute) Status: New => In Progress ** Changed in: orca (Ubuntu Stonking) Status: New => In Progress ** Changed in: orca (Ubuntu) Assignee: (unassigned) => Chris Bainbridge (chris-bainbridge) ** Changed in: orca (Ubuntu Resolute) Assignee: (unassigned) => Chris Bainbridge (chris-bainbridge) ** Changed in: orca (Ubuntu Stonking) Assignee: (unassigned) => Chris Bainbridge (chris-bainbridge) ** Tags added: desktop-needs-sru resolute stonking tenacious -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/2190891 Title: orca crashed with gi.repository.GLib.GError in _glib_shutdown_handler() To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/orca/+bug/2190891/+subscriptions -- ubuntu-bugs mailing list [email protected] https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
