As the KB page points out, there are problems witl libjemalloc 2.2.5, which make MariaDB with TokuDB crash rather easily.
It would be nice to prevent this.
Since libjemalloc is linked dynamically by default, it is not so easy to do.
As already discussed, it might be useful to add a check in cmake.
- it will forbid the scenario when a server is built on the same machine where it is supposed to be run, if this machine has the bad libjemalloc;
- won't allow to link the bad libjemalloc version statically, that is, to produce hopeless binaries;
- one might on some reason want to build on a machine with old libjemalloc (e.g. only have a build environment there), while actually using the binaries on another machine, with a new libjemalloc. Technically, it should be fine, but the new check in cmake will not allow it;
- a check in cmake won't solve the problem when binaries are built on some other machine, and then run on a machine with the old libjemalloc.
Another approach could be to check for libjemalloc version on server startup, and disallow to start if the version is bad (or disallow to start TokuDB, if it's only a problem for TokuDB).
- solves the exact runtime issue;
- it's just weird.