You are not logged in.
Can anyone else confirm theirs is also broken.
lshw appears to be broken
sudo lshw
terminate called after throwing an instance of 'std::length_error'
what(): basic_string::_M_create
Aborted
lshw -version
the latest version is B.02.18
uname -r
5.12.12-arch1-1
Offline
Arch packages lshw B.02.19.2 and has since 2020. Have you been running partial updates, or do you have a local install of lshw?
Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD
Making lemonade from lemons since 2015.
Offline
strange it prints the wrong version:
sudo pacman -Su lshw
warning: lshw-B.02.19.2-1 is up to date -- reinstalling
:: Starting full system upgrade...
resolving dependencies...
looking for conflicting packages...
Packages (1) lshw-B.02.19.2-1
Total Installed Size: 7.93 MiB
Net Upgrade Size: 0.00 MiB
:: Proceed with installation? [Y/n]
(1/1) checking keys in keyring [######################] 100%
(1/1) checking package integrity [######################] 100%
(1/1) loading package files [######################] 100%
(1/1) checking for file conflicts [######################] 100%
(1/1) checking available disk space [######################] 100%
:: Processing package changes...
(1/1) reinstalling lshw [######################] 100%
:: Running post-transaction hooks...
(1/2) Arming ConditionNeedsUpdate...
(2/2) Updating the desktop file MIME type cache...
[xxx]$ lshw -version
the latest version is B.02.18
[xxx]$ sudo lshw
terminate called after throwing an instance of 'std::length_error'
what(): basic_string::_M_create
Aborted
Maybe an issue with locale?
Last edited by jmandawg (2021-06-23 17:09:08)
Offline
Offline
[~]$ which lshw
/usr/bin/lshw
[~]$ ls -al /usr/bin/lshw
-rwxr-xr-x 1 root root 1020528 May 2 2020 /usr/bin/lshw
[~]$ /usr/bin/lshw -version
the latest version is B.02.18
Offline
I'm guessing some of my hardware is not returning the proper string. hwinfo is working fine though. On my other 2 machines lshw works fine so it must be something specific to this machine.
Last edited by jmandawg (2021-06-24 15:31:29)
Offline
As lslhw is built from a tarball, the environment variable VERSION needs to be set, to specify the version.
The code should print unknown when the version is not set, due to a bug in the code an empty string it printed.
The version that is shown is obtained by a query to an internet server run by upstream when the -version option is specified.
git diff
diff --git a/trunk/PKGBUILD b/trunk/PKGBUILD
index 7f613e6..5718f75 100644
--- a/trunk/PKGBUILD
+++ b/trunk/PKGBUILD
@@ -18,9 +18,11 @@ sha256sums=('9bb347ac87142339a366a1759ac845e3dbb337ec000aa1b99b50ac6758a80f80')
prepare() {
cd "$srcdir"/$pkgname-$pkgver
sed -i 's|/usr/bin/gtk-lshw|/usr/sbin/gtk-lshw|' src/gui/integration/gtk-lshw.desktop
+ sed -i '/^LDFLAGS=$/d' src/core/Makefile src/gui/Makefile
}
build() {
+ export VERSION=$pkgver
cd "$srcdir"/$pkgname-$pkgver
make SBINDIR=/usr/bin
make SBINDIR=/usr/bin gui
Offline
I confirm the bug. But this is strange. I have the bug on my old netbook (running arhclinux x86_64 though)but not on my desktop.
Offline
lshw vB.02.19.2 here, working without error on two mature Arch installs, but on my new Arch build-up on a new laptop, I got the this exact terminate called bug. Fix was to remove it and install AUR's lshw-git (lshw vB.02.19.r87.gd76afba, which works without errors on my new Arch install.
Offline