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

Give mongo::Value at least pointer alignment

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 3.4.17, 3.6.0-rc1
    • Affects Version/s: None
    • Component/s: None
    • Labels:
      None
    • Fully Compatible
    • ALL
    • v3.4, v3.2
    • Repl 2017-10-23
    • 0

      The Value type holds pointers but currently has alignment of 1. Since LSAN by default only looks for pointers in aligned addresses, it can report false-positive leaks of memory pointed to by a misaligned Value. This will be fixed by giving Value at least pointer alignment.

      Original title: Use use_unaligned for LSAN

      Original Description:

      Pointers to the RCString class may be stored in memory not aligned to 8 bytes, and therefore LSAN does not mark the RCString as reachable. This results in false positive leak reports.

      To fix, pass "use_unaligned=1" in the LSAN_OPTIONS environment variable.

      See
      https://github.com/llvm-mirror/compiler-rt/blob/b3c632084941e7b9669416f91c7f90b7fcd49645/lib/lsan/lsan_common.cc#L160-L165
      https://github.com/llvm-mirror/compiler-rt/blob/b3c632084941e7b9669416f91c7f90b7fcd49645/lib/lsan/lsan_common.h#L71-L73

            Assignee:
            mathias@mongodb.com Mathias Stearn
            Reporter:
            mark.benvenuto@mongodb.com Mark Benvenuto
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: