update-manager crashed with TypeError in _look_busy(): constructor returned NULL

Bug #2054197 reported by Celio Pineda R
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
update-manager (Ubuntu)
Fix Released
Medium
Nathan Teodosio

Bug Description

  File "/usr/lib/python3/dist-packages/UpdateManager/UpdateManager.py", line 357, in _look_busy
    self.get_window().set_cursor(Gdk.Cursor.new(Gdk.CursorType.WATCH))
                                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: constructor returned NULL

ProblemType: Crash
DistroRelease: Ubuntu 24.04
Package: update-manager 1:24.04.4
ProcVersionSignature: Ubuntu 6.6.0-14.14-generic 6.6.3
Uname: Linux 6.6.0-14-generic x86_64
ApportVersion: 2.27.0-0ubuntu6
Architecture: amd64
CasperMD5CheckResult: pass
CrashCounter: 1
CurrentDesktop: GNOME
Date: Sat Feb 17 09:26:44 2024
ExecutablePath: /usr/bin/update-manager
GsettingsChanges:
 b'com.ubuntu.update-manager' b'first-run' b'false'
 b'com.ubuntu.update-manager' b'launch-count' b'178'
 b'com.ubuntu.update-manager' b'launch-time' b'int64 1708179933'
InstallationDate: Installed on 2023-10-01 (139 days ago)
InstallationMedia: Ubuntu 22.04 LTS "Jammy Jellyfish" - Release amd64 (20220419)
InterpreterPath: /usr/bin/python3.11
PackageArchitecture: all
ProcCmdline: /usr/bin/python3 /usr/bin/update-manager
ProcEnviron:
 LANG=es_CO.UTF-8
 LANGUAGE=es_CO:es
 PATH=(custom, no user)
 SHELL=/bin/bash
 XDG_RUNTIME_DIR=<set>
Python3Details: /usr/bin/python3.11, Python 3.11.8, python3-minimal, 3.11.4-5ubuntu1
PythonArgs: ['/usr/bin/update-manager']
PythonDetails: N/A
SourcePackage: update-manager
Title: update-manager crashed with TypeError in _look_busy(): constructor returned NULL
UpgradeStatus: No upgrade log present (probably fresh install)
UserGroups: adm cdrom dip lpadmin lxd plugdev sambashare sudo

Related branches

Revision history for this message
Celio Pineda R (celio-pineda) wrote :
tags: removed: need-duplicate-check
Changed in update-manager (Ubuntu):
importance: Undecided → Medium
Revision history for this message
Marc Deslauriers (mdeslaur) wrote : Bug is not a security issue

Thanks for taking the time to report this bug and helping to make Ubuntu better. We appreciate the difficulties you are facing, but this appears to be a "regular" (non-security) bug. I have unmarked it as a security issue since this bug does not show evidence of allowing attackers to cross privilege boundaries nor directly cause loss of data/privacy. Please feel free to report any other bugs you may find.

information type: Private Security → Public
Revision history for this message
Nathan Teodosio (nteodosio) wrote :

I can't reproduce this exact error, but I do get an error if the Gdk imported is version 4:

>>> from gi.repository import Gdk
<stdin>:1: PyGIWarning: Gdk was imported without specifying a version first. Use gi.require_version('Gdk', '4.0') before import to ensure that the right version gets loaded.
>>> Gdk.Cursor.new(Gdk.CursorType.WATCH)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: type object 'Cursor' has no attribute 'new'. Did you mean: 'newv'?

After all the new constructor only exists in Gdk 3.

I see two possible solutions:

1. Do as suggested and require the specific Gdk version with
   gi.require_version('Gdk', '3.0')

2. Use a constructor that exists in both Gdk versions:
   Gdk.Cursor.new_from_name("wait", None)

description: updated
Revision history for this message
Nathan Teodosio (nteodosio) wrote :

1. Testing that the other way around (3->4), I get

--->
% ./update-manager --data-dir=$PWD/data
Traceback (most recent call last):
  File "/home/nteodosio/canonical/ubuntu-pro/update-manager/./update-manager", line 38, in <module>
    from UpdateManager.UpdateManager import UpdateManager
  File "/home/nteodosio/canonical/ubuntu-pro/update-manager/UpdateManager/UpdateManager.py", line 24, in <module>
    gi.require_version('Gdk', '4.0')
  File "/usr/lib/python3/dist-packages/gi/__init__.py", line 113, in require_version
    raise ValueError('Namespace %s is already loaded with version %s' %
ValueError: Namespace Gdk is already loaded with version 3.0
<---

So I think this would just introduce such error in the other direction (4->3).

2. Actually the new_from_name constructor has different signatures in Gdk 3 and 4.

I also couldn't reproduce the issue in an unaltered Noble beta ISO.

As such, I suggest to let this sit unattended until confirmed.

Revision history for this message
Nathan Teodosio (nteodosio) wrote :

> So I think this would just introduce such error in the other direction (4->3).

That was a short-sighted conclusion, adding the require_version to the entry point script will do.

Changed in update-manager (Ubuntu):
status: New → Fix Committed
assignee: nobody → Nathan Teodosio (nteodosio)
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package update-manager - 1:24.04.5

---------------
update-manager (1:24.04.5) noble; urgency=medium

  * Require Gdk3, as at least one function is used that is not in Gdk4
    (LP: #2054197).
  * Run linting tests during build time as well.

  [ Calvin Mwadime ]
  * d/control: Depend on ubuntu-pro-client instead of ubuntu-advantage-tools.
    (LP: #2057559)

 -- Sebastien Bacher <email address hidden> Tue, 16 Apr 2024 11:38:56 +0200

Changed in update-manager (Ubuntu):
status: Fix Committed → Fix Released
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.