cogutil
                                
                                 cogutil copied to clipboard
                                
                                    cogutil copied to clipboard
                            
                            
                            
                        Crash in logger during shutdown.
When the CogServer is shut down, there is a shared-library dtor race condition, where the cogutil logger threads are still running, even though the shared library is now gone. This looks like a crash, but the crash occurs only after the cogserver has exited (and after all unit tests have passed.) This makes test passes look like failures.
This only happens once out of every ten runs.
I first spotted this many years ago, and have repeatedly spent a lot of time trying to fix it, by adding more locks, a few sleep()s here and there, and any other trick I could think of, including not calling delete and making class dtors into no-ops. Despite great effort, I've been unable to find a fix.  It seems appropriate to report this as a formal bug.
This is most easily demonstrated with the unit tests in https://github.com/opencog/atomspace-cog/ which "always" consistently pass... and then commonly crash during the shared library unload when the cogserver is stopped. This is ugly and undesired. (Out of 24 unit tests, it is likely that at least one will crash due to this bug.)
One thing I have not tried, yet -- using
__attribute__((destructor (PRIORITY)))
for the shared-lib dtors. The higher-priority dtors will run earlier.