NUT not work with apc backups with usb through usbhid-ups

Bug #1647088 reported by unicorp99
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
nut (Ubuntu)
Expired
Undecided
Unassigned

Bug Description

NUT not work with apc backups with usb through usbhid-ups

Dec 3 00:36:27 srv kernel: [10035.162725] usb 3-14: new low-speed USB device number 8 using xhci_hcd
Dec 3 00:36:27 srv kernel: [10035.356279] usb 3-14: New USB device found, idVendor=051d, idProduct=0002
Dec 3 00:36:27 srv kernel: [10035.356281] usb 3-14: New USB device strings: Mfr=3, Product=1, SerialNumber=2
Dec 3 00:36:27 srv kernel: [10035.356283] usb 3-14: Product: Back-UPS 500 FW: 6.2.I USB FW: c1
Dec 3 00:36:27 srv kernel: [10035.356284] usb 3-14: Manufacturer: American Power Conversion
Dec 3 00:36:27 srv kernel: [10035.356284] usb 3-14: SerialNumber: BB0116039701
Dec 3 00:36:27 srv kernel: [10035.356455] usb 3-14: ep 0x81 - rounding interval to 64 microframes, ep desc says 80 microframes
Dec 3 00:36:28 srv kernel: [10035.719088] hid-generic 0003:051D:0002.0003: hiddev0,hidraw2: USB HID v1.00 Device [American Power Conversion Back-UPS 500 FW: 6.2.I USB FW: c1 ] on usb-0000:00:14.0-14/input0

Dec 3 00:41:02 srv kernel: [10309.863851] usbhid-ups[11415]: segfault at 0 ip 00007fb58423ff37 sp 00007ffeb7276e98 error 4 in libc-2.23.so[7fb5840fb000+1bf000]
Dec 3 00:41:07 srv kernel: [10315.075973] usbhid-ups[11422]: segfault at 0 ip 00007f1a59972f37 sp 00007fff7a759e38 error 4 in libc-2.23.so[7f1a5982e000+1bf000]
Dec 3 00:41:12 srv kernel: [10320.288460] usbhid-ups[11424]: segfault at 0 ip 00007f32e9302f37 sp 00007ffe6f732bf8 error 4 in libc-2.23.so[7f32e91be000+1bf000]

also, in another computer:
Dec 3 17:59:36 srva kernel: [72698.400059] usb 2-1: new low-speed USB device number 2 using uhci_hcd
Dec 3 17:59:36 srva kernel: [72698.823143] usb 2-1: New USB device found, idVendor=051d, idProduct=0002
Dec 3 17:59:36 srva kernel: [72698.823154] usb 2-1: New USB device strings: Mfr=3, Product=1, SerialNumber=2
Dec 3 17:59:36 srva kernel: [72698.823161] usb 2-1: Product: Back-UPS ES 525 FW:851.t3.I USB FW:t3
Dec 3 17:59:36 srva kernel: [72698.823166] usb 2-1: Manufacturer: American Power Conversion
Dec 3 17:59:36 srva kernel: [72698.823171] usb 2-1: SerialNumber: NB0705025602
Dec 3 17:59:36 srva mtp-probe: checking bus 2, device 2: "/sys/devices/pci0000:00/0000:00:1d.0/usb2/2-1"
Dec 3 17:59:37 srva kernel: [72699.277796] usbcore: registered new interface driver usbhid
Dec 3 17:59:37 srva kernel: [72699.277806] usbhid: USB HID core driver
Dec 3 17:59:37 srva kernel: [72699.666420] hid-generic 0003:051D:0002.0001: hiddev0,hidraw0: USB HID v1.10 Device [American Power Conversion Back-UPS ES 525 FW:851.t3.I USB FW:t3] on usb-0000:00:1d.0-1/input0
Dec 3 18:11:55 srva kernel: [73437.976362] usbhid-ups[24303]: segfault at 0 ip 00007fb4aebfbbc4 sp 00007fff85c568c8 error 4 in libc-2.23.so[7fb4aeb70000+1bf000]
Dec 3 18:12:02 srva kernel: [73444.420556] usbhid-ups[24321]: segfault at 0 ip 00007f7dd5ffbbc4 sp 00007fff9eeb44a8 error 4 in libc-2.23.so[7f7dd5f70000+1bf000]
Dec 3 18:12:08 srva kernel: [73450.284282] usbhid-ups[24323]: segfault at 0 ip 00007fc95f0c6bc4 sp 00007ffd08c392f8 error 4 in libc-2.23.so[7fc95f03b000+1bf000]

ProblemType: Bug
DistroRelease: Ubuntu 16.04
Package: nut 2.7.2-4ubuntu1
ProcVersionSignature: Ubuntu 4.4.0-51.72-generic 4.4.30
Uname: Linux 4.4.0-51-generic x86_64
NonfreeKernelModules: nvidia_uvm nvidia_drm nvidia_modeset nvidia
ApportVersion: 2.20.1-0ubuntu2.1
Architecture: amd64
Date: Sun Dec 4 00:50:20 2016
KernelVersion: Linux hub2 4.4.0-51-generic #72-Ubuntu SMP Thu Nov 24 18:29:54 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
PackageArchitecture: all
ProcEnviron:
 LANGUAGE=ru:en_US
 TERM=xterm
 PATH=(custom, no user)
 LANG=ru_RU.UTF-8
 SHELL=/bin/bash
SourcePackage: nut
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
unicorp99 (unicorp99) wrote :
Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

It is certainly an issue segfaulting, thanks for reporting the bug.

I wonder if it is more about your special Hardware or your configuration for it.
The log is full of:
дек 03 22:50:04 hostname upsd[2401]: Can't connect to UPS [myups] (usbhid-ups-myups): No such file or directo

Unfortunately I found no pointer what is missing.

Could you reset the nut configuration and restart it.
And then go step by step to your config - mayby you can bisect the critical config part that triggers it.

Also asking for anybody out there who can to try to repdocue - adding Jon for that to unpack his UPS :-)

Changed in nut (Ubuntu):
status: New → Incomplete
Revision history for this message
Arnaud Quette (aquette) wrote :

Hi guys,

this is very possibly a duplicate of #1483615
the error is probably due to an issue retrieving a string, and not handled in the driver code.
To confirm, please start the driver in debug mode using (as root):
/lib/nut/usbhid-ups -u nut -DDD -a myups
then
/lib/nut/usbhid-ups -u root -DDD -a myups

if confirmed, this was fixed upstream: https://github.com/networkupstools/nut/commit/f679a2820e49cbdec4138295de5e8947ee953a8a

However, as mentioned in the other ticket, the above fix has some negative impact.
this may in the end be due to another ticket (tied to udev and privileges application) logged by Charles Lepple. This privileges issues could lead to the string retrieval issue, causing these bugs.

All in all, adding the patch has more benefits than drawbacks

Revision history for this message
unicorp99 (unicorp99) wrote :

Sorry, i can not replay errors, now nut works all right (after reboot old server i915 P4-651 and workstation z97 i5)

In first installation nut and connect APC back-ups ES525 - nut not work and show
srv kernel: [10309.863851] usbhid-ups[11415]: segfault at 0 ip 00007fb58423ff37 sp 00007ffeb7276e98 error 4 in libc-2.23.so[7fb5840fb000+1bf000]

Now, after reboot computers - no error and nut work all right.
I reboot server after three days and ups work!
Then i check on workstation and ups work.

But in first 2016-12-03 not work.
Ups connect before nut installation.
What is changes: computers reboot with nut installation.

Revision history for this message
unicorp99 (unicorp99) wrote :
Download full text (6.0 KiB)

I uninstall nut and reboot workstation i5. dpkg -P nut nut-server
Then i connect ups with usb.
apt-get install nut nut-server
correct ups.conf to apc and REPLAY:

