[Bug 2150181] Re: [SRU] software-properties-gtk driver detection fails with Python 3.14 (cannot pickle SoftwarePropertiesGtk)
Alessandro Astone
2150181 at bugs.launchpad.net
Wed May 6 14:35:45 UTC 2026
** Changed in: software-properties (Ubuntu Stonking)
Status: Confirmed => Fix Committed
--
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to software-properties in Ubuntu.
https://bugs.launchpad.net/bugs/2150181
Title:
[SRU] software-properties-gtk driver detection fails with Python 3.14
(cannot pickle SoftwarePropertiesGtk)
Status in software-properties package in Ubuntu:
Fix Committed
Status in software-properties source package in Resolute:
Confirmed
Status in software-properties source package in Stonking:
Fix Committed
Bug description:
[ Impact ]
The "Additional Drivers" tab in software-properties-gtk is completely
broken on Ubuntu 26.04 (Resolute). When a user opens the Additional
Drivers UI, it gets stuck on "Searching for available drivers..." and
never completes. The underlying error is a TypeError in the driver
detection thread.
Python 3.14 changed the default multiprocessing start method from
'fork' to 'forkserver'. The 'forkserver' method requires that the
Process object, its target function, and all arguments be
picklable. The detect_drivers code passes a bound method
(self.wrapper_system_device_drivers) as the process target and
pickling a bound method requires pickling the bound instance, which is
a SoftwarePropertiesGtk object containing GTK widgets that cannot be
pickled. Additionally, the apt_pkg.Cache argument is a C extension
object that also cannot be pickled.
The fix makes wrapper_system_device_drivers a @staticmethod (removing the
unpicklable SoftwarePropertiesGtk instance from the serialization path)
and moves apt cache creation into the subprocess itself rather than
passing it as an argument.
[ Test Plan ]
1. Install software-properties-gtk on Ubuntu 26.04 (with Python 3.14).
2. Launch Additional Drivers:
software-properties-gtk --open-tab=4
or:
gio launch /usr/share/applications/software-properties-drivers.desktop
3. Before the fix: the UI shows "Searching for available drivers..."
indefinitely, and the terminal prints:
TypeError: cannot pickle 'SoftwarePropertiesGtk' object
4. After the fix: the driver search completes and available drivers are
listed (or "No additional drivers available" is shown, depending on
hardware).
5. If drivers are listed, verify that selecting a different driver and
applying the change still works correctly.
6. Verify the Cancel button works during a search, and that Retry works
after cancellation.
[ Where problems could occur ]
The subprocess now creates its own apt_pkg.Cache instead of reusing the
parent's. If the apt cache state on disk is somehow inconsistent or
changes between when the parent reads it and when the subprocess reads
it, the subprocess could see a different set of packages. In practice
this is not a meaningful risk since the cache is only used for driver
detection, which is read-only, and the window between the two reads is
negligible.
The wrapper_system_device_drivers function now calls apt_pkg.init_config
and apt_pkg.init_system in the subprocess. If these behave differently
when called in a forkserver child versus a forked child (e.g. reading
different configuration), driver detection results could differ. These
functions are designed to be safe to call in fresh processes and are used
this way elsewhere in the codebase (init_apt_cache).
[ Other Info ]
The Qt frontend (software-properties-qt) calls
detect.system_device_drivers directly in a thread without using
multiprocessing, so it is not affected by this bug.
This is a compatibility fix for the Python 3.14 multiprocessing
behaviour change. After the 3.14 migration, no one had tested this tab
it seems (or had time to report a bug).
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/software-properties/+bug/2150181/+subscriptions
More information about the foundations-bugs
mailing list