[Bug 1483615] Re: usbhid-ups driver segfaults on discovery of UPS
Hi Charles, Thanks. I think that solved it: root@barnbox:~# tail -n 7 /etc/nut/ups.conf && /lib/nut/usbhid-ups -u nut -a apc [apc] driver = usbhid-ups port = auto desc = "APC Back-UPS" #bus="001" #vendor="051d" Network UPS Tools - Generic HID driver 0.38 (2.7.1) USB communication driver 0.32 Using subdriver: APC HID 0.95 root@barnbox:~# FWIW when I report this original bug I did reboot, update, reboot and re-test just to be sure it still existed... I really *did* try to narrow it down! Thanks anyway... now to go back to the UPS config as planned! -- You received this bug notification because you are a member of Ubuntu Server Team, which is subscribed to nut in Ubuntu. https://bugs.launchpad.net/bugs/1483615 Title: usbhid-ups driver segfaults on discovery of UPS To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/nut/+bug/1483615/+subscriptions -- Ubuntu-server-bugs mailing list Ubuntu-server-bugs@lists.ubuntu.com Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-server-bugs
[Bug 1483615] Re: usbhid-ups driver segfaults on discovery of UPS
Since you only have one UPS, I would recommend removing the extra "-x" options (this prevents problems down the road if a new kernel assigns a different bus number). I believe the regex matcher is case-sensitive, so the "051D" does not match. Interestingly enough, we did have another recent unreproducible report of an APC-related segfault that cleared up after a reboot: https://github.com/networkupstools/nut/issues/252 but it would be interesting to find out why the string descriptors are sometimes not available. -- You received this bug notification because you are a member of Ubuntu Server Team, which is subscribed to nut in Ubuntu. https://bugs.launchpad.net/bugs/1483615 Title: usbhid-ups driver segfaults on discovery of UPS To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/nut/+bug/1483615/+subscriptions -- Ubuntu-server-bugs mailing list Ubuntu-server-bugs@lists.ubuntu.com Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-server-bugs
[Bug 1483615] Re: usbhid-ups driver segfaults on discovery of UPS
Hi Charles, I can see your thinking, but no, this isn't a VM, nor is the kernel I'm using a Hypervisor - it's a plain old machine: root@barnbox:~# grep -i hyper /proc/cpuinfo root@barnbox:~# I updated the machine with apt-get (again) and I also updated the machine's BIOS. Prior to doing the updates I tried the lsusb command and it worked: root@barnbox:~# lsusb -vvv -d051d: Bus 001 Device 003: ID 051d:0002 American Power Conversion Uninterruptible Power Supply Device Descriptor: bLength18 bDescriptorType 1 bcdUSB 1.10 bDeviceClass0 (Defined at Interface level) bDeviceSubClass 0 bDeviceProtocol 0 bMaxPacketSize0 8 idVendor 0x051d American Power Conversion idProduct 0x0002 Uninterruptible Power Supply bcdDevice0.06 iManufacturer 3 American Power Conversion iProduct1 Back-UPS CS 350 FW:807.q10 .I USB FW:q10 iSerial 2 4B1419P32390 bNumConfigurations 1 Configuration Descriptor: bLength 9 bDescriptorType 2 wTotalLength 34 bNumInterfaces 1 bConfigurationValue 1 iConfiguration 0 bmAttributes 0xe0 Self Powered Remote Wakeup MaxPower2mA Interface Descriptor: bLength 9 bDescriptorType 4 bInterfaceNumber0 bAlternateSetting 0 bNumEndpoints 1 bInterfaceClass 3 Human Interface Device bInterfaceSubClass 0 No Subclass bInterfaceProtocol 0 None iInterface 0 HID Device Descriptor: bLength 9 bDescriptorType33 bcdHID 1.10 bCountryCode 33 US bNumDescriptors 1 bDescriptorType34 Report wDescriptorLength1217 Report Descriptors: ** UNAVAILABLE ** Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x81 EP 1 IN bmAttributes3 Transfer TypeInterrupt Synch Type None Usage Type Data wMaxPacketSize 0x0006 1x 6 bytes bInterval 100 Device Status: 0x (Bus Powered) root@barnbox:~# However, weirdly, since doing the update, usbhid-ups no longer segfaults - it still doesn't work, but it's interesting Annoyingly, I never ran the intermediate stages, so I don't know which change made the difference (I suppose it could be HP's firmware doing something funky, but I doubt it...): I believe this usbhid-ups command should match the UPS, but it appears to skip it: root@barnbox:~# /lib/nut/usbhid-ups -u nut -a apc -x bus=001 -x vendorid=051D -x productid=0002 - Network UPS Tools - Generic HID driver 0.38 (2.7.1) USB communication driver 0.32 0.00 debug level is '4' 0.000409 upsdrv_initups... 0.022724 Checking device (1D6B/0003) (005/001) 0.023048 - VendorID: 1d6b 0.023060 - ProductID: 0003 0.023064 - Manufacturer: unknown 0.023067 - Product: unknown 0.023069 - Serial Number: unknown 0.023072 - Bus: 005 0.023075 Trying to match device 0.023087 Device does not match - skipping 0.023225 Checking device (1D6B/0002) (004/001) 0.023392 - VendorID: 1d6b 0.023405 - ProductID: 0002 0.023409 - Manufacturer: unknown 0.023412 - Product: unknown 0.023414 - Serial Number: unknown 0.023417 - Bus: 004 0.023420 Trying to match device 0.023424 Device does not match - skipping 0.023492 Checking device (1D6B/0001) (003/001) 0.054600 - VendorID: 1d6b 0.054612 - ProductID: 0001 0.054616 - Manufacturer: unknown 0.054619 - Product: unknown 0.054622 - Serial Number: unknown 0.054624 - Bus: 003 0.054627 Trying to match device 0.054632 Device does not match - skipping 0.062511 Checking device (0424/4030) (002/004) 0.062541 - VendorID: 0424 0.062546 - ProductID: 4030 0.062549 - Manufacturer: unknown 0.062552 - Product: unknown 0.062555 - Serial Number: unknown 0.062557 - Bus: 002 0.062560 Trying to match device 0.062564 Device does not match - skipping 0.062570 Checking device (0424/2660) (002/003) 0.062580 - VendorID: 0424 0.062583 - ProductID: 2660 0.062586 - Manufacturer: unknown 0.062588 - Product: unknown 0.062591 - Serial Number: unknown 0.062593 - Bus: 002 0.062596 Trying to match device 0.062599 Device does not match - skipping 0.062603 Checking device (8087/0024) (002/002) 0.062611 - VendorID: 8087 0.
[Bug 1483615] Re: usbhid-ups driver segfaults on discovery of UPS
@davis65536: I think we might have a lead on this. Are you running in a VM? https://github.com/networkupstools/nut/issues/258 The APC portion of usbhid-ups expects that if it can open the device, it can read the string descriptors. Your system is printing "unknown" for the Manufacturer, Product and Serial Number lines for your UPS. IMHO this is also a bug elsewhere (libusb, kernel or hypervisor?) since the Product string is the easiest way to distinguish between the various 051d:0002 USB devices, though I agree that the driver should be more robust. Can you see the APC vendor string if you run "lsusb -vvv -d051d:" as root? -- You received this bug notification because you are a member of Ubuntu Server Team, which is subscribed to nut in Ubuntu. https://bugs.launchpad.net/bugs/1483615 Title: usbhid-ups driver segfaults on discovery of UPS To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/nut/+bug/1483615/+subscriptions -- Ubuntu-server-bugs mailing list Ubuntu-server-bugs@lists.ubuntu.com Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-server-bugs
[Bug 1483615] Re: usbhid-ups driver segfaults on discovery of UPS
Status changed to 'Confirmed' because the bug affects multiple users. ** Changed in: nut (Ubuntu) Status: New => Confirmed -- You received this bug notification because you are a member of Ubuntu Server Team, which is subscribed to nut in Ubuntu. https://bugs.launchpad.net/bugs/1483615 Title: usbhid-ups driver segfaults on discovery of UPS To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/nut/+bug/1483615/+subscriptions -- Ubuntu-server-bugs mailing list Ubuntu-server-bugs@lists.ubuntu.com Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-server-bugs
[Bug 1483615] Re: usbhid-ups driver segfaults on discovery of UPS
** Changed in: nut (Ubuntu) Importance: Undecided => Medium -- You received this bug notification because you are a member of Ubuntu Server Team, which is subscribed to nut in Ubuntu. https://bugs.launchpad.net/bugs/1483615 Title: usbhid-ups driver segfaults on discovery of UPS To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/nut/+bug/1483615/+subscriptions -- Ubuntu-server-bugs mailing list Ubuntu-server-bugs@lists.ubuntu.com Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-server-bugs
[Bug 1483615] Re: usbhid-ups driver segfaults on discovery of UPS
** Attachment added: "Valgrind logfile" https://bugs.launchpad.net/ubuntu/+source/nut/+bug/1483615/+attachment/4442830/+files/valgrind.log -- You received this bug notification because you are a member of Ubuntu Server Team, which is subscribed to nut in Ubuntu. https://bugs.launchpad.net/bugs/1483615 Title: usbhid-ups driver segfaults on discovery of UPS To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/nut/+bug/1483615/+subscriptions -- Ubuntu-server-bugs mailing list Ubuntu-server-bugs@lists.ubuntu.com Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-server-bugs
[Bug 1483615] Re: usbhid-ups driver segfaults on discovery of UPS
** Attachment added: "GDB session with backtrace" https://bugs.launchpad.net/ubuntu/+source/nut/+bug/1483615/+attachment/4442828/+files/01_gdb_session.txt -- You received this bug notification because you are a member of Ubuntu Server Team, which is subscribed to nut in Ubuntu. https://bugs.launchpad.net/bugs/1483615 Title: usbhid-ups driver segfaults on discovery of UPS To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/nut/+bug/1483615/+subscriptions -- Ubuntu-server-bugs mailing list Ubuntu-server-bugs@lists.ubuntu.com Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-server-bugs
[Bug 1483615] Re: usbhid-ups driver segfaults on discovery of UPS
** Attachment added: "Valgrind session output" https://bugs.launchpad.net/ubuntu/+source/nut/+bug/1483615/+attachment/4442829/+files/02_valgrind_session.txt -- You received this bug notification because you are a member of Ubuntu Server Team, which is subscribed to nut in Ubuntu. https://bugs.launchpad.net/bugs/1483615 Title: usbhid-ups driver segfaults on discovery of UPS To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/nut/+bug/1483615/+subscriptions -- Ubuntu-server-bugs mailing list Ubuntu-server-bugs@lists.ubuntu.com Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-server-bugs