/lib/nut/usbhid-ups -u nut -DDD -a myups
Network UPS Tools - Generic HID driver 0.38 (2.7.2)
USB communication driver 0.32
   0.000000 debug level is '3'
   0.000834 upsdrv_initups...
   0.121032 Checking device (1D6B/0003) (004/001)
   0.121197 - VendorID: 1d6b
   0.121204 - ProductID: 0003
   0.121206 - Manufacturer: unknown
   0.121208 - Product: unknown
   0.121210 - Serial Number: unknown
   0.121211 - Bus: 004
   0.121213 Trying to match device
   0.121217 Device does not match - skipping
   0.121225 Checking device (0781/5572) (003/005)
   0.121243 - VendorID: 0781
   0.121251 - ProductID: 5572
   0.121255 - Manufacturer: unknown
   0.121258 - Product: unknown
   0.121262 - Serial Number: unknown
   0.121266 - Bus: 003
   0.121269 Trying to match device
   0.121271 Device does not match - skipping
   0.121276 Checking device (051D/0002) (003/004)
   0.121283 - VendorID: 051d
   0.121286 - ProductID: 0002
   0.121288 - Manufacturer: unknown
   0.121290 - Product: unknown
   0.121291 - Serial Number: unknown
   0.121293 - Bus: 003
   0.121295 Trying to match device
Ошибка сегментирования (сделан дамп памяти)

Dec 10 10:36:06 hub2 systemd[1]: Starting LSB: Network UPS Tools initscript...
Dec 10 10:36:06 hub2 nut-server[3800]: * Starting NUT - power devices information server and drivers
Dec 10 10:36:06 hub2 kernel: [ 116.497673] show_signal_msg: 24 callbacks suppressed
Dec 10 10:36:06 hub2 kernel: [ 116.497676] usbhid-ups[3807]: segfault at 0 ip 00007fd23776cf37 sp 00007ffd99ed1f78 error 4 in libc-2.23.so[7fd237628000+1bf000]
Dec 10 10:36:11 hub2 kernel: [ 121.701961] usbhid-ups[3809]: segfault at 0 ip 00007fe64f161f37 sp 00007ffcce113c68 error 4 in libc-2.23.so[7fe64f01d000+1bf000]
Dec 10 10:36:16 hub2 kernel: [ 126.906185] usbhid-ups[3811]: segfault at 0 ip 00007f8127095f37 sp 00007ffd0bab1e98 error 4 in libc-2.23.so[7f8126f51000+1bf000]
Dec 10 10:36:16 hub2 upsd[3813]: listening on 127.0.0.1 port 3493
Dec 10 10:36:16 hub2 upsd[3813]: not listening on ::1 port 3493
Dec 10 10:36:16 hub2 upsd[3813]: Can't connect to UPS [myups] (usbhid-ups-myups): No such file or directory
Dec 10 10:36:16 hub2 upsd[3815]: Startup successful
Dec 10 10:36:16 hub2 nut-server[3800]: ...done.
Dec 10 10:36:16 hub2 systemd[1]: Started LSB: Network UPS Tools initscript.
Dec 10 10:37:32 hub2 kernel: [ 203.070527] usbhid-ups[4449]: segfault at 0 ip 00007f29fa721f37 sp 00007fff26badd08 error 4 in libc-2.23.so[7f29fa5dd000+1bf000]

then:

/lib/nut/usbhid-ups -u root -DDD -a myups
Network UPS Tools - Generic HID driver 0.38 (2.7.2)
USB communication driver 0.32
   0.000000 debug level is '3'
   0.000404 upsdrv_initups...
   0.121928 Checking device (1D6B/0003) (004/001)
   0.122368 - VendorID: 1d6b
   0.122383 - ProductID: 0003
   0.122385 - Manufacturer: Linux 4.4.0-53-generic xhci-hcd
   0.122386 - Product: xHCI Host Controller
   0.122387 - Serial Number:...

Read more...

Revision history for this message
unicorp99 (unicorp99) wrote :

server P4 ups back-ups es525
workstation i5 ups back-ups 500

Revision history for this message
unicorp99 (unicorp99) wrote :

and after reboot workstation nut is work all right.

Revision history for this message
Nish Aravamudan (nacc) wrote :

@aquette, are you able to confirm based upon @unicorp99's logs if this is the upstream bug you referred to?

Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for nut (Ubuntu) because there has been no activity for 60 days.]

Changed in nut (Ubuntu):
status: Incomplete → Expired
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.