Public bug reported:
## Description
The function `_get_distro_info()` in `/usr/lib/python3/dist-
packages/lsb_release.py` (line 48) crashes with a ValueError when
sorting release entries. It calls `float()` on version strings from
`/usr/share/distro-info/ubuntu.csv` that contain the " LTS" suffix.
11 out of 23 Ubuntu versions in ubuntu.csv trigger this crash:
"6.06 LTS", "8.04 LTS", "10.04 LTS", "12.04 LTS", "14.04 LTS", "16.04 LTS",
"18.04 LTS", "20.04 LTS", "22.04 LTS", "24.04 LTS", "26.04 LTS"
## Buggy code (line 48):
RELEASES_ORDER.sort(key=lambda n: float(n[0]))
## Traceback:
ValueError: could not convert string to float: '6.06 LTS'
## Steps to reproduce:
python3 -c "import lsb_release;
lsb_release._get_distro_info('Ubuntu')"
Or trigger via dpkg when a package using lsb_release needs
reconfiguration:
sudo dpkg-reconfigure pop-default-settings
## Impact:
This bug is latent — it only triggers when _get_distro_info() is called
during package installation/configuration. However, if dpkg is
interrupted (e.g., disk full during apt upgrade), packages are left
"unconfigured". On next boot, the system tries to configure them, hits
this ValueError, and any dependent service (like GDM) fails to start.
systemd then restarts GDM in a loop, writing thousands of lines per
minute to /var/log/auth.log. In our case this produced a 7.8 GB auth.log
file, filling the disk completely and making the system unbootable
without rescue mode.
## Proposed fix (one-line change, line 48):
# Before (buggy):
RELEASES_ORDER.sort(key=lambda n: float(n[0]))
# After (fixed):
RELEASES_ORDER.sort(key=lambda n: float(n[0].split()[0]))
str.split()[0] extracts only the numeric portion before the " LTS"
suffix.
## Environment:
- Package: lsb-release 11.1.0ubuntu4
- Data: distro-info-data 0.52ubuntu0.11
- OS: Pop!_OS 22.04 LTS (Ubuntu 22.04 Jammy derivative)
- Kernel: 6.17.9-76061709-generic
- Likely affects all Ubuntu 22.04+ derivatives using the same lsb-release
package.
## Reporter
Discovered and patched by Aramis Antonio Jakolic (khonaramis)
** Affects: lsb-release (Ubuntu)
Importance: Undecided
Status: New
--
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2141883
Title:
lsb_release.py: ValueError in _get_distro_info() - float() fails on
"LTS" version strings from ubuntu.csv
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/lsb-release/+bug/2141883/+subscriptions
--
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs