A quick run of TSAN has picked up a number of issues, especially in aggregate code.
For example it appears there is an assumption that 'volatile' means a variable is atomic when it doesn't in C++ (it kinda does in Java). This could cause some counters to be inaccurate. In this instance either stdlib or boost atomics should be used.
We should run TSAN and fix the issues. This will mean using a modern OS such as Ubuntu 18.04. Kernel memory mapping issues in older Linux OSes prevent compiling.