Public bug reported:

[ Impact ]

software-properties-gtk crashes with a TypeError when a user clicks the
"Continue using a manually installed driver" radio button on the
Additional Drivers tab. This occurs because the section name check on
line 1700 uses the misspelled string 'manually_install' instead of
'manually_installed'. As a result, the manually_installed section falls
through to the wrong branch, which connects the signal with the dict key
True (a boolean) as the pkg_name argument. When the callback runs,
self.apt_cache[True] raises "TypeError: Expected a string or a pair of
strings".

This appears to be a long-standing typo that has existed since the drivers tab 
was
first added in 2012, and was carried forward into the GTK4 port. The
same typo was fixed in the Qt frontend in version 0.120 (commit
dacd46d) but the GTK fix was missed. Any user with a manually installed
driver will hit this crash when interacting with the Additional Drivers
tab.

[ Test Plan ]

1. Install software-properties-gtk (version with the bug).
2. Have a device that uses a manually installed driver (e.g. a device
   where ubuntu-drivers detects manual_install=True, such as certain
   Intel IPU devices).
3. Open software-properties-gtk and navigate to the "Additional Drivers"
   tab.
4. Observe the radio button "Continue using a manually installed driver"
   is shown.
5. Click the "Do not use the device" radio button, then click back on
   "Continue using a manually installed driver".
6. With the bug present: software-properties-gtk crashes with:
     TypeError: Expected a string or a pair of strings
7. With the fix applied: the radio button selection changes without
   error and the driver action status updates correctly.

[ Where problems could occur ]

The change modifies a string comparison that controls which code path is
taken when connecting signal handlers for driver radio buttons. If the
fix were somehow wrong (e.g. a further typo), the manually_installed
section's radio button could either:

- Be connected with a pkg_name argument when it shouldn't be, leading to
  the same or a similar crash (the current broken behaviour).
- Fail to connect the signal at all, making the radio button
  non-functional.

However, the fix simply aligns the GTK code with the Qt code where the
identical fix was already applied and verified in version 0.120. The
corrected string 'manually_installed' matches the section key used in
the dict defined at line 1566 and referenced in the loop at line 1688,
so there is no ambiguity about the correct value.

[ Other Info ]

The Qt frontend had the same typo and it was corrected in version 0.120
(commit dacd46d, LP: #2147067). This fix applies the identical
correction to the GTK frontend. The Qt fix in that commit can serve as
prior art that this change is safe.

** Affects: software-properties (Ubuntu)
     Importance: High
     Assignee: Charles (charles05)
         Status: In Progress


** Tags: resolute stonking

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

Title:
  [SRU] Crash on selecting manually installed driver: 'manually_install'
  typo in show_drivers

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/software-properties/+bug/2151292/+subscriptions


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

Reply via email to