It's tempting for MongoDB developers to use --link-model=dynamic to skip the slow link step when building the server. However, it's natural to also use tcmalloc (the default), the mongodbtoolchain compiler, and --dbg=on. This leads the server to crash with "memory allocation/deallocation mismatch", which is difficult to diagnose (
To save developers from a frustrating investigation, SCons should fail if it detects this combination of flags. Perhaps the rule is enforced within files like mongodbtoolchain_v3_gcc.vars and its family.
SERVER-49925 Dynamic builders should not combine the mongodbtoolchain with tcmalloc
- related to
SERVER-27675 tcmalloc must be explicitly linked by all targets in dynamic builds