[Bug 2150178] Re: update-manager crashes due to Gtk.Window.run() in BuilderDialog

Nathan Teodosio 2150178 at bugs.launchpad.net
Fri Apr 24 11:45:13 UTC 2026


I think BuilderDialog.run() is dead code.

To whit, try to force it to run:

--- a/UpdateManager/Dialogs.py
+++ b/UpdateManager/Dialogs.py
@@ -71,6 +71,8 @@ class BuilderDialog(Dialog, Gtk.Alignment):
         builder = self._load_ui(ui_path, root_widget)
         self.add(builder.get_object(root_widget))
         self.show()
+        try: self.run()
+        except Exception as e: print(e)

     def _load_ui(self, path, root_widget, domain="update-manager"):
         builder = Gtk.Builder()


and Update Manager here would bail with

> 'InstallBackendAptdaemon' object has no attribute 'window_dialog'

or

> 'PartialUpgradeDialog' object has no attribute 'window_dialog'

so the proposed change would be innefective, because the problem happens
"earlier".

Now, why is this?

In BuilderDialog window_dialog can only come from

        builder = self._load_ui(ui_path, root_widget)

The only ui file with window_dialog is data/gtkbuilder/Dialog.ui, which
in turn is only sourced in InternalDialog, which in turn will call

        BuilderDialog.__init__(self, window_main, ui_path,
"pane_dialog")

Now this last argument "pane_dialog" is used as the root widget in the
BuilderDialog initializer, so anything above it is undefined, and
window_dialog is above it:

--> data/gtkbuilder/Dialog.ui <--
<?xml version="1.0" encoding="UTF-8"?>
<interface>
  <!-- interface-requires gtk+ 3.0 -->
  <object class="GtkWindow" id="window_dialog">
    <property name="can_focus">False</property>
    <child>
      <object class="GtkBox" id="pane_dialog">
        <property name="visible">True</property>


As such I conclude that window_dialog is stale and BuilderDialog.run() is unreachable code, which is backed by the lack of bug reports about it.

Note that the commit introducing the "# FIXME: THIS WILL CRASH!" is

  commit 1e05e074df519117e6686645f0d8f84b4c81457a
  Author: Dylan McCall <dylanmccall at ubuntu.com>
  Date:   Fri Feb 15 00:34:04 2013 -0800

Damn, freaking 2013! (:

So my suggestion would be to work on the removal of that run method as
well as from the stale window_dialog attribute instead.

** Summary changed:

- update-manager crashes due to Gtk.Window.run() in BuilderDialog
+ update-manager theoretically crashes due to Gtk.Window.run() in BuilderDialog

** Changed in: update-manager (Ubuntu)
   Importance: Undecided => Low

** Changed in: update-manager (Ubuntu)
       Status: New => Triaged

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

Title:
  update-manager theoretically crashes due to Gtk.Window.run() in
  BuilderDialog

Status in update-manager package in Ubuntu:
  Triaged

Bug description:
  In UpdateManager/Dialogs.py, BuilderDialog.run() calls
  self.window_dialog.run(), which causes a crash because
  Gtk.Window does not support the run() method (only Gtk.Dialog does).

  This leads to a runtime error when the dialog is shown.

  Proposed fix:
  Replace run() with show_all(), since update-manager already runs
  inside the GTK main loop.

  Patch attached.

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/update-manager/+bug/2150178/+subscriptions





More information about the foundations-bugs mailing list