Bug#1030092: nvme-cli: nvme list json output contains wrapped-around negative integers

2023-02-01 Thread Daniel Swarbrick
Just following up on this; I see that nvme-cli 2.3-2 fixes the build, 
and I can confirm that the numeric values no longer wrap around to 
negative values.


As an aside, I also noticed that the JSON output "string" numeric values 
(e.g. the 128-bit NVMe counters which would lose accuracy if rendered as 
float64 JSON numbers) are now localized, i.e. include thousands 
separators. This is a bit peculiar to see in machine-readable JSON 
output, but easily worked around by setting LC_NUMERIC=C.




OpenPGP_signature
Description: OpenPGP digital signature


Bug#1030092: nvme-cli: nvme list json output contains wrapped-around negative integers

2023-01-31 Thread Daniel Swarbrick

Hi Daniel,

On 01.02.23 09:48, Daniel Baumann wrote:
I've reproduced the bug with 2.2 and can confirm that 2.3 does fix it. 
Did you notice that nvme-cli 2.3-1 is FTBFS on the buildds? The build 
appears to be failing due to a missing "libnvme-mi".


OpenPGP_signature
Description: OpenPGP digital signature


Bug#1030092: nvme-cli: nvme list json output contains wrapped-around negative integers

2023-01-31 Thread Daniel Baumann
close 1030092 2.3-1
thanks

On 1/31/23 05:30, Daniel Baumann wrote:
> I've just uploaed 2.3 that should indeed fix
> it.

I've reproduced the bug with 2.2 and can confirm that 2.3 does fix it.

Regards,
Daniel



Bug#1030092: nvme-cli: nvme list json output contains wrapped-around negative integers

2023-01-30 Thread Daniel Baumann
Hi Daniel,

thank you for your report - I've just uploaed 2.3 that should indeed fix
it. It would be nice if you could try to confirm it.

Regards,
Daniel



Bug#1030092: nvme-cli: nvme list json output contains wrapped-around negative integers

2023-01-30 Thread Daniel Swarbrick
Package: nvme-cli
Version: 2.2.1-4
Severity: normal

Dear Maintainer,

Since the update of nvme-cli to v2.x, the JSON output of an "nvme list"
command contains wrapped-around negative integers for various fields,
e.g.:

{
  "Devices":[
{
  "NameSpace":1,
  "DevicePath":"/dev/nvme0n1",
  "Firmware":"2B0QBXX7",
  "ModelNumber":"Samsung SSD 950 PRO 256GB",
  "SerialNumber":"",
  "UsedBytes":-2147483648,
  "MaximumLBA":500118192,
  "PhysicalSize":-2147483648,
  "SectorSize":512
}
  ]
}

Compare with the output of the previous nvme-cli v1.2:

{
  "Devices" : [
{
  "NameSpace" : 1,
  "DevicePath" : "/dev/nvme0n1",
  "Firmware" : "2B0QBXX7",
  "Index" : 0,
  "ModelNumber" : "Samsung SSD 950 PRO 256GB",
  "ProductName" : "Non-Volatile memory controller: Samsung Electronics Co 
Ltd VMe SSD Controller SM951/PM951 PM963 2.5\" NVMe PCIe SSD",
  "SerialNumber" : "",
  "UsedBytes" : 93811310592,
  "MaximumLBA" : 500118192,
  "PhysicalSize" : 256060514304,
  "SectorSize" : 512
}
  ]
}

The PhysicalSize item appears to be an overflowed int32 in the v2.2.x
output.

Another example of bogus values for a 1TB drive with nvme-cli 2.2.1

{
  "Devices":[
{
  "NameSpace":1,
  "DevicePath":"/dev/nvme0n1",
  "Firmware":"41001131",
  "ModelNumber":"PC711 NVMe SK hynix 1TB",
  "SerialNumber":"",
  "UsedBytes":-2147483648,
  "MaximumLBA":2000409264,
  "PhysicalSize":-2147483648,
  "SectorSize":512
}
  ]
}

Upstream has published new releases of nvme-cli (v2.3) and libnvme
(v1.3) in the last 24 hours, and skimming through the changelog I get
the feeling that this bug may have been resolved by those releases.

-- System Information:
Debian Release: bookworm/sid
  APT prefers testing
  APT policy: (500, 'testing'), (400, 'unstable')
Architecture: amd64 (x86_64)

Kernel: Linux 6.1.0-2-amd64 (SMP w/4 CPU threads; PREEMPT)
Kernel taint flags: TAINT_FIRMWARE_WORKAROUND
Locale: LANG=en_NZ.UTF-8, LC_CTYPE=en_NZ.UTF-8 (charmap=UTF-8) (ignored: LC_ALL 
set to en_US.UTF-8), LANGUAGE=en_NZ:en
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages nvme-cli depends on:
ii  libc6 2.36-8
ii  libjson-c50.16-2
ii  libnvme1  1.2-3
ii  uuid-runtime  2.38.1-4
ii  zlib1g1:1.2.13.dfsg-1

Versions of packages nvme-cli recommends:
ii  pci.ids  0.0~2023.01.18-1

nvme-cli suggests no packages.

-- no debconf information