This might be caused due to different reasons, some user have mentioned other possibilities and I add my case:
I got this error when using multi-threading (both std::pthread
and std::thread
) and the error occurred because I forgot to lock a variable which multi threads may change at the same time.
this error comes randomly in some runs but not all because ... you know accident between to threads is random.
That variable in my case was a global std::vector
which I tried to push_back()
something into it in a function called by threads.. and then I used a std::mutex
and never got this error again.
may help some