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

Catalog Cache async task accesses un-owned StringData variable

    XMLWordPrintableJSON

Details

    • Fully Compatible
    • ALL
    • Sharding 2020-08-10
    • 43

    Description

      Cache loader access un-owned variable causing use-after-free memory access error.
      These are the two different places that implement this wrong pattern:

      StringData object wraps a 'const std::string&' or a 'const char*' without copying its contents. Thus keeping alive the StringData object itself doesn't guarantee that the underlying char array won't be freed. For this reason when capturing such an object in an async task an explicit copy of the underlying data needs to be performed.

      Attachments

        Activity

          People

            tommaso.tocci@mongodb.com Tommaso Tocci
            tommaso.tocci@mongodb.com Tommaso Tocci
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: