Arch Linux

Please read this before reporting a bug:
https://wiki.archlinux.org/title/Bug_reporting_guidelines

Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.

REPEAT: Do NOT report bugs for outdated packages!
Tasklist

FS#79320 - [lshw] throws length_error _M_create

Attached to Project: Arch Linux
Opened by Roko (rokobuljan) - Monday, 07 August 2023, 11:00 GMT
Last edited by Toolybird (Toolybird) - Monday, 07 August 2023, 21:21 GMT
Task Type Bug Report
Category Packages: Extra
Status Waiting on Response
Assigned To No-one
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 0%
Votes 0
Private No

Details

Description:
Running `sudo lshw` gives:

```sh
terminate called after throwing an instance of 'std::length_error'
what(): basic_string::_M_create
Aborted
```

Also, by running `/usr/bin/lshw -version` there's this strange inconsistency in versions:

```sh
B.02.19.2
the latest version is B.02.18
```

Additional info:
lshw version B.02.19.2

Steps to reproduce:
`sudo lshw`
This task depends upon

Comment by loqs (loqs) - Monday, 07 August 2023, 11:59 GMT
Does applying the commit from this upstream PR [1] resolve the issue?

[1] https://github.com/lyonel/lshw/pull/87
Comment by Roko (rokobuljan) - Monday, 07 August 2023, 16:09 GMT
@loqs cannot git + build ATM so sadly cannot confirm if [PR1](https://github.com/lyonel/lshw/pull/87) helps, and cannot make sense from the commit edits alone.
Comment by loqs (loqs) - Monday, 07 August 2023, 16:29 GMT
lshw with PR#87 applied:
lshw-B.02.19.2-5.1-x86_64.pkg.tar.zst https://drive.google.com/file/d/1n-rVdjaGH26h69m2UWBkQxa386mu-yzX/view?usp=sharing
Comment by Roko (rokobuljan) - Monday, 07 August 2023, 18:43 GMT
@loqs thx! Will try to install tomorrow. Will let you know ASAP
Comment by Toolybird (Toolybird) - Monday, 07 August 2023, 21:21 GMT
Interesting, it doesn't repro here.
Comment by Roko (rokobuljan) - Tuesday, 08 August 2023, 08:17 GMT
@loqs Tested. I can confirm that the PR partially (or fully?) resolves the issue.


```sh
sudo lshw
Can`t read the string with size 18446744073709551615
mypc
description: Mini PC
product: mypc (BOXNUC7CJYSAMN)

(...etc)
```
There's finally the desired output! But, there's also this "Can`t read the string with size 18446744073709551615" which *is* the output from the PR's fprintf error message. Not sure why it gives that error though...
Comment by loqs (loqs) - Tuesday, 08 August 2023, 11:22 GMT
Updated version which should print the path after the size in the error message.
https://drive.google.com/file/d/1hZN01DOrkcR-gOucyHEa-TMQbEETSCS9/view?usp=sharing lshw-B.02.19.2-5.2-x86_64.pkg.tar.zst
Comment by Roko (rokobuljan) - Tuesday, 08 August 2023, 12:17 GMT
@loqs
The error now reads:
Can`t read the string with size 18446744073709551615 from /sys/devices/pci0000:00/0000:00:1c.0/mmc_host/mmc0/mmc0:0001/block/mmcblk0/device

Loading...