Segfaults in libusb / rtlsdr_close

Oliver Jowett oliver.jowett at gmail.com
Sat Jan 17 18:21:47 UTC 2015


I'm seeing crashes in libusb when calling rtlsdr_close, typically like this:

cancel_async
cancel_async done
pthread_join
read_async returned
lock mutex
signal cond
unlock mutex
thread finishing
pthread_join done
closing device
rtlsdr_demod_write_reg failed with -1
rtlsdr_demod_read_reg failed with -1
r82xx_write: i2c wr failed=-1 reg=06 len=1
rtlsdr_demod_write_reg failed with -1
rtlsdr_demod_read_reg failed with -1
rtlsdr_write_reg failed with -1
[Thread 0xb6cd5470 (LWP 3232) exited]

Program received signal SIGSEGV, Segmentation fault.
0xb6ef6c28 in libusb_submit_transfer () from
/lib/arm-linux-gnueabihf/libusb-1.0.so.0
(gdb) bt
#0  0xb6ef6c28 in libusb_submit_transfer () from
/lib/arm-linux-gnueabihf/libusb-1.0.so.0
#1  0xb6ef83cc in libusb_control_transfer () from
/lib/arm-linux-gnueabihf/libusb-1.0.so.0
#2  0xb6f0bfa4 in ?? () from /usr/lib/arm-linux-gnueabihf/librtlsdr.so.0
Cannot access memory at address 0x2ebd8a8

(Yeah, the stack's not very useful, but the eventual caller is
definitely rtlsdr_close)

There's a thread blocked in rtlsdr_read_async(), but I call
rtlsdr_cancel_async() and wait for rtlsdr_read_async() to return (and
the thread to terminate) before trying to close the device.

This is with the current github version of librtlsdr on a Raspberry Pi
with libusb 1.0.11 from the standard Raspbian package (2:1.0.11-1)

Anyone seen this before?

Oliver



More information about the osmocom-sdr mailing list