FlightAware Discussions

Dump1090-fa behaviour for SDR returning no samples

Hey @obj, i remember having to kill -9 in case dump1090-fa reported wedging or the rtl-sdr.
Maybe rtlsdr_cancel_async(RTLSDR.dev) would be a good idea when the SDR doesn’t give back samples for maybe 5 seconds?
Also it might make sense to not pthread_join the readerThread but rather pthread_timedjoin_np with a 10 second timeout? (and exit without cleanup when it fails)

An patch along those lines might work: (untested. also i know the code changed but you get the picture)
https://github.com/wiedehopf/readsb/commit/e40d0e2da554779fbc834899f85bbc3e6975d26b

In some of these paths, I think librtlsdr has totally wedged; there may not be a ton that can be done short of finding and fixing the librtlsdr bugs (it has poor error handling…)

pthread_timedjoin_np is an option (it is non-portable as the _np implies but we could use it where available) but as you say we need to bail out immediately if that fails as we’re in an indeterminate state. At that point you can’t even safely call exit(), you’d probably need to send a SIGKILL to yourself.

1 Like