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

Using Windows mongoclient.dll, statics have duplicate storage

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 2.5.5
    • Affects Version/s: None
    • Component/s: Internal Client
    • None
    • Fully Compatible
    • ALL
    • Hide

      Build mongoclient.lib/.dll.
      Build simple_client_demo.cpp, link against mongoclient.lib. Run the program and you will crash in the constructor for DBClientBase.

      Show
      Build mongoclient.lib/.dll. Build simple_client_demo.cpp, link against mongoclient.lib. Run the program and you will crash in the constructor for DBClientBase.

      It appears that if you link against mongoclient.dll in your project and then execute code that uses a static variable that's declared in the header but has storage reserved in the C++ driver, it may crash. The compiler seems to be allocating storage space for the static variable in the local application even though it should only be using the storage in the DLL.

            Assignee:
            mark.benvenuto@mongodb.com Mark Benvenuto
            Reporter:
            milkie@mongodb.com Eric Milkie
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: