(gdb) bt
#0 _IO_feof (fp=fp@entry=0x0) at feof.c:35
#1 0x000000000045dd88 in scan_usb (n=...) at usb.cc:383
#2 0x0000000000418279 in scan_system (system=...) at main.cc:113
#3 0x0000000000404571 in main (argc=1, argv=0x7ffc719cb4d8) at lshw.cc:238
Because of permission, since there was already check if the files existed before the code bellow:
if (!exists(SYSKERNELDEBUGUSBDEVICES) && !exists(PROCBUSUSBDEVICES))
__return false;
Code Problem (so far): code doesn't check if the second opening was successful before moving on. If SYSKERNELDEBUGUSBDEVICES exists but can't be opened AND PROCBUSUSBDEVICE doesn't exist, it will still try to open it not checking if it could.
According to this core:
(gdb) bt b4d8) at lshw.cc:238
#0 _IO_feof (fp=fp@entry=0x0) at feof.c:35
#1 0x000000000045dd88 in scan_usb (n=...) at usb.cc:383
#2 0x0000000000418279 in scan_system (system=...) at main.cc:113
#3 0x0000000000404571 in main (argc=1, argv=0x7ffc719c
The crash has happened when scanning from USB:
usbdevices = fopen(SYSKERNEL DEBUGUSBDEVICES , "r"); BDEVICES, "r");
if(!usbdevices)
__usbdevices = fopen(PROCBUSUS
while(! feof(usbdevices ))
{
It is likely that it couldn't open one of these files:
#define PROCBUSUSBDEVICES "/proc/ bus/usb/ devices" SBDEVICES "/sys/kernel/ debug/usb/ devices"
#define SYSKERNELDEBUGU
Because of permission, since there was already check if the files existed before the code bellow:
if (!exists( SYSKERNELDEBUGU SBDEVICES) && !exists( PROCBUSUSBDEVIC ES))
__return false;
Code Problem (so far): code doesn't check if the second opening was successful before moving on. If SYSKERNELDEBUGU SBDEVICES exists but can't be opened AND PROCBUSUSBDEVICE doesn't exist, it will still try to open it not checking if it could.