Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 497170

Summary: =sys-power/nut-2.6.5-r1: blazer_usb driver is broken with =dev-libs/libusb-1.0.18[udev]
Product: Gentoo Linux Reporter: Coacher <itumaykin+gentoo>
Component: [OLD] Core systemAssignee: Robin Johnson <robbat2>
Status: CONFIRMED ---    
Severity: normal CC: base-system, ilyapoz, peter, prometheanfire, stharward, web
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
URL: https://github.com/networkupstools/nut/issues/114
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: emerge --info nut
ups.conf

Description Coacher 2014-01-05 19:49:33 UTC
Hello.

Recently virtual/libusb-{0,1}-r1 and related packages have gone stable. After libusb upgrade my UPS is not detected by nut anymore. Rebuilding nut doesn't help. If I downgrade back to virtual/libusb-{0,1}, then everything works fine again.

This is the error message printed by `/etc/init.d/upsdrv start` command when run against libusb-r1:

 * Starting UPS drivers ...
Network UPS Tools - UPS driver controller 2.6.5-Unversioned directory
Network UPS Tools - Megatec/Q1 protocol USB driver 0.09 (2.6.5-Unversioned directory)
No supported devices found. Please check your device availability with 'lsusb'
and make sure you have an up-to-date version of NUT. If this does not help,
try running the driver with at least 'subdriver', 'vendorid' and 'productid'
options specified. Please refer to the man page for details about these options
(man 8 blazer).

Driver failed to start (exit status=1)

Related part of nut log:

Jan  5 03:32:22 Plasma upsd[2342]: listening on 127.0.0.1 port 3493
Jan  5 03:32:22 Plasma upsd[2342]: Can't connect to UPS [Ippon] (blazer_usb-Ippon): No such file or directory
Jan  5 03:32:22 Plasma upsd[2343]: Startup successful
Jan  5 03:32:22 Plasma upsmon[2359]: Startup successful
Jan  5 03:32:22 Plasma upsd[2343]: User upsmaster@127.0.0.1 logged into UPS [Ippon]
Jan  5 03:32:22 Plasma upsmon[2361]: Poll UPS [Ippon@localhost] failed - Driver not connected
Jan  5 03:32:22 Plasma upsmon[2361]: Communications with UPS Ippon@localhost lost
Jan  5 03:32:27 Plasma upsmon[2361]: Poll UPS [Ippon@localhost] failed - Driver not connected
Jan  5 03:32:27 Plasma upsmon[2361]: UPS Ippon@localhost is unavailable

If you need any additional info, I'll provide it.

Reproducible: Always
Comment 1 Coacher 2014-01-05 19:50:33 UTC
Created attachment 367112 [details]
emerge --info nut
Comment 2 Coacher 2014-01-05 19:50:45 UTC
Created attachment 367114 [details]
ups.conf
Comment 3 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2014-01-05 20:43:04 UTC
1. Please try nutdrv_qx in nut-2.7.1.

2. 
If that still fails, can you test which variants of libusb are actually broken?
Your test list should be:
=dev-libs/libusb-compat-0.1.4
>=dev-libs/libusb-compat-0.1.5-r2
=dev-libs/libusb-1.0.9
=dev-libs/libusb-1.0.9-r2
dev-libs/libusbx

3.
Once you narrow down which versions, please strace the start of the specific ups driver
Comment 4 Coacher 2014-01-06 23:15:14 UTC
(In reply to Robin Johnson from comment #3)
> 1. Please try nutdrv_qx in nut-2.7.1.

Both blazer_usb and nutdrv_qx drivers from nut-2.7.1 suffer from this issue.
Comment 5 Coacher 2014-01-07 22:05:35 UTC
(In reply to Robin Johnson from comment #3)
> 2. 
> If that still fails, can you test which variants of libusb are actually
> broken?
> Your test list should be:
> =dev-libs/libusb-compat-0.1.4
> >=dev-libs/libusb-compat-0.1.5-r2
> =dev-libs/libusb-1.0.9
> =dev-libs/libusb-1.0.9-r2
> dev-libs/libusbx

These results are with nut-2.6.5-r1.

1.
virtual/libusb-0
virtual/libusb-1-r1
dev-libs/libusb-compat-0.1.5
dev-libs/libusbx-1.0.17

Fails.

2.
virtual/libusb-0
virtual/libusb-1-r1
dev-libs/libusb-compat-0.1.5
dev-libs/libusb-1.0.9-r2

Works.


I was unable to test virtual/libusb-0-r1 together with virtual/libusb-1.
virtual/libusb-0-r1 wants dev-libs/libusb-compat-0.1.5-r2, which wants virtual/libusb-1 with ABI_X86 USE flags and that is virtual/libusb-1-r1 only.

It looks like the problem is in libusbx though.
Comment 6 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2014-01-07 22:39:51 UTC
peter:
libusbx seems to break some of the NUT modules. At least blazer_usb and nutdrv_qx per this bug.
Comment 7 jms 2014-01-24 20:25:00 UTC
not sure if this is relevant in this bug.
but upon upgrading to libusbx-1.0.17

each time I emerge world I now get  a 
emerge: there are no ebuilds to satisfy ">=dev-libs/libusbx-1.0.16-r3:1[abi_x86_32(-)?,abi_x86_64(-)?,abi_x86_x32(-)?,abi_mips_n32(-)?,abi_mips_n64(-)?,abi_mips_o32(-)?]".

I just put some info on the forum about this
https://forums.gentoo.org/viewtopic-t-982238.html


if this not relevant feel free to remove this comment
Comment 8 Samuli Suominen (RETIRED) gentoo-dev 2014-01-25 05:57:09 UTC
(In reply to jms from comment #7)
> not sure if this is relevant in this bug.

not even remotely.
Comment 9 Coacher 2014-03-04 11:24:10 UTC
Ping
Comment 10 Samuli Suominen (RETIRED) gentoo-dev 2014-03-04 12:01:24 UTC
Have you tried =dev-libs/libusb-1.0.18? Have you tried it with and without USE="udev"?
Because dev-libs/libusbx is about to be lastrited from tree as it merged back to libusb since version 1.0.18.

Plus the bug has very little information to go with, and the failure is driver (hardware) specific, so if you still have problems with 1.0.18, I'd go with
the upstream mailing list, upstream bugzilla, maybe one of the upstream
developers has the hardware to reproduce the bug and fix it.
Comment 11 Coacher 2014-03-04 22:05:08 UTC
(In reply to Samuli Suominen from comment #10)
> Have you tried =dev-libs/libusb-1.0.18? Have you tried it with and without
> USE="udev"?
> Because dev-libs/libusbx is about to be lastrited from tree as it merged
> back to libusb since version 1.0.18.
> 
> Plus the bug has very little information to go with, and the failure is
> driver (hardware) specific, so if you still have problems with 1.0.18, I'd
> go with
> the upstream mailing list, upstream bugzilla, maybe one of the upstream
> developers has the hardware to reproduce the bug and fix it.

I will test all cases you've suggested during the weekend when I will have more spare time.
Comment 12 Coacher 2014-03-12 17:59:57 UTC
(In reply to Samuli Suominen from comment #10)
> Have you tried =dev-libs/libusb-1.0.18? Have you tried it with and without
> USE="udev"?
> Because dev-libs/libusbx is about to be lastrited from tree as it merged
> back to libusb since version 1.0.18.
> 
> Plus the bug has very little information to go with, and the failure is
> driver (hardware) specific, so if you still have problems with 1.0.18, I'd
> go with
> the upstream mailing list, upstream bugzilla, maybe one of the upstream
> developers has the hardware to reproduce the bug and fix it.

Tested with sys-power/nut-2.6.5-r1 (latest stable to date):

1.
virtual/libusb-0
virtual/libusb-1
dev-libs/libusb-compat-0.1.5
dev-libs/libusb-1.0.18[+udev]

Fails.

2.
virtual/libusb-0
virtual/libusb-1
dev-libs/libusb-compat-0.1.5
dev-libs/libusb-1.0.18[-udev]

Works.

Yes, I use old versions of virtual/libusb and libusb-compat that were removed from tree because of this very bug.
Comment 13 Coacher 2014-03-12 18:13:19 UTC
(In reply to Coacher from comment #12)
> Tested with sys-power/nut-2.6.5-r1 (latest stable to date):
> 
> 1.
> virtual/libusb-0
> virtual/libusb-1
> dev-libs/libusb-compat-0.1.5
> dev-libs/libusb-1.0.18[+udev]
> 
> Fails.
> 
> 2.
> virtual/libusb-0
> virtual/libusb-1
> dev-libs/libusb-compat-0.1.5
> dev-libs/libusb-1.0.18[-udev]
> 
> Works.

Same results with sys-power/nut-2.7.1.
Comment 14 Samuli Suominen (RETIRED) gentoo-dev 2014-03-12 19:25:16 UTC
feel free to set USE="-udev" meanwhile and upgrade, it's optional flag for libusb, I don't know of anything *requiring* it (yet)
Comment 15 Coacher 2014-03-12 19:40:43 UTC
(In reply to Samuli Suominen from comment #14)
> feel free to set USE="-udev" meanwhile and upgrade, it's optional flag for
> libusb, I don't know of anything *requiring* it (yet)

Yes, I already did this. Thanks.
Comment 16 Coacher 2014-03-15 18:38:12 UTC
Additional note: though blazer_usb starts and works with libusb-1.0.18 it is very unstable. I experience driver crashes every 2-3 days, while with libusb-1.0.9 driver worked for months.

I am aware this is not Gentoo issue, I've posted this as a notice for other Gentoo users who may suffer from this bug.
Comment 17 Peter Stuge 2014-03-15 19:01:41 UTC
I'm the libusb.org maintainer, who released libusb-1.0.9.

(In reply to Coacher from comment #16)
> Additional note: though blazer_usb starts and works with libusb-1.0.18 it is
> very unstable. I experience driver crashes every 2-3 days, while with
> libusb-1.0.9 driver worked for months.

I'm not too surprised. Between libusb-1.0.9 and 1.0.18 the libusbx developers took over the libusb sourceforge project and simply released the libusbx code as libusb.


> I am aware this is not Gentoo issue, I've posted this as a notice for other
> Gentoo users who may suffer from this bug.

I do think it would be a good idea for Gentoo to have libusb-1.0.9 be the only stable version, since it does not have several of the libusbx issues.

See also bug #503404.
Comment 18 Coacher 2014-03-18 07:28:29 UTC
Unfortunately, sys-power/nut-2.7.1 has the same stability issues with libusb-1.0.18 as 2.6.5-r1.
Comment 19 Coacher 2014-03-19 07:41:30 UTC
Another note: today was a power outage and the driver died as soon as UPS switched to battery. libusb-1.0.18 renders nut completely useless. This is with nut-2.7.1. I'll create upstream bug on this matter soon.