-
Bug
-
Resolution: Unresolved
-
Undefined
-
rhel-10.2
-
None
-
Yes
-
None
-
rhel-base-utils-core
-
0
-
False
-
False
-
-
None
-
None
-
None
-
None
-
Unspecified
-
Unspecified
-
Unspecified
-
None
What were you trying to do that didn't work?
lscpu -J produce an invalid JSON for no NUMA machines
What is the impact of this issue to you?
fail kernel-qe test when do json.loads
Please provide the package NVR for which the bug is seen:
- rpm -qf /usr/bin/lscpu
util-linux-2.40.2-13.el10.aarch64 - uname -r
6.12.0-176.qcom.el10iv.aarch64How reproducible is this bug?:
100%
Steps to reproduce
- on a machine without numa, check 'lscpu -J'
# cat /sys/devices/soc0/machine SA8775P # numactl --hardware No NUMA available on this system # lscpu -J -b -e=cpu,core,node { "cpus": [ { "cpu": 0, "core": 0, "node": - ... },{ "cpu": 7, "core": 7, "node": - } ] }
2. try jq for this cmd:
# lscpu -J -b -e=cpu,core,node|jq jq: parse error: Invalid numeric literal at line 7, column 0
3. try json.load in our test:
cputopo_json_str, return_code = runcmd("lscpu -J -b -e=cpu,core,node") cputopo_orignal_dict = json.loads(cputopo_json_str) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib64/python3.12/json/__init__.py", line 346, in loads return _default_decoder.decode(s) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib64/python3.12/json/decoder.py", line 338, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib64/python3.12/json/decoder.py", line 356, in raw_decode raise JSONDecodeError("Expecting value", s, err.value) from None json.decoder.JSONDecodeError: Expecting value: line 6 column 18 (char 79)
Expected results
Should be able to parse as json, expected: "node": "-".
Actual results
There is a missing quotation in node:
broken: "node": -
Additional info:
1. test case worked before on rhivos(should be rhivos1.0+kernel_el9).
2. As consulted info from rskvaril@, this is probably issue https://github.com/util-linux/util-linux/issues/3430, fixed in https://github.com/util-linux/util-linux/pull/3431/commits/049901c63ea7ad8a1e0ba4feeaf7360dbf4bdc2f
but we do not have a fix in RHEL-10 (working in RHEL-9).