-
Bug
-
Resolution: Unresolved
-
Undefined
-
None
-
rhel-8.10.z, CentOS Stream 8, CentOS Stream 9, rhel-9.9.z
-
None
-
None
-
Low
-
Patch, EasyFix
-
Customer Reported
-
rhel-base-utils-core
-
None
-
False
-
False
-
-
None
-
None
-
None
-
None
-
Unspecified
-
Unspecified
-
Unspecified
-
-
All
-
None
What were you trying to do that didn't work?
Text 'Pending defect count:{' breaks json output HERE.
# smartctl -x /dev/sdx --json | head
Pending defect count:{ <--- HERE
"json_format_version": [
1,
0
],
"smartctl": {
"version": [
7,
1
],
...
What is the impact of this issue to you?
`smartmontools` not producing valid json. Breaks other tools expecting json output.
Please provide the package NVR for which the bug is seen:
How reproducible is this bug?
Sometimes (for specific disks).
Steps to reproduce
# Run 'smartctl -x /dev/sdx --json' on affected device.
Expected results
# smartctl -x /dev/sdx --json | head "json_format_version": [ 1, 0 ], "smartctl": { "version": [ 7, 1 ], ...
Actual results
# smartctl -x /dev/sdx --json | head
Pending defect count:{ <--- HERE
"json_format_version": [
1,
0
],
"smartctl": {
"version": [
7,
1
],
...
Additional notes.
This was patched in upstream; see commit https://github.com/smartmontools/smartmontools/commit/5689dea0d77713c984188db9cf6b8377081b880f
This bug is present in rhel8, rhel9, HERE;
*rhel8*
⬢ [dareynol@toolbx smartmontools]$ vi smartmontools-7.1-build/smartmontools-7.1/scsiprint.cpp
switch (pc) {
case 0x0:
printf(" Pending defect count:"); <--- HERE
if ((pl < 8) || (num < 8)) {
print_on();
pout("%s truncated descriptor\n", pDefStr);
print_off();
return;
}
- Using printf() not jout().
*rhel9*
⬢ [dareynol@toolbx smartmontools]$ vim smartmontools-7.2-build/smartmontools-7.2/scsiprint.cpp
switch (pc) {
case 0x0:
printf(" Pending defect count:"); <--- HERE
if ((pl < 8) || (num < 8)) {
print_on();
pout("%s truncated descriptor\n", pDefStr);
print_off();
return;
}
- Using printf() not jout() HERE.
Upstream commit already in rhel10, FIX_HERE.
*rhel10*
⬢ [dareynol@toolbx smartmontools]$ vi smartmontools-7.4-build/smartmontools-7.4/scsiprint.cpp
switch (pc) {
case 0x0:
jout(" Pending defect count:"); <--- FIX_HERE
if ((pl < 8) || (num < 8)) {
print_on();
pout("%s truncated descriptor\n", pDefStr);
print_off();
return;
}