-
Bug
-
Resolution: Done
-
Normal
-
None
-
rhel-9.4
-
None
-
No
-
Important
-
rhel-sst-kernel-debug
-
ssg_core_kernel
-
None
-
False
-
-
None
-
None
-
None
-
None
-
None
What were you trying to do that didn't work?
When using JSON output in lshw, it can product unescaped strings. This is an example from the customer:
"children" : [ { "id" : "bank:0", "class" : "memory", "claimed" : true, "handle" : "DMI:0015", "description" : "DIMM DDR4 Synchronous 3200 MHz (0.3 ns)", "physid" : "0", "serial" : "\", "slot" : "CPU0_DIMM_A1", "units" : "bytes", "size" : 17179869184, "width" : 64, "clock" : 3200000000 },
Note how the "serial" field contains one single slash, which is treated as escaping the quotation mark after it.
What is the impact of this issue to you?
This issue prevents OpenShift Metal platform from working on affected hardware as reported in https://issues.redhat.com/browse/OCPBUGS-47549
Please provide the package NVR for which the bug is seen:
B.02.19
How reproducible is this bug?:
Only on specific hardware
Steps to reproduce
- lshw -quite -json
- Try to parse the output with a JSON library of your choice
Expected results
Valid JSON
Actual results
Python reports json.decoder.JSONDecodeError: Invalid control character at: line 331 column 30 (char 11066)
Notes
I highly suspect that the bug is fixed by this upstream commit https://github.com/lyonel/lshw/commit/befc2e215ab1b86af1af63fbfc26b56cd212339d. It's not in any upstream releases AFAIK but seems to be included in the build lshw-B.02.20-1.el9. Would it be possible to backport this build to RHEL 9.4-9.6?
- blocks
-
OCPBUGS-47549 Non-valid JSON output from `lshw` on the Phantom Lake Smart-NIC causing Bare Metal Operator failures
-
- Closed
-