opencog/atomspace-cog

unit tests pass but have unclean cogserver shutdown.

linas opened this issue · 0 comments

linas commented

Really annoying pseudo-problem: unit tests, after passing, sometimes fault during cog-server shutdown, typically with the error message corrupted size vs. prev_size but sometimes others.

The root cause of this is that different shared-lib dtors are racing with each other; one of them is the dtor for the cogutils logger. If it waits too long, it ends up trying to free memory after malloc() and free() have been destroyed. Thus the corrupted size error.

This is super-annoying. I spent a day trying to find a solution for this but could not. Placing sleeps in various places did not work. The bug is not really here, its in the cog-utils Logger but it manifests here and a few other places, sometimes. I don't know what to do ....