Monday, February 22, 2016

[SOLVED] gqrx crash on startup

I plugged the SDR dongle in and launched gqrx. All seemed to go well, however as soon as I git the 'Start DSP' button, it crashed with
gqrx: symbol lookup error: /usr/lib/x86_64-linux-gnu/librtlsdr.so.0: undefined symbol: libusb_handle_events_timeout_completed

Googling for the error message found just a few hits: An ages old bug caused by bad versioning and a newer question without answer.
If the web doesn't have the answer, I'll need to find it myself, so ...
hajma@debian:~$ ldd -d /usr/lib/x86_64-linux-gnu/librtlsdr.so.0
linux-vdso.so.1 (0x00007ffc29380000)
libusb-1.0.so.0 => /usr/local/lib/libusb-1.0.so.0 (0x00007f9ea0fd7000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f9ea0c2c000)
librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007f9ea0a24000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f9ea0807000)
/lib64/ld-linux-x86-64.so.2 (0x00007f9ea13f3000)

hajma@debian:~$ readelf -s /usr/local/lib/libusb-1.0.so.0|grep libusb_handle_events_
60: 0000000000005e70 215 FUNC GLOBAL DEFAULT 12 libusb_handle_events_time
80: 00000000000058a0 92 FUNC GLOBAL DEFAULT 12 libusb_handle_events_lock
237: 0000000000005e70 215 FUNC GLOBAL DEFAULT 12 libusb_handle_events_time
258: 00000000000058a0 92 FUNC GLOBAL DEFAULT 12 libusb_handle_events_lock
Indeed, there's no libusb_handle_events_timeout_completed in there.
hajma@debian:~$ grep libusb_handle_events_timeout_completed /usr/include/libusb-1.0/libusb.h 
int LIBUSB_CALL libusb_handle_events_timeout_completed(libusb_context *ctx,
but the header file has it, what's up? It took me a minute or two to realize that the library resides in /usr/local/lib. That's an unusual place for a Debian library, isn't it?
hajma@debian:~$ ls -l /usr/local/lib/libusb-1.0.so.0
lrwxrwxrwx 1 root root 17 Jan 25  2014 /usr/local/lib/libusb-1.0.so.0 -> libmchpusb-1.0.so
and googling for libmchpusb-1.0.so found me the answer:

This is actually a library supplied with Microchip's MPLAB-X software I installed two years ago. It seems to be an ongoing source of frustration for their users :-)
/usr/local/lib is included by default on Debian:
hajma@debian:~$ cat /etc/ld.so.conf.d/libc.conf
# libc default configuration
/usr/local/lib
For the time being I workarounded this with simply removing /usr/local/lib/libusb-1.0.so.0 and it works quite well:

No comments:

Post a Comment