-
Type: Improvement
-
Resolution: Won't Fix
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: Testing Infrastructure
-
None
-
Fully Compatible
Perhaps we could introduce google heap checker in our builds. Here's
how I hacked it here:
1) Compile code with -fno-frame-omit-pointer
Basically, this means we give up one register during execution.
But the location of stack frame pointers is always kept in that
register, so backtracing the stack accurately is possible without code
knowledge.
We may or may not care; need measure perf. Worst case, do it in --d builds only.
2) We link mongo, mongos, and mongod with tcmalloc
It must be the last library to be linked to.
3) In shell_utils.cpp
We need to differentiate the cases when we want to activate heap-checking.
Use execvpe() instead of execvp() and pass "HEAPCHECK=normal" in the
env, is all.
4) Say we're monitoring leaks on mongos, e.g. we're running jstests/sharding/*
s.stop would check the exit code of that process
heapcheck exits with error if it thinks it found a leak
5) Instrument mongo::mutex::~mutex() as a false positive, so that
mongos exist cleans even with that. We can hide the instrumenting code
behind ENTRY_HEAP_EXCEPTION / EXIT_HEAP_EXCEPTION macros
- related to
-
SERVER-4683 switch allocator - tcmalloc or jemalloc
- Closed