libusb

I am trying to use python to talk to usb devices.
It is not working very well, and I would like to call atention to this.
I used pip to install pyusb. Calling show_devics() twice will cause a segfault.

FreeBSD 12.1 AMD64
Python 3.7.9
Code:
python -c "from usb.core import show_devices; print(show_devices()); print(show_devices())"
DEVICE ID 0403:6014 on Bus 000 Address 010, Specified at interface
DEVICE ID 04d8:9012 on Bus 000 Address 009, Specified at interface
DEVICE ID 05e3:0608 on Bus 000 Address 008, Hub
DEVICE ID 1462:7c37 on Bus 000 Address 007, Specified at interface
DEVICE ID 093a:2510 on Bus 000 Address 006, Specified at interface
DEVICE ID 413c:2107 on Bus 000 Address 005, Specified at interface
DEVICE ID 0000:0000 on Bus 000 Address 004, Hub
DEVICE ID 0000:0000 on Bus 000 Address 003, Hub
DEVICE ID 0000:0000 on Bus 000 Address 002, Hub
DEVICE ID 0000:0000 on Bus 000 Address 001, Hub

Segmentation fault (core dumped)
I believe there is a problem with the usb implementatin in the FreeBSD kernel.
Can anyone shed some light on this please ? I am in over my head here.

Thank you,
 
It works fine here:
Code:
$ freebsd-version -ku
12.1-RELEASE-p9
12.1-RELEASE-p9

$ sudo python3.7 -c "from usb.core import show_devices; print(show_devices()); print(show_devices())"
DEVICE ID 0000:0000 on Bus 002 Address 001, Hub
DEVICE ID 0000:0000 on Bus 005 Address 001, Hub
DEVICE ID 0000:0000 on Bus 003 Address 001, Hub
DEVICE ID 0000:0000 on Bus 000 Address 001, Hub
DEVICE ID 0000:0000 on Bus 006 Address 001, Hub
DEVICE ID 0000:0000 on Bus 001 Address 001, Hub
DEVICE ID 0000:0000 on Bus 004 Address 001, Hub
DEVICE ID 0bda:0158 on Bus 003 Address 002, Specified at interface
DEVICE ID 046d:c01d on Bus 004 Address 002, Specified at interface

DEVICE ID 0000:0000 on Bus 002 Address 001, Hub
DEVICE ID 0000:0000 on Bus 005 Address 001, Hub
DEVICE ID 0000:0000 on Bus 003 Address 001, Hub
DEVICE ID 0000:0000 on Bus 000 Address 001, Hub
DEVICE ID 0000:0000 on Bus 006 Address 001, Hub
DEVICE ID 0000:0000 on Bus 001 Address 001, Hub
DEVICE ID 0000:0000 on Bus 004 Address 001, Hub
DEVICE ID 0bda:0158 on Bus 003 Address 002, Specified at interface
DEVICE ID 046d:c01d on Bus 004 Address 002, Specified at interface
 
Back
Top