RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1880031 - libblockdev doesn't run external utilities with LC_ALL=C and fails to parse their localized output
Summary: libblockdev doesn't run external utilities with LC_ALL=C and fails to parse t...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: libblockdev
Version: 8.3
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: 8.0
Assignee: Vojtech Trefny
QA Contact: guazhang@redhat.com
URL:
Whiteboard:
Depends On:
Blocks: 1895286
TreeView+ depends on / blocked
 
Reported: 2020-09-17 14:53 UTC by Vojtech Trefny
Modified: 2021-09-06 15:26 UTC (History)
1 user (show)

Fixed In Version: libblockdev-2.24-2.el8
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 1895286 (view as bug list)
Environment:
Last Closed: 2021-05-18 15:42:31 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Vojtech Trefny 2020-09-17 14:53:18 UTC
We expect output of external utilities such as mkswap to be in English, but due to a bug in the libblockdev code, we do not run these with LC_ALL=C and on systems with non-English locale we fail to parse the localized output.
See the upstream fix for more details: https://github.com/storaged-project/libblockdev/pull/544

This bug was introduced in 2.24 available since 8.3

Simple reproducer:

with default/C locale:
$ sudo LC_ALL=C python3
>>> from gi.repository import BlockDev
>>> BlockDev.utils_check_util_version("mkswap", "2.23", "--version", "mkswap from util-linux ([\\d\\.]+)")
True

with different locale:
$ sudo LC_ALL=cs_CZ.UTF-8 python3
>>> from gi.repository import BlockDev
>>> BlockDev.utils_check_util_version("mkswap", "2.23", "--version", "mkswap from util-linux ([\\d\\.]+)")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
GLib.Error: g-bd-utils-exec-error-quark: Failed to determine mkswap's version from: mkswap z util-linux 2.32.1
 (4)

Comment 2 guazhang@redhat.com 2020-11-04 01:00:24 UTC
Hi,

which libblockdev will fix the issue ? we will start the testing because the ITM set 1.

Comment 3 guazhang@redhat.com 2020-11-04 06:22:17 UTC
Hello

Can not reproduce the bug with libblockdev-2.24-1.el8.x86_64, Could you help to check if something is wrong ?

[root@storageqe-70 ~]# sudo LC_ALL=C python3
Python 3.6.8 (default, Aug 18 2020, 08:33:21) 
[GCC 8.3.1 20191121 (Red Hat 8.3.1-5)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from gi.repository import BlockDev
__main__:1: PyGIWarning: BlockDev was imported without specifying a version first. Use gi.require_version('BlockDev', '2.0') .
>>> BlockDev.utils_check_util_version("mkswap", "2.23", "--version", "mkswap from util-linux ([\\d\\.]+)")
True
>>> 
[root@storageqe-70 ~]# sudo LC_ALL=cs_CZ.UTF-8 python3
Python 3.6.8 (default, Aug 18 2020, 08:33:21) 
[GCC 8.3.1 20191121 (Red Hat 8.3.1-5)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from gi.repository import BlockDev
__main__:1: PyGIWarning: BlockDev was imported without specifying a version first. Use gi.require_version('BlockDev', '2.0') .
>>> BlockDev.utils_check_util_version("mkswap", "2.23", "--version", "mkswap from util-linux ([\\d\\.]+)")
True
>>> 
[root@storageqe-70 ~]# 

[root@storageqe-70 ~]# rpm -qa |grep libblock
libblockdev-utils-2.24-1.el8.x86_64
libblockdev-2.24-1.el8.x86_64
[root@storageqe-70 ~]#

Comment 4 Vojtech Trefny 2020-11-05 08:22:42 UTC
(In reply to guazhang from comment #2)
> Hi,
> 
> which libblockdev will fix the issue ? we will start the testing because the
> ITM set 1.

2.24-2, I'm waiting for the RHEL 8.4 dist-git branch to be created and I'll do a build as soon as possible (DevTestDoc phase starts on Monday 2020-11-09 so I should be able to do the build on Monday).
I'm still new to this ITM concept, so if you think we should wait a little more or if you need more time for testing, feel free to move ITM to 2 or 3.

(In reply to guazhang from comment #3)
> Hello
> 
> Can not reproduce the bug with libblockdev-2.24-1.el8.x86_64, Could you help
> to check if something is wrong ?
> 

Make you sure you have "glibc-langpack-cs" installed.

Comment 5 guazhang@redhat.com 2020-11-05 08:40:14 UTC
Hi,

Yes, hit it after installed glibc-langpack-cs, and will move ITM to 3.

[root@storageqe-69 ~]# LC_ALL=cs_CZ.UTF-8 python3
Python 3.6.8 (default, Aug 18 2020, 08:33:21) 
[GCC 8.3.1 20191121 (Red Hat 8.3.1-5)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from gi.repository import BlockDev
__main__:1: PyGIWarning: BlockDev was imported without specifying a version first. Use gi.require_version('BlockDev', '2.0') before import to ensure that the right version gets loaded.
>>> BlockDev.utils_check_util_version("mkswap", "2.23", "--version", "mkswap from util-linux ([\\d\\.]+)")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
GLib.Error: g-bd-utils-exec-error-quark: Failed to determine mkswap's version from: mkswap z util-linux 2.32.1
 (4)
>>> 
[root@storageqe-69 ~]# rpm -qa | grep libblock
libblockdev-utils-2.24-1.el8.x86_64
libblockdev-2.24-1.el8.x86_64
[root@storageqe-69 ~]# rpm -qa | grep glibc-langpack-cs
glibc-langpack-cs-2.28-136.el8.x86_64
[root@storageqe-69 ~]#

Comment 11 guazhang@redhat.com 2020-11-12 02:44:49 UTC
Hi

Test pass with package libblockdev-2.24-2.el8.x86_64, move to verified.

Comment 13 errata-xmlrpc 2021-05-18 15:42:31 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (libblockdev bug fix and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2021:1820


Note You need to log in before you can comment on or make changes to this bug.