dab-cmdline
dab-cmdline copied to clipboard
dabProcessor::reset sometimes terminates the app
I noticed in sdrangel, which uses a fork of dab-cmdline. that occasionally, when switching channel, the app crashes.
looking into this, this is in the thread-assignment operator, which checks if the current thread is still joinable ( -> it is still running ) and then terminates the app.
Two threads are terminated simultaneously:
- dabProcessor::start() -> terminate
- dabProcessor::run() -> mscHandler::start() -> terminate
other threads running:
- dabProcessor::run() -> sampleReader::getSample(int)
- mscHandler::run() -> cond_timedwait
- mscHandler::run() -> cond_timedwait
I don't have a debug build, so I can't tell if these are all for the same object.
Looking at dabProcessor, the stop()
method seems suspect. I think the sleep(1)
call looks like an attempt to work around a synchronisation problem. Which may be the root cause.
willem