Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-1517

Turn on heapchecking in jstests on Linux 32 build

    • Type: Icon: Improvement Improvement
    • Resolution: Won't Fix
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: Testing Infrastructure
    • Labels:
      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

            Assignee:
            backlog-server-tig DO NOT USE - Backlog - Test Infrastructure Group (TIG)
            Reporter:
            alerner Alberto Lerner
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: