Skip to content

SIGSEGV from libusb_control_transfer() when called from nut_libusb_get_report in usbhid-ups driver #3100

@nbriggs

Description

@nbriggs

Talking to the folowing UPS:

   0.042299     [D2] Checking device 1 of 5 (04B3/0001)
   0.393839     [D2] - VendorID: 04b3
   0.393940     [D2] - ProductID: 0001
   0.393996     [D2] - Manufacturer: IBM
   0.394053     [D2] - Product: IBM 1000VA/750W Tower UPS
   0.394110     [D2] - Serial Number: 23A4881                     
   0.394164     [D2] - Bus: 002
   0.394219     [D2] - Bus Port: 001
   0.394287     [D2] - Device: 005
   0.394341     [D2] - Device release number: 0100

the usbhid-ups driver takes a SIGSEGV always within the first 30s or so of startup. It's always at the same call to libusb_control_transfer(), and it has often gone through the same lines of code a few times before the segmentation fault happens.

There's no debug version of libusb-1.0 easily available, so I can't localize this more accurately.

  18.504005     [D1] upsdrv_updateinfo...
  18.504107     [D1] Not using interrupt pipe...
  18.504169     [D1] Quick update...
  18.504228     [D4] Entering libusb_get_report

Thread 2 received signal SIGSEGV, Segmentation fault.
[Switching to Thread 1 (LWP 1)]
0xffffffff7c010cd0 in libusb_control_transfer () from /usr/lib/64/libusb-1.0.so.0
(gdb) 
(gdb) bt
#0  0xffffffff7c010cd0 in libusb_control_transfer () from /usr/lib/64/libusb-1.0.so.0
#1  0x0000000100023e70 in nut_libusb_get_report (udev=0x100165f40, ReportId=<optimized out>, raw_buf=0x100160700 "&\004\004", ReportSize=3) at libusb1.c:924
#2  0x0000000100022ec4 in refresh_report_buffer (pData=0x100166f00, rbuf=0x10016b4a0, udev=0x100165f40, age=<optimized out>) at libhid.c:231
#3  get_item_buffered (rbuf=0x10016b4a0, udev=0x100165f40, pData=0x100166f00, Value=0xffffffff7fffe728, age=<optimized out>) at libhid.c:268
#4  HIDGetDataValue (udev=0x100165f40, hiddata=0x100166f00, Value=0xffffffff7fffe7f8, age=<optimized out>) at libhid.c:523
#5  0x000000010001f0e8 in hid_ups_walk (mode=HU_WALKMODE_QUICK_UPDATE) at usbhid-ups.c:1753
#6  0x000000010002050c in upsdrv_updateinfo () at usbhid-ups.c:1185
#7  0x0000000100031c08 in main (argc=<optimized out>, argv=<optimized out>) at main.c:2682

The full debug level 4 trace is attached.

usbhid-sigsegv.txt

Metadata

Metadata

Assignees

No one assigned

    Labels

    Solaris/illumosSolaris and illumos systems (OpenIndiana, OmniOS, SmartOS, TribbliX...)USBbug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions