<html><body><div style="color:; background-color:; font-family:arial, helvetica, sans-serif;font-size:13px"><div><span>This is with a version of rtl-sdr I got by git last night and OpenBSD 5.2 (current release).  5.2 has some pthreads fixing so I waited until I bought another computer and loaded it.  Are the crashes related to threads?  I don't know, but possibly.  It didn't work with OpenBSD 5.0 either.</span></div><div style="color: rgb(0, 0, 0); font-size: 13px; font-family: arial,helvetica,sans-serif; background-color: transparent; font-style: normal;"><br><span></span></div><div style="color: rgb(0, 0, 0); font-size: 13px; font-family: arial,helvetica,sans-serif; background-color: transparent; font-style: normal;"><span>rtl_fm crashes and uses threads                      <br>rtl_adsb crashes and uses
 threads                    <br>rtl_tcp doesn't crash, uses threads, actually stops on ctrl-c<br>rtl_test doesn't crash, doesn't use threads, won't stop<br>rtl_eeprom doesn't crash, doesn't use threads, ends normally<br></span></div><div style="color: rgb(0, 0, 0); font-size: 13px; font-family: arial,helvetica,sans-serif; background-color: transparent; font-style: normal;"><br><span></span></div><div style="color: rgb(0, 0, 0); font-size: 13px; font-family: arial,helvetica,sans-serif; background-color: transparent; font-style: normal;"><span>I'm not real practiced using gdb but I tried looking at a couple of core files, here's a run of  rtl_fm:</span></div><div style="color: rgb(0, 0, 0); font-size: 13px; font-family: arial,helvetica,sans-serif; background-color: transparent; font-style: normal;"><br><span></span></div><div style="color: rgb(0, 0, 0);
 font-size: 13px; font-family: arial,helvetica,sans-serif; background-color: transparent; font-style: normal;"><span>rtl_fm -f 162550000 -N - | play -t raw -r 24k -e signed-integer -b 16 -c 1<br>-V1 -<br><br>-: (raw)<br><br>  Encoding: Signed PCM<br>  Channels: 1 @ 16-bit<br>Samplerate: 24000Hz<br>Replaygain: off<br>  Duration: unknown<br><br>In:0.00% 00:00:00.00 [00:00:00.00] Out:0     [      |      ]        Clip:0<br>Found 1 device(s):<br>  0:  Realtek, RTL2838UHIDIR, SN: 00000013<br><br>Using device 0: ezcap USB 2.0 DVB-T/DAB/FM dongle<br>Found Rafael Micro R820T tuner<br>Oversampling input by: 42x.<br>Oversampling output by: 1x.<br>Buffer size: 8.13ms<br>Tuned to 162802000 Hz.<br>Sampling at 1008000 Hz.<br>Output at 24000 Hz.<br>Exact sample rate is: 1008000.009613 Hz<br>Tuner gain set to automatic.<br>In:0.00% 00:00:00.00
 [00:00:00.00] Out:0     [      |      ]        Clip:0<br>Done.<br>Abort (core dumped)<br></span></div><div style="color: rgb(0, 0, 0); font-size: 13px; font-family: arial,helvetica,sans-serif; background-color: transparent; font-style: normal;"><br><span></span></div><div style="color: rgb(0, 0, 0); font-size: 13px; font-family: arial,helvetica,sans-serif; background-color: transparent; font-style: normal;"><span>d530# gdb -c rtl_fm.core /usr/local/bin/rtl_fm<br>GNU gdb 6.3<br>Copyright 2004 Free Software Foundation, Inc.<br>GDB is free software, covered by the GNU General Public License, and you are<br>welcome to change it and/or distribute copies of it under certain<br>conditions.<br>Type "show copying" to see the conditions.<br>There is absolutely no warranty for GDB.  Type "show warranty" for details.<br>This GDB was configured as
 "i386-unknown-openbsd5.2"...<br>Core was generated by `rtl_fm'.<br>Program terminated with signal 6, Aborted.<br>Reading symbols from /usr/lib/libpthread.so.16.0...done.<br>Loaded symbols for /usr/lib/libpthread.so.16.0<br>Reading symbols from /usr/lib/libm.so.7.0...done.<br>Loaded symbols for /usr/lib/libm.so.7.0<br>Reading symbols from /usr/local/lib/librtlsdr.so.0.0...done.<br>Loaded symbols for /usr/local/lib/librtlsdr.so.0.0<br>Reading symbols from /usr/local/lib/libusb-1.0.so.1.0...done.<br>Loaded symbols for /usr/local/lib/libusb-1.0.so.1.0<br>Symbols already loaded for /usr/lib/libpthread.so.16.0<br>Reading symbols from /usr/lib/libc.so.65.0...done.<br>Loaded symbols for /usr/lib/libc.so.65.0<br>Loaded symbols for /usr/libexec/ld.so<br>#0  0x0abbd98d in kill () from /usr/lib/libc.so.65.0<br>(gdb) bt<br>#0  0x0abbd98d in kill () from /usr/lib/libc.so.65.0<br>#1  0x0ac29545 in abort () at
 /usr/src/lib/libc/stdlib/abort.c:68<br>#2  0x005e9298 in pthread_mutex_unlock (mutexp=0x3c003d8c)<br>    at /usr/src/lib/librthread/rthread_sync.c:218<br>#3  0x1c00266e in full_demod (fm=0xcfa2de5c)<br>    at /usr/src/misc/osmocom/2013-04-15/rtl-sdr/src/rtl_fm.c:583<br>#4  0x1c0028ff in demod_thread_fn (arg=0xcfa2de5c)<br>    at /usr/src/misc/osmocom/2013-04-15/rtl-sdr/src/rtl_fm.c:641<br>#5  0x005ebc2e in _rthread_start (v=0x84da4c00)<br>    at /usr/src/lib/librthread/rthread.c:111<br>#6  0x0aba62e9 in __tfork_thread () from /usr/lib/libc.so.65.0<br></span></div><div style="color: rgb(0, 0, 0); font-size: 13px; font-family: arial,helvetica,sans-serif; background-color: transparent; font-style: normal;"><br><span></span></div><div style="color: rgb(0, 0, 0); font-size: 13px; font-family: arial,helvetica,sans-serif; background-color: transparent; font-style:
 normal;"><span>The backtrace (bt) shows that it dies trying to do a mutex_unlock (I think).  rtl_tcp also does a mutex_unlock and it doesn't crash.  I'm probably reading it wrong for all I know.  I don't know what's causing the signal 6 either.</span></div><div style="color: rgb(0, 0, 0); font-size: 13px; font-family: arial,helvetica,sans-serif; background-color: transparent; font-style: normal;"><br><span></span></div><div style="color: rgb(0, 0, 0); font-size: 13px; font-family: arial,helvetica,sans-serif; background-color: transparent; font-style: normal;"><span>I'd also like to get the -lrt of of the cmake files.  OpenBSD doesn't use or have lrt, it works without.  I can edit it out and compile, but every time I run cmake again, I have to edit the files again.</span></div><div style="color: rgb(0, 0, 0); font-size: 13px; font-family: arial,helvetica,sans-serif; background-color: transparent; font-style:
 normal;"><br><span></span></div><div style="color: rgb(0, 0, 0); font-size: 13px; font-family: arial,helvetica,sans-serif; background-color: transparent; font-style: normal;"><span>  Alan<br></span></div><div> </div><div>-----<br>Radio Astronomy - the ultimate DX<br></div></div></body></html>