[Nut-upsdev] libusb_get_string: invalid argument

Greg Hersch hersch.greg at gmail.com
Wed Jun 10 16:18:34 UTC 2015


And here are the logs and GDB output from the reconfigured/recompiled CFLAGS=-G 
program. You will notice i made a change to the version definition of 
tripplite-hid.c just to make sure i am working with the updated version.

On Tue, 9 Jun 2015, Charles Lepple wrote:

> On Jun 9, 2015, at 4:55 PM, Greg Hersch wrote:
>
>> (gdb) bt
>> #0  libusb_get_string (udev=0x43110, StringIdx=0, buf=0x40204 <buf>
>> "", buflen=20) at libusb.c:496
>> #1  0x00015330 in HIDGetIndexString (udev=<optimized out>,
>> Index=<optimized out>, buf=0x40204 <buf> "", buflen=<optimized out>)
>> at libhid.c:407
>> #2  0x00012e18 in ups_infoval_set (item=0x3ee48 <tripplite_hid2nut>,
>> value=<optimized out>) at usbhid-ups.c:1552
>> #3  0x00013da8 in upsdrv_updateinfo () at usbhid-ups.c:835
>> #4  0x00012410 in main (argc=<optimized out>, argv=<optimized out>) at
>> main.c:708
>
> You did everything right on the backtrace, but that is puzzling.
>
> At #2, ups_infoval_set() apparently calls HIDGetIndexString(), but I don't see where it does that in the code. There must be some pointers, or something.
>
> The easiest thing might be to crank the debug output up a bit more (5x -D, even) but since that will be a bit more output, please redirect it to a file, and gzip the log before attaching it. Doesn't need to be long, just enough to see one or two errors.
>
> Another idea is to recompile without optimizations, to see if that helps the gdb backtrace. NUT apparently sets CFLAGS=-O if it is not set already, so adding "CFLAGS=-g" to the ./configure line should do it.
>
> Arnaud, am I missing something obvious here? After making "device.part" HU_STATIC, there shouldn't be any other string descriptors retrieved in drivers/tripplite-hid.c.
>
> -- 
> Charles Lepple
> clepple at gmail
>
>
>
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: typescript-GDB-withCFLAGchange.gz
Type: application/octet-stream
Size: 11751 bytes
Desc: 
URL: <http://lists.alioth.debian.org/pipermail/nut-upsdev/attachments/20150610/1845f030/attachment-0002.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: typescript_LOG_withCFLAG.gz
Type: application/octet-stream
Size: 15343 bytes
Desc: 
URL: <http://lists.alioth.debian.org/pipermail/nut-upsdev/attachments/20150610/1845f030/attachment-0003.obj>


More information about the Nut-upsdev mailing list