Sorry, don't know a lot of about computer language is C++.
Anyways, since it happened more than one time, why don't we do what microsoft does.
You know how they always have those forms you have to fill out:
What were you doing when it happened?
Did it happen more than once....
So if we see a pattern to develop, then it is easier to locate the bug.