1 solution

Solution 1

I don't claim to understand what all this is doing but consider these lines:

if(!fq->empty())
{
queue_mutex.lock();
e = fq->front();

What happens if the the queue is not empty when the condition is tested but it is empty before the lock is asserted?
This can happen which is the same as to say it will happen. Perhaps you need to move the lock before the check or redo the check inside the lock?

Not sure in that case. I would start by confirming that the error occurs during the fq->pop(); call. Perhaps even comment that out to confirm it then doesn't crash although of course the fifo will fill up and the same message will get processed repeatedly. Anyway it seems like its claiming there's a pop from an empty queue which is wierd. Sorry I can't really help you futher.