Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 485496 - sys-apps/lshw-02.17b - lshw -short: segmentation fault while accessing block device with corrupt partition
Summary: sys-apps/lshw-02.17b - lshw -short: segmentation fault while accessing block ...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo's Team for Core System packages
URL: http://ezix.org/project/ticket/653
Whiteboard:
Keywords: PATCH
Depends on:
Blocks:
 
Reported: 2013-09-20 15:39 UTC by Juergen Rose
Modified: 2017-03-15 05:08 UTC (History)
1 user (show)

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


Attachments
ebuild using the patch (lshw-02.17b.ebuild,1.69 KB, text/plain)
2014-05-31 14:33 UTC, Juergen Rose
Details
the vfat patch (lshw-02.17b-fat.patch,416 bytes, patch)
2014-05-31 14:34 UTC, Juergen Rose
Details | Diff
lshw-03.17b-scsi.patch (lshw-02.17b-scsi.patch,460 bytes, patch)
2014-06-26 11:35 UTC, Juergen Rose
Details | Diff
an ebuild using the scsi.patch (lshw-02.17b-r1.ebuild,1.73 KB, text/plain)
2014-06-26 11:36 UTC, Juergen Rose
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Juergen Rose 2013-09-20 15:39:00 UTC
root@leopard:/home_leopard/rose/Txt/projects/RaspberryPI/Linux/Debian(38)# lshw -short
Segmentation fault        


root@leopard:/home_leopard/rose/Txt/projects/RaspberryPI/Linux/Debian(39)# strace lshw -short 2>&1 | tail -n 30
open("/dev/sde", O_RDONLY|O_NONBLOCK)   = 4
lseek(4, 0, SEEK_SET)                   = 0
read(4, "\372\270\0\20\216\320\274\0\260\270\0\0\216\330\216\300\373\276\0|\277\0\6\271\0\2\363\244\352!\6\0"..., 512) = 512
lseek(4, 0, SEEK_SET)                   = 0
read(4, "\372\270\0\20\216\320\274\0\260\270\0\0\216\330\216\300\373\276\0|\277\0\6\271\0\2\363\244\352!\6\0"..., 512) = 512
lseek(4, 4194304, SEEK_SET)             = 4194304
read(4, "\353<\220mkdosfs\0\0\2\20\20\0\2\0\2\0\0\370 \0?\0\377\0\0\0\0\0"..., 512) = 512
lseek(4, 4194816, SEEK_SET)             = 4194816
read(4, "RRaA\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 512) = 512
lseek(4, 4195328, SEEK_SET)             = 4195328
read(4, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 512) = 512
lseek(4, 4195840, SEEK_SET)             = 4195840
read(4, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 512) = 512
fstat(4, {st_mode=S_IFBLK|0660, st_rdev=makedev(8, 64), ...}) = 0
mknod("/dev/sde1", S_IFCHR|0400, makedev(8, 65)) = -1 EEXIST (File exists)
open("/dev/sde1", O_RDONLY)             = 5
lseek(4, 4194304, SEEK_SET)             = 4194304
read(4, "\353<\220mkdosfs\0\0\2\20\20\0\2\0\2\0\0\370 \0?\0\377\0\0\0\0\0"..., 512) = 512
lseek(5, 0, SEEK_SET)                   = 0
read(5, "\353<\220mkdosfs\0\0\2\20\20\0\2\0\2\0\0\370 \0?\0\377\0\0\0\0\0"..., 512) = 512
close(5)                                = 0
stat("/dev/sde1", {st_mode=S_IFBLK|0660, st_rdev=makedev(8, 65), ...}) = 0
lseek(4, 4194304, SEEK_SET)             = 4194304
read(4, "\353<\220mkdosfs\0\0\2\20\20\0\2\0\2\0\0\370 \0?\0\377\0\0\0\0\0"..., 512) = 512
lseek(4, 4194304, SEEK_SET)             = 4194304
read(4, "\353<\220mkdosfs\0\0\2\20\20\0\2\0\2\0\0\370 \0?\0\377\0\0\0\0\0"..., 512) = 512
lseek(4, 4235264, SEEK_SET)             = 4235264
read(4, "Ab\0o\0o\0t\0c\0\17\0\5o\0d\0e\0.\0b\0i\0\0\0n\0\0\0"..., 16384) = 16384
--- SIGSEGV {si_signo=SIGSEGV, si_code=SEGV_MAPERR, si_addr=0} ---
+++ killed by SIGSEGV +++


/dev/sde is a 16GB SDHC card with a small sde1 vfat, a larger sde2 ext4 and a corrupted /dev/sde3 partition.  Normally (? in the past) it was recognized as /dev/mmcblk0.

root@leopard:/home_leopard/rose/Txt/projects/RaspberryPI/Linux/Debian(42)# df -T
...
/dev/sde1                 vfat         57288     18920     38368  34% /run/media/rose/C522-EA52
/dev/sde2                 ext4       8224184   3473664   4380352  45% /run/media/rose/62ba9ec9-47d9-4421-aaee-71dd6c0f3707


If I eject the SDHC card, 'lshw -short':
root@leopard:/home_leopard/rose/Txt/projects/RaspberryPI/Linux/Debian(45)# lshw -short
Segmentation fault        
root@leopard:/home_leopard/rose/Txt/projects/RaspberryPI/Linux/Debian(46)# umount /dev/sde2
root@leopard:/home_leopard/rose/Txt/projects/RaspberryPI/Linux/Debian(47)# umount /dev/sde1
root@leopard:/home_leopard/rose/Txt/projects/RaspberryPI/Linux/Debian(48)# lshw -short
Segmentation fault        
root@leopard:/home_leopard/rose/Txt/projects/RaspberryPI/Linux/Debian(49)# lshw -short
H/W path               Device      Class          Description
=============================================================
                                   system         7824D8G (To be filled by O.E.M.)
/0                                 bus            Motherboard
/0/0                               memory         64KiB BIOS
Comment 1 Ben Kohler gentoo-dev 2014-01-14 16:33:39 UTC
I'm seeing this same thing when scanning any vfat partition.  Upstream revision 5128 should fix this, here is the best link to the change/patch that I can come up with:

http://ezix.org/project/changeset?old_path=%2Fpackages%2Flshw%2Fdevelopment%2Fsrc&old=2527&new_path=%2Fpackages%2Flshw%2Fdevelopment%2Fsrc&new=2528&sfp_email=&sfph_mail=#file0

This applies cleanly via epatch_user for me, we could apply this in 02.17b-r1 or wait for a new upstream release.
Comment 2 Marian Kyral 2014-03-07 10:11:00 UTC
I have the same problem. Patch applied, but lshw still crashing. The /dev/sda1 partition contains Dell utilities.

Disk /dev/sda: 149.1 GiB, 160041885696 bytes, 312581808 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x0aa8f2cc

Device    Boot     Start       End    Blocks  Id System
/dev/sda1             63    417689    208813+ de Dell Utility
/dev/sda2 *       417690  61866314  30724312+  7 HPFS/NTFS/exFAT


stat("/dev/sda", {st_mode=S_IFBLK|0660, st_rdev=makedev(8, 0), ...}) = 0
ioctl(3, SG_GET_VERSION_NUM, 0x7fffceabd9bc) = 0
ioctl(3, SG_IO, {'S', SG_DXFER_FROM_DEV, cmd[6]=[12, 00, 00, 00, 24, 00], mx_sb_len=32, iovec_count=0, dxfer_len=36, timeout=20000, flags=0, data[36]=["\0\0\5\2[\0\0\0ATA     WDC WD1600BJKT-7"...], status=00, masked_status=00, sb[0]=[], host_status=0, driver_status=0, resid=0, duration=0, info=0}) = 0
ioctl(3, SG_IO, {'S', SG_DXFER_FROM_DEV, cmd[6]=[12, 00, 00, 00, 60, 00], mx_sb_len=32, iovec_count=0, dxfer_len=96, timeout=20000, flags=0, data[96]=["\0\0\5\2[\0\0\0ATA     WDC WD1600BJKT-7"...], status=00, masked_status=00, sb[0]=[], host_status=0, driver_status=0, resid=0, duration=0, info=0}) = 0
ioctl(3, SG_IO, {'S', SG_DXFER_FROM_DEV, cmd[6]=[12, 01, 80, 00, ff, 00], mx_sb_len=32, iovec_count=0, dxfer_len=255, timeout=20000, flags=0, data[255]=["\0\200\0\24     WD-WX90A69U9172\0\0\0\0\0\0\0\0"...], status=00, masked_status=00, sb[0]=[], host_status=0, driver_status=0, resid=0, duration=0, info=0}) = 0
ioctl(3, SG_IO, {'S', SG_DXFER_FROM_DEV, cmd[6]=[1a, 00, 3f, 00, ff, 00], mx_sb_len=32, iovec_count=0, dxfer_len=256, timeout=20000, flags=0, data[256]=["7\0\0\10\0\0\0\0\0\0\2\0\1\n\200\0\0\0\0\0\0\0\0\0\10\22\4\0\0\0\0\0"...], status=00, masked_status=00, sb[0]=[], host_status=0, driver_status=0, resid=0, duration=0, info=0}) = 0
open("/dev/sda", O_RDONLY|O_NONBLOCK)   = 4
ioctl(4, BLKPBSZGET, 512)               = 0
ioctl(4, BLKSSZGET, 512)                = 0
ioctl(4, BLKGETSIZE64, 160041885696)    = 0
close(4)                                = 0
open("/dev/sda", O_RDONLY|O_NONBLOCK)   = 4
lseek(4, 0, SEEK_SET)                   = 0
read(4, "\353H\220\320\274\0|\216\300\216\330\276\0|\277\0\6\271\0\2\374\363\244Ph\34\6\313\373\271\4\0"..., 512) = 512
lseek(4, 0, SEEK_SET)                   = 0
read(4, "\353H\220\320\274\0|\216\300\216\330\276\0|\277\0\6\271\0\2\374\363\244Ph\34\6\313\373\271\4\0"..., 512) = 512
lseek(4, 32256, SEEK_SET)               = 32256
read(4, "\353T\220Dell 8.0\0\2\10\1\0\2\0\2\0\0\370\314\0?\0\377\0?\0\0\0"..., 512) = 512
lseek(4, 32768, SEEK_SET)               = 32768
read(4, "\370\377\377\377\3\0\4\0\5\0\6\0\7\0\10\0\t\0\n\0\v\0\f\0\r\0\16\0\17\0\20\0"..., 512) = 512
lseek(4, 33280, SEEK_SET)               = 33280
read(4, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 512) = 512
lseek(4, 33792, SEEK_SET)               = 33792
read(4, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 512) = 512
fstat(4, {st_mode=S_IFBLK|0660, st_rdev=makedev(8, 0), ...}) = 0
mknod("/dev/sda1", S_IFCHR|0400, makedev(8, 1)) = -1 EEXIST (File exists)
open("/dev/sda1", O_RDONLY)             = 5
lseek(4, 32256, SEEK_SET)               = 32256
read(4, "\353T\220Dell 8.0\0\2\10\1\0\2\0\2\0\0\370\314\0?\0\377\0?\0\0\0"..., 512) = 512
lseek(5, 0, SEEK_SET)                   = 0
read(5, "\353T\220Dell 8.0\0\2\10\1\0\2\0\2\0\0\370\314\0?\0\377\0?\0\0\0"..., 512) = 512
close(5)                                = 0
stat("/dev/sda1", {st_mode=S_IFBLK|0660, st_rdev=makedev(8, 1), ...}) = 0
lseek(4, 32256, SEEK_SET)               = 32256
read(4, "\353T\220Dell 8.0\0\2\10\1\0\2\0\2\0\0\370\314\0?\0\377\0?\0\0\0"..., 512) = 512
lseek(4, 32256, SEEK_SET)               = 32256
read(4, "\353T\220Dell 8.0\0\2\10\1\0\2\0\2\0\0\370\314\0?\0\377\0?\0\0\0"..., 512) = 512
lseek(4, 241664, SEEK_SET)              = 241664
read(4, "COMMAND COM!\0b\372M\357:\357:\0\0q\202\r9\2\0-\340\0\0"..., 16384) = 16384
--- SIGSEGV {si_signo=SIGSEGV, si_code=SI_KERNEL, si_addr=0} ---
Comment 3 Juergen Rose 2014-05-31 14:03:52 UTC
I hit the error at the next system. If I insert a vfat formatted USB stick 'lshw -short' crashes. If I remove the stick everything is fine.
Comment 4 Juergen Rose 2014-05-31 14:33:09 UTC
Created attachment 377946 [details]
ebuild using the patch
Comment 5 Juergen Rose 2014-05-31 14:34:49 UTC
Created attachment 377948 [details, diff]
the vfat patch

I could succesfully emerge lshw with this patch. And the segentation fault with the vfat formatted USB stick disappeared.
Comment 6 Juergen Rose 2014-05-31 14:37:08 UTC
Thanks to Ben (Comment 1), my patch using the patch, which he found.
Comment 7 Samuli Suominen (RETIRED) gentoo-dev 2014-05-31 14:45:13 UTC
-r1 with the patch in Portage. Thanks, to both, Ben and Juergen.
Comment 8 Juergen Rose 2014-06-19 21:23:09 UTC
(In reply to Samuli Suominen from comment #7)
> -r1 with the patch in Portage. Thanks, to both, Ben and Juergen.

I hit the error again with lshw-02.17b-r1:

root@impala:/usr/src/linux(40)# lshw -version
B.02.17
root@impala:/usr/src/linux(41)# qlist -Iv lshw
sys-apps/lshw-02.17b-r1
root@impala:/usr/src/linux(42)# lshw   (with USB stick)
Segmentation fault        
root@impala:/usr/src/linux(43)# emerge -p lshw

These are the packages that would be merged, in order:

Calculating dependencies... done!
[ebuild   R    ] sys-apps/lshw-02.17b-r1 
root@impala:/usr/src/linux(44)# lshw   (without USB stick)
impala                    
    description: Desktop Computer
    product: GA-790XTA-UD4
    vendor: Gigabyte Technology Co., Ltd.
    width: 64 bits
    capabilities: smbios-2.4 dmi-2.4 ldt16 vsyscall32
    configuration: boot=normal chassis=desktop uuid=36434630-3439-3534-3838-3332FFFFFFFF
  *-core
Comment 9 Juergen Rose 2014-06-19 21:28:36 UTC
The diff of the ebuild from Comment 6 and lshw-02.17b-r1.ebuild:

root@impala:/usr/local/portage/sys-apps/lshw(50)# diff -U2  lshw-02.17b-r1.ebuild lshw-02.17b.ebuild
--- lshw-02.17b-r1.ebuild       2014-05-31 16:45:01.000000000 +0200
+++ lshw-02.17b.ebuild  2014-05-31 16:22:14.124953647 +0200
@@ -1,7 +1,7 @@
-# Copyright 1999-2014 Gentoo Foundation
+# Copyright 1999-2013 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/sys-apps/lshw/lshw-02.17b-r1.ebuild,v 1.1 2014/05/31 14:45:01 ssuominen Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-apps/lshw/lshw-02.17b.ebuild,v 1.1 2013/08/08 19:42:32 mr_bones_ Exp $
 
-EAPI=5
+EAPI=4
 inherit flag-o-matic eutils toolchain-funcs
 
@@ -33,7 +33,5 @@
 
 src_prepare() {
-       epatch \
-               "${FILESDIR}"/${P}-gentoo.patch \
-               "${FILESDIR}"/${P}-fat.patch
+       epatch "${FILESDIR}"/${P}-gentoo.patch
        # correct gettext behavior
        if [[ -n "${LINGUAS+x}" ]] ; then
@@ -49,4 +47,5 @@
                        src/po/Makefile || die
        fi
+       epatch "${FILESDIR}"/${P}-fat.patch
 }
Comment 10 Juergen Rose 2014-06-19 22:58:02 UTC
I masked lshw-02.17b-r1 and downgraded to the patched lshw-02.17b. This lshw worked without USB sticks and with vfat formated USB2 Sticks. But it also crashed
with a vfat formated USB3 stick. Then I upgraded again to lshw-02.17b-r1.
Then I got:

-------------------------------------------------
  1st:   USB3 stick in USB2 slot, lshw segfaults:
-------------------------------------------------
root@impala:/usr/local/portage/sys-apps/lshw(70)# hwinfo | grep -U2 -i patriot
      path = /devices/pci0000:00/0000:00:12.2/usb2/2-5/2-5:1.0/host27/target27:0:0/27:0:0:0
    vendor = 
    model = Patriot Memory
    rev = PMAP
    type = 0
--
    idProduct = 0x5500
    manufacturer = ""
    product = "Patriot Memory"
    serial = "0701424EB111B137"
    bcdDevice = 0100
--
  <6>[51853.869690] usb 2-5: New USB device found, idVendor=13fe, idProduct=5500
  <6>[51853.869696] usb 2-5: New USB device strings: Mfr=1, Product=2, SerialNumber=3
  <6>[51853.869698] usb 2-5: Product: Patriot Memory
  <6>[51853.869700] usb 2-5: Manufacturer:         
  <6>[51853.869701] usb 2-5: SerialNumber: 0701424EB111B137
  <6>[51853.869960] usb-storage 2-5:1.0: USB Mass Storage device detected
  <6>[51853.870097] scsi24 : usb-storage 2-5:1.0
  <5>[51854.917825] scsi 24:0:0:0: Direct-Access              Patriot Memory   
...
  SysFS Device Link: /devices/pci0000:00/0000:00:12.2/usb2/2-5/2-5:1.0/host27/target27:0:0/27:0:0:0
  Hardware Class: disk
  Model: "Patriot Memory"
  Vendor: usb 0x13fe 
  Device: usb 0x5500 "Patriot Memory"
  Revision: "PMAP"
  Serial ID: "0B7103174020"
root@impala:/usr/local/portage/sys-apps/lshw(71)# lshw -short
Segmentation fault        
root@impala:/usr/local/portage/sys-apps/lshw(73)# df | grep PATRIOT
/dev/sdd1                  15466528        64  15466464   1% /run/media/rose/PATRIOT



--------------------------------------------------
  2nd:   USB3 stick in USB3 slot,  lshw segfaults:
--------------------------------------------------

root@impala:/usr/local/portage/sys-apps/lshw(74)# hwinfo | grep -U2 -i patriot
      path = /devices/pci0000:00/0000:00:07.0/0000:04:00.0/usb3/3-1/3-1:1.0/host28/target28:0:0/28:0:0:0
    vendor = 
    model = Patriot Memory
    rev = PMAP
    type = 0
--
    idProduct = 0x5500
    manufacturer = ""
    product = "Patriot Memory"
    serial = "0701424EB111B137"
    bcdDevice = 0100
--
  <6>[51853.869690] usb 2-5: New USB device found, idVendor=13fe, idProduct=5500
  <6>[51853.869696] usb 2-5: New USB device strings: Mfr=1, Product=2, SerialNumber=3
  <6>[51853.869698] usb 2-5: Product: Patriot Memory
  <6>[51853.869700] usb 2-5: Manufacturer:         
  <6>[51853.869701] usb 2-5: SerialNumber: 0701424EB111B137
  <6>[51853.869960] usb-storage 2-5:1.0: USB Mass Storage device detected
  <6>[51853.870097] scsi24 : usb-storage 2-5:1.0
  <5>[51854.917825] scsi 24:0:0:0: Direct-Access              Patriot Memory   PMAP PQ: 0 ANSI: 6
  <5>[51854.918019] sd 24:0:0:0: Attached scsi generic sg5 type 0
  <5>[51855.447008] sd 24:0:0:0: [sdd] 30949376 512-byte logical blocks: (15.8 GB/14.7 GiB)
--
  <6>[52645.509443] usb 2-5: New USB device found, idVendor=13fe, idProduct=5500
  <6>[52645.509448] usb 2-5: New USB device strings: Mfr=1, Product=2, SerialNumber=3
  <6>[52645.509451] usb 2-5: Product: Patriot Memory
  <6>[52645.509453] usb 2-5: Manufacturer:         
  <6>[52645.509454] usb 2-5: SerialNumber: 0701424EB111B137
  <6>[52645.509755] usb-storage 2-5:1.0: USB Mass Storage device detected
  <6>[52645.510408] scsi25 : usb-storage 2-5:1.0
  <5>[52646.558590] scsi 25:0:0:0: Direct-Access              Patriot Memory   
...
root@impala:/usr/local/portage/sys-apps/lshw(76)# lshw 
Segmentation fault        

root@impala:/usr/local/portage/sys-apps/lshw(79)# df | grep PATRIOT
/dev/sdd1                  15466528        64  15466464   1% /run/media/rose/PATRIOT




-------------------------------------------------
  3rd:   USB2 stick in USB2 slot, lshw OK:
-------------------------------------------------

root@impala:/usr/local/portage/sys-apps/lshw(82)# hwinfo | grep -U2 -i Transcend
      path = /devices/pci0000:00/0000:00:12.2/usb2/2-5/2-5:1.0/host30/target30:0:0/30:0:0:0
    vendor = JetFlash
    model = Transcend 4GB
    rev = 1100
    type = 0
--
  <6>[54114.824579] usb-storage 2-5:1.0: USB Mass Storage device detected
  <6>[54114.824967] scsi26 : usb-storage 2-5:1.0
  <5>[54116.016779] scsi 26:0:0:0: Direct-Access     JetFlash Transcend 4GB    1100 PQ: 0 ANSI: 4
  <5>[54116.017002] sd 26:0:0:0: Attached scsi generic sg5 type 0
  <5>[54116.017709] sd 26:0:0:0: [sdd] 7680000 512-byte logical blocks: (3.93 GB/3.66 GiB)
--
  <6>[56916.279481] usb-storage 2-5:1.0: USB Mass Storage device detected
  <6>[56916.279868] scsi30 : usb-storage 2-5:1.0
  <5>[56917.471054] scsi 30:0:0:0: Direct-Access     JetFlash Transcend 4GB    1100 PQ: 0 ANSI: 4
  <5>[56917.471277] sd 30:0:0:0: Attached scsi generic sg6 type 0
  <5>[56917.471910] sd 30:0:0:0: [sde] 7680000 512-byte logical blocks: (3.93 GB/3.66 GiB)
--
  SysFS Device Link: /devices/pci0000:00/0000:00:12.2/usb2/2-5/2-5:1.0/host30/target30:0:0/30:0:0:0
  Hardware Class: disk
  Model: "JetFlash Transcend 4GB"
  Vendor: usb 0x8564 "JetFlash"
  Device: usb 0x1000 "Transcend 4GB"
  Revision: "1100"
  Serial ID: "AA00000000000485"

root@impala:/usr/local/portage/sys-apps/lshw(83)# lshw -short
H/W path                 Device      Class       Description
============================================================
                                     system      GA-790XTA-UD4
/0                                   bus         GA-790XTA-UD4
/0/0                                 memory      128KiB BIOS
/0/4                                 processor   Athlon
...
/0/100/5/0                           storage     88SE9128 PCIe SATA 6 Gb/s RAID controller
/0/100/6                             bridge      RD790 PCI to PCI bridge (PCI express gpp port C)
/0/100/6/0                           storage     JMB363 SATA/IDE Controller
/0/100/6/0.1                         storage     JMB363 SATA/IDE Controller
/0/100/7                             bridge      RX780/RD790 PCI to PCI bridge (PCI express gpp port D)
/0/100/7/0                           bus         uPD720200 USB 3.0 Host Controller
/0/100/7/0/0             usb3        bus         xHCI Host Controller
/0/100/7/0/1             usb1        bus         xHCI Host Controller
/0/100/a                             bridge      RD790 PCI to PCI bridge (PCI express gpp port F)
/0/100/a/0               eth0        network     RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller
/0/100/11                            storage     SB7x0/SB8x0/SB9x0 SATA Controller [AHCI mode]
/0/100/12                            bus         SB7x0/SB8x0/SB9x0 USB OHCI0 Controller
/0/100/12/1              usb5        bus         OHCI PCI host controller
/0/100/12.1                          bus         SB7x0 USB OHCI1 Controller
/0/100/12.1/1            usb6        bus         OHCI PCI host controller
/0/100/12.2                          bus         SB7x0/SB8x0/SB9x0 USB EHCI Controller
/0/100/12.2/1            usb2        bus         EHCI Host Controller
/0/100/12.2/1/5          scsi30      storage     Mass Storage Device
/0/100/12.2/1/5/0.0.0    /dev/sde    disk        3932MB SCSI Disk
/0/100/12.2/1/5/0.0.0/1  /dev/sde1   volume      3749MiB Windows FAT volume
/0/100/13                            bus         SB7x0/SB8x0/SB9x0 USB OHCI0 Controller
/0/100/13/1              usb7        bus         OHCI PCI host controller
/0/100/13/1/3                        input       TEMPerV1.4
/0/100/13.1                          bus         SB7x0 USB OHCI1 Controller
/0/100/13.1/1            usb8        bus         OHCI PCI host controller
/0/100/13.2                          bus         SB7x0/SB8x0/SB9x0 USB EHCI Controller
/0/100/13.2/1            usb4        bus         EHCI Host Controller
/0/100/13.2/1/4                      bus         HighSpeed Hub
/0/100/13.2/1/4/1                    input       USB-PS/2 Optical Mouse
/0/100/13.2/1/4/2                    bus         USB 1.1 2port downstream low power hub
/0/100/13.2/1/4/2/1                  input       USB Productivity Option Keyboard( has the hub in # 1 )
...
/0/100/14.4/e                        bus         TSB43AB23 IEEE-1394a-2000 Controller (PHY/Link)
/0/100/14.5                          bus         SB7x0/SB8x0/SB9x0 USB OHCI2 Controller
/0/100/14.5/1            usb9        bus         OHCI PCI host controller
/0/101                               bridge      Family 10h Processor 
...
/0/1                     scsi0       storage     
...
root@impala:/usr/local/portage/sys-apps/lshw(84)# df | grep -i trans
/dev/sde1                   3831748  1676216   2155532  44% /run/media/rose/Transcend




-------------------------------------------------
  4th:   USB2 stick in USB3 slot, lshw OK:
-------------------------------------------------

root@impala:/usr/local/portage/sys-apps/lshw(85)# hwinfo | grep -U2 -i Transcend
      path = /devices/pci0000:00/0000:00:12.2/usb2/2-3/2-3:1.0/host31/target31:0:0/31:0:0:0
    vendor = JetFlash
    model = Transcend 4GB
    rev = 1100
    type = 0
--
  <6>[54114.824579] usb-storage 2-5:1.0: USB Mass Storage device detected
  <6>[54114.824967] scsi26 : usb-storage 2-5:1.0
  <5>[54116.016779] scsi 26:0:0:0: Direct-Access     JetFlash Transcend 4GB    1100 PQ: 0 ANSI: 4
  <5>[54116.017002] sd 26:0:0:0: Attached scsi generic sg5 type 0
  <5>[54116.017709] sd 26:0:0:0: [sdd] 7680000 512-byte logical blocks: (3.93 GB/3.66 GiB)
--
  <6>[56916.279481] usb-storage 2-5:1.0: USB Mass Storage device detected
  <6>[56916.279868] scsi30 : usb-storage 2-5:1.0
  <5>[56917.471054] scsi 30:0:0:0: Direct-Access     JetFlash Transcend 4GB    1100 PQ: 0 ANSI: 4
  <5>[56917.471277] sd 30:0:0:0: Attached scsi generic sg6 type 0
  <5>[56917.471910] sd 30:0:0:0: [sde] 7680000 512-byte logical blocks: (3.93 GB/3.66 GiB)
--
  <6>[57340.890074] usb-storage 2-3:1.0: USB Mass Storage device detected
  <6>[57340.890306] scsi31 : usb-storage 2-3:1.0
  <5>[57342.082531] scsi 31:0:0:0: Direct-Access     JetFlash Transcend 4GB    1100 PQ: 0 ANSI: 4
  <5>[57342.082757] sd 31:0:0:0: Attached scsi generic sg5 type 0
  <5>[57342.084245] sd 31:0:0:0: [sdd] 7680000 512-byte logical blocks: (3.93 GB/3.66 GiB)
--
  SysFS Device Link: /devices/pci0000:00/0000:00:12.2/usb2/2-3/2-3:1.0/host31/target31:0:0/31:0:0:0
  Hardware Class: disk
  Model: "JetFlash Transcend 4GB"
  Vendor: usb 0x8564 "JetFlash"
  Device: usb 0x1000 "Transcend 4GB"
  Revision: "1100"
  Serial ID: "AA00000000000485"
root@impala:/usr/local/portage/sys-apps/lshw(85)# hwinfo | grep -U2 -i Transcend
      path = /devices/pci0000:00/0000:00:12.2/usb2/2-3/2-3:1.0/host31/target31:0:0/31:0:0:0
    vendor = JetFlash
    model = Transcend 4GB
    rev = 1100
    type = 0
--
  <6>[54114.824579] usb-storage 2-5:1.0: USB Mass Storage device detected
  <6>[54114.824967] scsi26 : usb-storage 2-5:1.0
  <5>[54116.016779] scsi 26:0:0:0: Direct-Access     JetFlash Transcend 4GB    1100 PQ: 0 ANSI: 4
  <5>[54116.017002] sd 26:0:0:0: Attached scsi generic sg5 type 0
  <5>[54116.017709] sd 26:0:0:0: [sdd] 7680000 512-byte logical blocks: (3.93 GB/3.66 GiB)
--
  <6>[56916.279481] usb-storage 2-5:1.0: USB Mass Storage device detected
  <6>[56916.279868] scsi30 : usb-storage 2-5:1.0
  <5>[56917.471054] scsi 30:0:0:0: Direct-Access     JetFlash Transcend 4GB    1100 PQ: 0 ANSI: 4
  <5>[56917.471277] sd 30:0:0:0: Attached scsi generic sg6 type 0
  <5>[56917.471910] sd 30:0:0:0: [sde] 7680000 512-byte logical blocks: (3.93 GB/3.66 GiB)
--
  <6>[57340.890074] usb-storage 2-3:1.0: USB Mass Storage device detected
  <6>[57340.890306] scsi31 : usb-storage 2-3:1.0
  <5>[57342.082531] scsi 31:0:0:0: Direct-Access     JetFlash Transcend 4GB    1100 PQ: 0 ANSI: 4
  <5>[57342.082757] sd 31:0:0:0: Attached scsi generic sg5 type 0
  <5>[57342.084245] sd 31:0:0:0: [sdd] 7680000 512-byte logical blocks: (3.93 GB/3.66 GiB)
--
  SysFS Device Link: /devices/pci0000:00/0000:00:12.2/usb2/2-3/2-3:1.0/host31/target31:0:0/31:0:0:0
  Hardware Class: disk
  Model: "JetFlash Transcend 4GB"
  Vendor: usb 0x8564 "JetFlash"
  Device: usb 0x1000 "Transcend 4GB"
  Revision: "1100"
  Serial ID: "AA00000000000485"

root@impala:/usr/local/portage/sys-apps/lshw(86)# lshw -short
H/W path                 Device      Class       Description
============================================================
                                     system      GA-790XTA-UD4
/0                                   bus         GA-790XTA-UD4
/0/0                                 memory      128KiB BIOS
/0/4                                 processor   Athlon
/0/4/a                               memory      128KiB L1 cache
/0/4/c                               memory      512KiB L3 cache
/0/b                                 memory      128KiB L1 cache
/0/29                                memory      8GiB System Memory
...
/0/100/7/0                           bus         uPD720200 USB 3.0 Host Controller
/0/100/7/0/0             usb3        bus         xHCI Host Controller
/0/100/7/0/1             usb1        bus         xHCI Host Controller
...
/0/100/12                            bus         SB7x0/SB8x0/SB9x0 USB OHCI0 Controller
/0/100/12/1              usb5        bus         OHCI PCI host controller
/0/100/12.1                          bus         SB7x0 USB OHCI1 Controller
/0/100/12.1/1            usb6        bus         OHCI PCI host controller
/0/100/12.2                          bus         SB7x0/SB8x0/SB9x0 USB EHCI Controller
/0/100/12.2/1            usb2        bus         EHCI Host Controller
/0/100/12.2/1/3          scsi31      storage     Mass Storage Device
/0/100/12.2/1/3/0.0.0    /dev/sdd    disk        3932MB SCSI Disk
/0/100/12.2/1/3/0.0.0/1  /dev/sdd1   volume      3749MiB Windows FAT volume
/0/100/13                            bus         SB7x0/SB8x0/SB9x0 USB OHCI0 Controller
/0/100/13/1              usb7        bus         OHCI PCI host controller
/0/100/13/1/3                        input       TEMPerV1.4
/0/100/13.1                          bus         SB7x0 USB OHCI1 Controller
/0/100/13.1/1            usb8        bus         OHCI PCI host controller
/0/100/13.2                          bus         SB7x0/SB8x0/SB9x0 USB EHCI Controller
/0/100/13.2/1            usb4        bus         EHCI Host Controller
/0/100/13.2/1/4                      bus         HighSpeed Hub
/0/100/13.2/1/4/1                    input       USB-PS/2 Optical Mouse
/0/100/13.2/1/4/2                    bus         USB 1.1 2port downstream low power hub
/0/100/13.2/1/4/2/1                  input       USB Productivity Option Keyboard( has the hub in # 1 )
...
/0/100/14.5                          bus         SB7x0/SB8x0/SB9x0 USB OHCI2 Controller
/0/100/14.5/1            usb9        bus         OHCI PCI host controller
/0/101                               bridge      Family 10h Processor HyperTransport Configuration
/0/102                               bridge      Family 10h Processor Address Map
/0/103                               bridge      Family 10h Processor DRAM Controller
/0/104                               bridge      Family 10h Processor Miscellaneous Control
/0/105                               bridge      Family 10h Processor Link Control
/0/1                     scsi0       storage     
/0/1/0.0.0               /dev/sda    disk        1TB Hitachi HDS72101
/0/1/0.0.0/1             /dev/sda1   volume      128MiB Linux raid autodetect partition
/0/1/0.0.0/2             /dev/sda2   volume      24GiB Linux swap volume
/0/1/0.0.0/3             /dev/sda3   volume      128GiB EXT4 volume
/0/1/0.0.0/4             /dev/sda4   volume      779GiB Extended partition
/0/1/0.0.0/4/5           /dev/sda5   volume      24MiB Linux filesystem partition
...

root@impala:/usr/local/portage/sys-apps/lshw(89)# df | grep -i trans
/dev/sdd1                   3831748  1676216   2155532  44% /run/media/rose/Transcend

root@impala:/usr/local/portage/sys-apps/lshw(90)# qlist -Iv lshw
sys-apps/lshw-02.17b-r1
Comment 11 Juergen Rose 2014-06-19 23:37:19 UTC
With a ext2 formatted USB3 stick lshw does not segfault.
Comment 12 Samuli Suominen (RETIRED) gentoo-dev 2014-06-20 06:20:17 UTC
If you believe it's the same issue, feel free to reopen the bug, you are the reporter. That'd mean the patch here is wrong or insufficient. I'll keep it
in tree anyway since it's from upstream, and thus, can't hurt.
Comment 13 Juergen Rose 2014-06-20 06:26:17 UTC
(In reply to Samuli Suominen from comment #12)
> If you believe it's the same issue, feel free to reopen the bug, you are the
> reporter. That'd mean the patch here is wrong or insufficient. I'll keep it
> in tree anyway since it's from upstream, and thus, can't hurt.

How can I reopen the bug? By changing the status from RESOLVED to CONFIRMED?
Comment 14 Samuli Suominen (RETIRED) gentoo-dev 2014-06-20 06:36:32 UTC
(In reply to Juergen Rose from comment #13)
> How can I reopen the bug? By changing the status from RESOLVED to CONFIRMED?

Yes. But to avoid bugspam, I did that for you now. :)
Comment 15 Juergen Rose 2014-06-22 07:08:38 UTC
(In reply to Juergen Rose from comment #11)
> With a ext2 formatted USB3 stick lshw does not segfault.

I investigated this issue a little bit more and found, that this issue happens only with one sort 16GB USB3 stick from Patriot. And it happens if it is vfat and ext2 formatted. But I do not have any difficulties to use these USB sticks elsewise.
Comment 16 Juergen Rose 2014-06-22 10:12:37 UTC
I created also a upstream ticket at http://ezix.org/project/ticket/653 .
Comment 17 Juergen Rose 2014-06-26 11:34:35 UTC
(In reply to Juergen Rose from comment #16)
> I created also a upstream ticket at http://ezix.org/project/ticket/653 .

I suppose, that there is an error in scsi.cc. The array rsp_buff has 256 Bytes
'len' is defined as 'unsigned int' at line 444. In line 484 len gets its value from rsp_buff[3]. The condition in line 485 is fulfilled, even if rsp_buff[3]<0. In the case of the Patriot USB stick rsp_buff[3] is -5, which gives a large len value, which results in the Segmentation fault in line 486.

I suppose, that I have a patch, which can be used as workaround.
Comment 18 Juergen Rose 2014-06-26 11:35:53 UTC
Created attachment 379714 [details, diff]
lshw-03.17b-scsi.patch
Comment 19 Juergen Rose 2014-06-26 11:36:34 UTC
Created attachment 379716 [details]
an ebuild using the scsi.patch
Comment 20 Ben Kohler gentoo-dev 2014-08-08 15:05:57 UTC
Looks like this fix is upstream now:

http://ezix.org/project/changeset/2535/packages/lshw/development/src/core/scsi.cc

Do you still get the same segfault with this patch applied?
Comment 21 SpanKY gentoo-dev 2017-03-15 05:08:40 UTC
was fixed in lshw-02.17b-r1 and merged upstream:
https://gitweb.gentoo.org/repo/gentoo/historical.git/commit/?id=8f7596cd7f4d1480776f19ddc1d1dde68002a206