Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 755104 - sys-apps/lshw-02.18b crashes when run by regular user
Summary: sys-apps/lshw-02.18b crashes when run by regular user
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Ben Kohler
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-11-17 18:25 UTC by Tomasz Golinski
Modified: 2021-05-28 14:33 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tomasz Golinski 2020-11-17 18:25:24 UTC
lshw is supposed to list a lot of information about hardware and it generally requires superuser access to work. However it is supposed to show limited information when run without superuser privileges. Quote from https://ezix.org/project/wiki/HardwareLiSter: 

"NOTE: to use some features (like DMI on x86 platforms), you need to run lshw as root or it will only report partial information."

I tested it on other distribution (I think it was Mint, although I'm not sure what version of lshw was installed there) and it indeed provided some information when run by regular user. However on Gentoo it throws an exception:

WARNING: you should run this program as super-user.
terminate called after throwing an instance of 'std::length_error'
  what():  cannot create std::vector larger than max_size()
Aborted

lshw is used by some e.g. games which use it to determine hardware capabilities and then it is usually run without superuser access. 

Reproducible: Always

Steps to Reproduce:
1. run lshw as normal user

Actual Results:  
terminate called after throwing an instance of 'std::length_error'
  what():  cannot create std::vector larger than max_size()
Aborted


Expected Results:  
list of hardware

/usr/lib/python3.7/site-packages/portage/package/ebuild/_config/KeywordsManager.py:69: UserWarning: /etc/portage/package.keywords is deprecated, use /etc/portage/package.accept_keywords instead
  UserWarning)
Portage 3.0.9 (python 3.7.9-final-0, default/linux/amd64/17.1/desktop, gcc-9.3.0, glibc-2.32-r2, 5.9.1-gentoo x86_64)
=================================================================
System uname: Linux-5.9.1-gentoo-x86_64-AMD_Ryzen_5_3600_6-Core_Processor-with-gentoo-2.7
KiB Mem:    32885504 total,    968224 free
KiB Swap:          0 total,         0 free
Timestamp of repository gentoo: Tue, 17 Nov 2020 14:05:37 +0000
Head commit of repository gentoo: 9dc0f7e6667a7be608066ee1a20b9eeb6215d835

Timestamp of repository kde: Tue, 17 Nov 2020 00:05:36 +0000
Head commit of repository kde: 249d166dcf0e9df40a0fb9e2afa48e4461960872

Timestamp of repository steam-overlay: Fri, 06 Nov 2020 22:05:28 +0000
Head commit of repository steam-overlay: 3dd4279a04e2ef34a3ab498e174535ac637c45ff

sh bash 5.0_p18
ld GNU ld (Gentoo 2.34 p6) 2.34.0
app-shells/bash:          5.0_p18::gentoo
dev-java/java-config:     2.3.1::gentoo
dev-lang/perl:            5.30.3::gentoo
dev-lang/python:          2.7.18-r4::gentoo, 3.7.9::gentoo, 3.8.6::gentoo, 3.9.0::gentoo
dev-util/cmake:           3.17.4-r1::gentoo
sys-apps/baselayout:      2.7::gentoo
sys-apps/openrc:          0.42.1::gentoo
sys-apps/sandbox:         2.20::gentoo
sys-devel/autoconf:       2.13-r1::gentoo, 2.69-r5::gentoo
sys-devel/automake:       1.13.4-r2::gentoo, 1.16.1-r1::gentoo
sys-devel/binutils:       2.34-r2::gentoo
sys-devel/gcc:            6.5.0-r3::gentoo, 7.5.0-r1::gentoo, 8.4.0-r1::gentoo, 9.3.0-r1::gentoo, 10.2.0-r3::gentoo
sys-devel/gcc-config:     2.3.2::gentoo
sys-devel/libtool:        2.4.6-r6::gentoo
sys-devel/make:           4.2.1-r4::gentoo
sys-kernel/linux-headers: 5.4-r1::gentoo (virtual/os-headers)
sys-libs/glibc:           2.32-r2::gentoo
Repositories:

gentoo
    location: /var/db/repos/gentoo
    sync-type: git
    sync-uri: https://anongit.gentoo.org/git/repo/sync/gentoo.git
    priority: -1000
    sync-git-verify-commit-signature: yes

arduino
    location: /var/db/repos/arduino
    masters: gentoo

kde
    location: /var/db/repos/kde
    sync-type: git
    sync-uri: https://github.com/gentoo-mirror/kde.git
    masters: gentoo

local
    location: /var/db/repos/local
    masters: gentoo

steam-overlay
    location: /var/db/repos/steam-overlay
    sync-type: git
    sync-uri: https://github.com/gentoo-mirror/steam-overlay.git
    masters: gentoo

ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="@FREE"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -march=native -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/lib64/libreoffice/program/sofficerc /usr/share/config /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c"
CXXFLAGS="-O2 -march=native -pipe"
DISTDIR="/var/cache/distfiles"
EMERGE_DEFAULT_OPTS="--quiet-build=n --jobs=20 --load-average=14 --keep-going"
ENV_UNSET="CARGO_HOME DBUS_SESSION_BUS_ADDRESS DISPLAY GOBIN GOPATH PERL5LIB PERL5OPT PERLPREFIX PERL_CORE PERL_MB_OPT PERL_MM_OPT XAUTHORITY XDG_CACHE_HOME XDG_CONFIG_HOME XDG_DATA_HOME XDG_RUNTIME_DIR"
FCFLAGS="-O2 -march=native -pipe"
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs cgroup distlocks ebuild-locks fixlafiles ipc-sandbox merge-sync multilib-strict network-sandbox news parallel-fetch pid-sandbox preserve-libs protect-owned qa-unresolved-soname-deps sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync"
FFLAGS="-O2 -march=native -pipe"
GENTOO_MIRRORS="http://ftp-stud.hs-esslingen.de/pub/Mirrors/gentoo/ http://ftp.snt.utwente.nl/pub/os/linux/gentoo http://mirror.leaseweb.com/gentoo/"
INSTALL_MASK="/usr/share/locale -/usr/share/locale/pl* -/usr/share/locale/en /usr/share/binutils-data/*/*/locale -/usr/share/binutils-data/*/*/locale/pl* -/usr/share/binutils-data/*/*/locale/en /usr/share/gcc-data/*/*/locale -/usr/share/gcc-data/*/*/locale/pl* -/usr/share/gcc-data/*/*/locale/en /usr/share/man/ -/usr/share/man/man* -/usr/share/man/pl* -/usr/share/man/whatis"
LANG="en_US.utf8"
LDFLAGS="-Wl,-O1 -Wl,--sort-common -Wl,--as-needed"
MAKEOPTS="-j8"
PKGDIR="/var/cache/binpkgs"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --exclude=/.git"
PORTAGE_TMPDIR="/var/tmp"
USE="X a52 aac acoustid acpi alsa amd64 bash-completion berkdb branding brotli bzip2 cairo cdda cdr cli cups dbus dri dts dvd dvdr elogind emboss encode exif flac fortran gdbm gif gimp gpm gpu gtk gtk3 gui http2 iconv icu jpeg lcms libglvnd libnotify libtirpc lto mad mng mobi mp3 mp4 mpeg mtp multilib musepack musicbrainz ncurses nls nptl offensive ogg opencl opengl openmp opus pam pango pcre pdf pgo png policykit postscript ppds qt5 readline sane scanner sdl seccomp spell split-usr ssl startup-notification svg system-cairo system-harfbuzz system-icu system-jpeg system-jsoncpp system-libevent system-libvpx system-llvm system-sqlite tcpd tiff truetype udev udisks unicode upower usb userlocales vdpau vorbis vulkan webp wxwidgets x264 x265 xcb xml xmp xv xvid zlib" ABI_X86="64" ADA_TARGET="gnat_2018" ALSA_CARDS="intel8x0 emu10k1 virtuoso" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="karbon sheets words" CAMERAS="canon" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="aes avx avx2 f16c fma3 mmx mmxext pclmul popcnt rdrand sha sse sse2 sse3 sse4_1 sse4_2 sse4a ssse3" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock greis isync itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 timing tsip tripmate tnt ublox ubx" INPUT_DEVICES="libinput" KERNEL="linux" LCD_DEVICES="hd44780 curses text rawserial serialpos serialvfd" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LIRC_DEVICES="serial" LUA_SINGLE_TARGET="lua5-1" LUA_TARGETS="lua5-1" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php7-2 php7-3 php7-4" POSTGRES_TARGETS="postgres10 postgres11" PYTHON_SINGLE_TARGET="python3_7" PYTHON_TARGETS="python2_7 python3_7" RUBY_TARGETS="ruby25" SANE_BACKENDS="pixma" USERLAND="GNU" VIDEO_CARDS="amdgpu radeonsi radeon" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CC, CPPFLAGS, CTARGET, CXX, LC_ALL, LINGUAS, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 1 Jonas Stein gentoo-dev 2020-11-17 21:18:26 UTC
confirmed the crash
Comment 2 Ben Kohler gentoo-dev 2021-03-23 15:26:05 UTC
I tested this one 2 systems and it only crashed like that on one of them, strangely.  But on the system where it was crashing, it is fixed with the 2.19b bump.