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

Give mongo::Value at least pointer alignment

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.4.17, 3.6.0-rc1
    • Component/s: None
    • Labels:
      None
    • Backwards Compatibility:
      Fully Compatible
    • Operating System:
      ALL
    • Backport Requested:
      v3.4, v3.2
    • Sprint:
      Repl 2017-10-23
    • Linked BF Score:
      0

      Description

      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

        Attachments

          Activity

            People

            Assignee:
            redbeard0531 Mathias Stearn
            Reporter:
            mark.benvenuto Mark Benvenuto
            Participants:
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: